STC8A8K64D4 Series Manual
-
OV: Overflow flag bit
F1: User flag bit 1
P: Parity flag bit.
There are 16 bytes in the bit addressable space, 20H to 2FH. They can either be accessed by byte like ordinary RAM or
be individually accessed by any one bit in the byte unit. There are totally 128 bits in this space, whose logic bit addresses are
00H to 7FH. From the appearance, bit addresses and the internal Lower 128 bytes RAM addresses are the same as 00H to
7FH, but in fact, they are essentially different: bit address points to a bit, and the byte address points to a byte unit. They are
distinguished by using different instructions in programs.
The addresses 30H to FFH in the internal RAM are the user RAM and stack space. An 8-bit stack pointer, SP in short is
used to point to the stack space. On reset, SP is 07H, which is R7 of register bank 0. Therefore, the initial value of SP should
be set in the user 104nitialization codes. You would better to set the initial value of SP at 80H or higher.
SP is an 8-bit dedicated register. It indicates the top of the stack in the internal RAM. On reset, SP is initialized to 07H,
which makes the stack space begin from 08H. The addresses 08H to 1FH are also the addresses of working register bank 1
through 3. It is better to change the SP value to a value of 80H or more if these spaces are used in user application. The stack
of STC8 series of microcontrollers grows upward, which means that when a datum is pushed into the stack, the content of SP
will increase.
7.2.3 On-chip extended RAM
In addition to 256 bytes of internal RAM, on-chip extended RAM is integrated in STC8A8K64D4 series of
microcontrollers. The method of accessing the on-chip extended RAM is the same as that of the traditional 8051 MCU
accessing the external extended RAM. However, the P0 port (data bus and low-order address bus), P2 port (high-order address
bus), RD, WR and ALE are not affected.
In assembly language, the on-chip extended RAM is accessed through the MOVX instruction,
MOVX A,@DPTR
MOVX @DPTR,A
MOVX A,@Ri
MOVX @Ri,A
In C language, xdata / pdata can be used to declare the storage type, such as,
unsigned char xdata i;
The control bit EXTRAM located in AUXR register is used to control the access of on-chip extended RAM can be used
or not.
7.2.4 Auxiliary register (AUXR)
EXTRAM: on-chip extended RAM access control bit
0: On-chip extended RAM is enabled or can be accessed.
1: On-chip extended RAM is disabled.
7.2.5 External extended RAMXRAMXDATA
The STC8A8K64D4 series of packages with a pin count of 40 and above have the ability to expand 64KB of external data
memory. During access to the external data memory, the WR/RD/ALE signal must be valid. A new special function register
BUS_SPEED for controlling the speed of the external 64K byte data bus has been added to the STC8A8K64D4 series of single-
chip microcomputers. The description is as follows: