EasyManua.ls Logo

Cmsemicon SC8F577 Series - Page 93

Default Icon
181 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...
V1.8
SC8F577x
93 / 181
www.mcu.com.cn
12.3 Read Program EEPROM
To read the program EEPROM cell, the user must write the address to the EEADR register, clear the
EEPGD control bit of the EECON1 register, and then set the control bit RD to 1. Once the read control bit is
set, the program EEPROM controller will use the second instruction period to read data. This will cause the
second instruction following the SETB EECON1, RD instruction to be ignored (1). In the next clock period,
the corresponding address value of the program EEPROM will be latched into the EEDAT register in the user
can read these two registers in subsequent instructions. EEDAT will save this value until the next time the
user reads or writes data to the unit.
Note: The two instructions after the program memory read operation must be NOP. This prevents the
user from executing dual period instructions on the next instruction after the RD position is 1.
exampleread program EEPROM
EEPDATA_READ:
LD
A, RADDR
; Put the address to be read into the EEADR register
LD
EEADR, A
CLRB
EECON1, EEPGD
;access data memory
SETB
EECON1, RD
;start reading
NOP
NOP
LD
A, EEDAT
;read and load data to ACC
LD
RDATA, A
EEPDATA_READ_BACK:
RET

Related product manuals