MOTOROLA
22
M68HC11 K Series
MC6HC11KTS/D
3.4 EEPROM
The 640-byte EEPROM is initially located at $0D80 after reset, assuming EEPROM is enabled in the
memory map by the EEON bit in the CONFIG register. EEPROM can be placed at any 4-Kbyte bound-
ary ($xD80) by writing appropriate values to the INIT2 register. Note that EEPROM can be mapped so
that it contains the vector space. Refer to
Figure 4
. The MC68HC11K0, MC68HC11K3, MC68L11K0,
and MC68L11K3 have no EEPROM. Refer to the
ordering information tables
.
Programming and erasing the EEPROM is controlled by the PPROG register, and dependent upon the
block protect (BPROT) register value. An on-chip charge pump develops the high voltage required for
programming and erasing. When the frequency of the E clock is less than 1 MHz, select the internal
clock source to drive the EEPROM charge pump by writing one to the CSEL bit in the OPTION register.
The CONFIG register consists of a single EEPROM byte. Although the byte is not included in the 640-
byte EEPROM array, programming the CONFIG register requires the same procedure as any byte in
the array. The erased state of bits in the CONFIG register is logic one. Refer to the CONFIG register
description that follows this section.
The erased state of an EEPROM byte 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.
Set the ERASE, EELAT, and appropriate BYTE and ROW bits in PPROG register.
Write to the appropriate EEPROM address with any data. Row erase only requires a write to
any location in the row. Bulk erase is done by writing to any location in the array.
Set the ERASE, EELAT, EEPGM, and appropriate BYTE and ROW bits in PPROG register.
Delay for 10 ms or more, as appropriate.
Clear the EEPGM bit in PPROG to turn off the programming 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 and use the
PPROG register to complete the following steps:
3.
4.
5.
6.
1.
2.
3.
4.
5.
6.
Set the EELAT bit in PPROG register.
Write data to the desired address.
Set EEPGM bit in PPROG.
Delay for 10 ms or more, as appropriate.
Clear the EEPGM bit in PPROG to turn off the programming 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 common to start the operation and 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.
PPROG
—EEPROM Programming Control
$003B
Bit 7
6
5
4
3
2
1
Bit 0
ODD
EVEN
LVPI
BYTE
ROW
ERASE
EELAT
EEPGM
RESET:
0
0
0
0
0
0
0
0