EasyManua.ls Logo

STC micro STC8A8K64D4 Series - EEPROM Address Registers (IAP_ADDR); EEPROM Command Register (IAP_CMD); EEPROM Trigger Register (IAP_TRIG); EEPROM Control Register (IAP_CONTR)

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- 449 -
During EEPROM being read operation, the EEPROM data be read after the command execution is completed is
stored in the IAP_DATA register. When writing the EEPROM, the data to be written must be stored in the IAP_DATA
register before the write command is sent. The erase EEPROM command is not related to the IAP_DATA register.
16.2.2 EEPROM address registers (IAP_ADDR)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
IAP_ADDRH
C3H
IAP_ADDRL
C4H
The target address register of EEPROM for reading, writing and erasing operation. IAP_ADDRH is the high byte
address, and IAP_ADDRL is the low byte of the address.
16.2.3 EEPROM command register (IAP_CMD)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
IAP_CMD
C5H
-
-
-
-
-
-
CMD[1:0]
CMD[1:0]: EEPROM operation command to be sent.
00: No operation.
01: EEPROM reading command. Read one byte from the destination address. Note: Writing operations can only
write 1 as 0 in the destination byte, not 0 as 1. Generally, when the target byte is not FFH, it must be erased first.
10: EEPROM writing command. Write one byte from the destination address.
11: EEPROM erasing command. Write one sector from the destination address. Note: The erase operation will
erase 1 sector (512 bytes) at a time, and the content of the entire sector will become FFH.
16.2.4 EEPROM trigger register (IAP_TRIG)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
IAP_TRIG
C6H
After setting the command register, address register, data register and control register of EEPROM for reading,
writing and erasing operation, 5AH and A5H are written to the trigger register IAP_TRIG sequentially to trigger the
corresponding operation. The order of 5AH and A5H can not be changed. After the operation is completed, the contents
of the EEPROM address registers IAP_ADDRH, IAP_ADDRL and the EEPROM command register IAP_CMD do not
change. The value of the IAP_ADDRH and IAP_ADDRL registers must be updated manually if the datum of the next
address needs to be operated.
Note: For every EEPROM operation, 5AH should be written to IAP_TRIG firstly and then A5H to take effect the
corresponding command. After the trigger command has been written, the CPU is in IDLE state until the corresponding
IAP operation completes. And then the CPU will return to the normal state from the IDLE and resume executing the
CPU instructions.
16.2.5 EEPROM control register (IAP_CONTR)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
IAP_CONTR
C7H
IAPEN
SWBS
SWRST
CMD_FAIL
-
-
-
-
IAPEN: EEPROM operation enable control bit.
0: disable EEPROM operation.
1: Enable EEPROM operation.
SWBS: Software reset selection control bit, which should be used with SWRST.
0: Execute the program from the user code area after the software reset.
1: Execute the program from the ISP memory area after the software reset.

Table of Contents

Related product manuals