MC68HC11KA4
MC68HC11KA4TS/D
MOTOROLA
23
4 Electrically Erasable Programmable Read-Only Memory
The 640-byte on-chip EEPROM is initially located from $0D80 to $0FFF after reset in all modes. It can
be mapped to any other 4 Kbyte boundary by writing to the INIT2 register. The EEPROM is enabled by
the EEON bit in the CONFIG register. Programming and erasing is controlled by the PPROG register.
An internal oscillator clock-run charge pump supplies the programming voltage. Use of the block protect
register (BPROT) prevents inadvertent writes to (or erases of) blocks of EEPROM. The CSEL bit in the
OPTION register selects the on-chip oscillator clock for programming and erasing while operating at fre-
quencies below 1 MHz. Refer to
5 Resets and Interrupts
.
In special mode there is an extra row of 16 bytes of EEPROM (located at $0D60), which is used for
factory testing. Endurance and data retention specifications do not apply to this row.
The erased state of EEPROM is $FF (all ones).
To erase the EEPROM, ensure that the proper bits of the BPROT register are cleared, then complete
the following steps using the PPROG register:
1.
2.
Write to PPROG with the ERASE, EELAT, and appropriate BYTE and ROW bits set.
Write to the appropriate EEPROM address with any data. Row erase only requires a write to
any location in the row. Bulk erase is accomplished by writing to any location in the array.
Write to PPROG with ERASE, EELAT, EEPGM, and the appropriate BYTE and ROW bits set.
Delay for 10 ms or more, as appropriate.
Clear the EEPGM bit in PPROG to turn off the high voltage.
Clear the PPROG register to reconfigure the EEPROM address and data buses for normal op-
eration.
To program the EEPROM, ensure the proper bits of the BPROT register are cleared, then complete the
following steps using the PPROG register:
3.
4.
5.
6.
1.
2.
3.
4.
5.
6.
Write to PPROG with the EELAT bit set.
Write data to the desired address.
Write to PPROG with the EELAT and EEPGM bits set.
Delay for 10 ms or more, as appropriate.
Clear the EEPGM bit in PPROG to turn off the high voltage.
Clear the PPROG register to reconfigure the EEPROM address and data buses for normal op-
eration.
CAUTION
Since it is possible to perform other operations while the EEPROM programming/
erase operation is in progress, it is fairly common to start the operation then return
to the main program until the 10 ms is completed. When the EELAT bit is set at the
beginning of a program/erase operation, the EEPROM is electronically removed
from the memory map; thus, it is not accessible during the program/erase cycle.
Care must be taken to ensure that EEPROM resources will not be needed by any
routines in the code during the 10 ms program/erase time.