English
Language : 

MC68HC05V12 Datasheet, PDF (124/246 Pages) Freescale Semiconductor, Inc – HCMOS Microcontreller Unit
EEPROM
Freescale Semiconductor, Inc.
12.4 EEPROM Programming/Erasing Procedure
To program a byte of EEPROM:
1. Set EELAT = CPEN = 1.
2. Set ER1 = ER0 = 0.
3. Write data to the desired address.
4. Set EEPGM for a time, tEEPGM.
In general, all bits should be erased before being programmed.
However, if write/erase cycling is a concern, a procedure can be
followed to minimize the cycling of each bit in each EEPROM byte. The
erased state is 1; therefore, if any bits within the byte need to be changed
from a 0 to a 1, the byte must be erased before programming. The
decision whether to erase a byte before programming is summarized in
Table 12-2.
Table 12-2. EEPROM Write/Erase Cycle Reduction
EEPROM Data
To Be Programed
0
0
1
1
EEPROM Data
Before Programming
0
1
0
1
Erase Before
Programming
?
No
No
Yes
No
To erase a byte of EEPROM:
1. Set EELAT = 1, CPEN = 1, ER1 = 0, and ER0 = 1.
2. Write to the address to be erased.
3. Set EEPGM for a time, tEBYT.
To erase a block of EEPROM:
1. Set EELAT = 1, CPEN = 1, ER1 = 1, and ER0 = 0.
2. Write to any address in the block.
3. Set EEPGM for a time, tEBLOCK.
Technical Data
EEPROM
For More Information On This Product,
Go to: www.freescale.com
MC68HC05V12 — Rev. 2.0