English
Language : 

MC68HC05P18A Datasheet, PDF (88/130 Pages) Freescale Semiconductor, Inc – HCMOS Microcontroller Unit
EEPROM
Freescale Semiconductor, Inc.
10.4 Programming/Erasing Procedures
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.
Any bit should be erased before it is 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.
Here is the procedure:
• If PB • EB = 0 — Program the new data over the existing data
without erasing it first.
• If PB • EB ≠ 0 — Erase byte before programming.
Where:
PB = Byte data to be programmed
EB = Existing EEPROM byte data
To erase a byte of EEPROM:
1. Set LATCH = 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 LATCH = 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
MC68HC05P18A