![CMOSTEK NextGenRF CMT2189B Скачать руководство пользователя страница 75](http://html1.mh-extra.com/html/cmostek/nextgenrf-cmt2189b/nextgenrf-cmt2189b_user-manual_2627491075.webp)
AN201
Rev 1.5 | 75/91
www.cmostek.com
12 Data EEPROM
The chip is integrated with a 256-byte EEPROM, which is accessed through the EEADR. It supports the software programming
the EEPROM through the EECON1 and EECON2. The erasing and programming function is implemented by the hardware with
no need for software query, which saves the limited code space. Meanwhile, by using this feature, it supports the chip enters the
sleep mode after starting the programming cycle to reduce power consumption.
The following initialization process must be performed before the data EEPROM is used (either read or write), that is, write
double 0xAA to an unused EEPROM unit, and make sure the program will no longer operate this unit after then. The code
example is as follows.
Steps for data EEPROM programming
To read a data memory unit, users must write the address into the EEADR register, and then set the control bit RD of the
EECON1 register to 1. In the next cycle, the EEDAT register is written with the EEPROM data. Therefore, this data can be read
by the next instruction. The EEDAT will keep this value until the user reads or writes the data of the unit the next time (during the
write operation).
SYSTEM_INIT
……
……
LDWI 0x55
STR EEROM_ADDR
LDWI 0xAA
STR EEPROM_DATA
LCALL EEPROM_WRITE
LCALL EEPROM_WRITE