STC8A8K64D4 Series Manual
SWRST: Software reset control bit.
0: No operation.
1: Generate software reset.
CMD_FAIL: Command fail status bit for EEPROM operation which should be cleared by software.
0: EEPROM operation is right.
1: EEPROMoperation fails.
16.2.6 EEPROM erase wait time control register (IAP_TPS)
Symbol
Address
IAP_TPS
F5H
Need to be set according to the operating frequency. If the working frequency is 12MHz, IAP_TPS needs to be set to
12; if the working frequency is 24MHz, IAP_TPS needs to be set to 24, and so on for other frequencies.
16.3 EEPROM Size and Address
There is EEPROM for saving user data in all STC8A8K64D4 series of microcontrollers. There are three operation
modes for the internal EEPROM: reading, writing, and erasing. The erasing operation is performed in sectors. Each
sector has 512 bytes. That is, each time an erasing command will erase a sector when it executes. The reading and
writing operations are in bytes, that is, only one byte can be read or written each time when a reading or writing
command is executed.
There are two ways to access the internal EEPROM of STC8A8K64D4 series microcontrollers: IAP mode and
MOVC mode. The IAP mode can perform reading, writing and erasing operations on the EEPROM. MOVC can only
perform reading operations on the EEPROM, cannot perform writing and erasing operations. Regardless of whether
IAP or MOVC is used to access the EEPROM, the correct target address must be set firstly. In IAP mode, the target
address is the same as the actual physical address of the EEPROM. Both of them are accessed from address 0000H.
However, when using MOVC instruction to read EEPROM data, the target address must be the actual physical address
of the EEPROM plus a program size offset. STC8A8K64D4 is used as an example to describe the target address in
detail as following:
The program space of STC8A8K60D4 is 60K bytes (0000h ~ EFFFh), and the EEPROM space is 4K bytes (0000h
~ 0FFFh). When you need to read, write, and erase the unit with EEPROM physical address 0234h, if you use IAP to
access, set the target address to 0234h, that is, IAP_ADDRH is set to 02h, IAP_ADDRL is set to 34h, and then the
corresponding trigger command can be set and the 0234h can be operated correctly. However, if the 0234h unit of the
B7
B6
B5
-
-
B4
B3
B2
IAPTPS[5:0]
B1
B0
- 450 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?