EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Iap;Eeprom;Data-Flash; EEPROM Operation Time; Registers Related to EEPROM; EEPROM Data Register (IAP_DATA)

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
- 448 -
16 IAP/EEPROM/DATA-FLASH
Large capacity of internal EEPROM is integrated in STC8A8K64D4 series of microcontrollers. The internal Data
Flash can be used as EEPROM by using ISP / IAP technology. And it can be repeatedly erased more than 100,000
times. EEPROM can be divided into several sectors, each sector contains 512 bytes.
Note: The EEPROM write operation can only write the 1 in the byte as 0. When the 0 in the byte needs to be
written as 1, the sector erase operation must be performed. The read/write operation of EEPROM is performed in units
of 1 byte, while the erase operation of EEPROM is performed in units of 1 sector (512 bytes). During the erasing
operation, if there is something that needs to be reserved in the target sector Data, these data must be read into RAM
for temporary storage in advance, and then the saved data and the data to be updated will be written back to
EEPROM/DATA-FLASH after erasing is completed.
When EEPROM is used, it is recommended that the data modified at the same time be stored in the same sector,
and data modified at different time be stored in different sectors, and not necessarily full. Data memory is erased sector
by sector.
EEPROM can be used to save some parameters which need to be modified in the application and need be kept
when power down takes place. In the user program, byte read / byte programming / sector erase can be performed to
the EEPROM. When the operating voltage is low, it is recommended not to carry out EEPROM operation to avoid data
loss.
16.1 EEPROM operation time
Read 1 byte: 4 system clocks (use MOVC instruction to read more convenient and fast)
Programming 1 byte: about 3040us (the actual programming time is 67.5us, but state conversion time
and various control SETUP and HOLD time of the control signal)
Erase 1 sector (512 bytes): about 46ms
The time required for EEPROM operation is automatically controlled by the hardware, and the user only needs to set
the IAP_TPS register correctly.
IAP_TPS=System operating frequency/1000000 (the decimal part is rounded to the nearest whole number)
For example: the operating frequency of the system is 12MHz, then IAP_TPS is set to 12
Another example: the system operating frequency is 22.1184MHz, then IAP_TPS is set to 22
Another example: the system operating frequency is 5.5296MHz, then IAP_TPS is set to 6
16.2 Registers Related to EEPROM
Symbol
Description
Address
Bit Address and Symbol
Reset
Value
B7
B6
B5
B4
B3
B2
B1
B0
IAP_DATA
IAP Flash Data Register
C2H
1111,1111
IAP_ADDRH
IAP Flash Address High Byte
C3H
0000,0000
IAP_ADDRL
IAP Flash Address Low Byte
C4H
0000,0000
IAP_CMD
IAP Flash Command Register
C5H
-
-
-
-
-
-
CMD[1:0]
xxxx,xx00
IAP_TRIG
IAP Flash Trigger register
C6H
0000,0000
IAP_CONTR
IAP Control Register
C7H
IAPEN
SWBS
SWRST
CMD_FAIL
-
-
-
-
0000,xxxx
IAP_TPS
IAP Waiting Time Control
Register
F5H
-
-
IAPTPS[5:0]
xx00,0000
16.2.1 EEPROM data register (IAP_DATA)
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
IAP_DATA
C2H

Table of Contents

Related product manuals