English
Language : 

MC68HC11KW1 Datasheet, PDF (87/238 Pages) Motorola, Inc – High-density complementary metal oxide semiconductor HCMOS) microcontroller unit
example of how to program an EEPROM byte assumes that the appropriate bits in BPROT have
been cleared.
PROG LDAB #$02 EELAT=1
STAB $003B Set EELAT bit
STAA $0D80 Store data to EEPROM address
LDAB #$03 EELAT=EEPGM=1
STAB $003B Turn on programming voltage
JSR DLY10 Delay tEEPROG
CLR $003B Turn off high voltage and set to READ mode
4
4.6.1.2 EEPROM bulk erase
To erase the EEPROM, ensure that the appropriate bits in the BPROT register are cleared, then
complete the following steps using the PPROG register:
1) Write to PPROG with the ERASE, EELAT and appropriate BYTE and ROW
bits set.
2) 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.
3) Write to PPROG with ERASE, EELAT, EEPGM and the appropriate BYTE
and ROW bits set.
4) Delay for time tEEPROG (See Section A.6).
5) Clear the EEPGM bit in PPROG to turn off the high voltage.
6) Clear the PPROG register to reconfigure the EEPROM address and data
buses for normal operation.
The following is an example of how to bulk erase the 640-byte EEPROM. The CONFIG register is
not affected in this example.
BULKE
LDAB
STAB
STAA
LDAB
STAB
JSR
CLR
#$06
$003B
$0D80
#$07
$003B
DLY10
$003B
EELAT=ERASE=1
Set EELAT bit
Store data to any EEPROM address
EELAT=ERASE=EEPGM=1
Turn on programming voltage
Delay tEEPROG
Turn off high voltage and set to READ mode
4.6.1.3 EEPROM row erase
The following example shows how to perform a fast erase of 16 bytes of EEPROM:
ROWE LDAB #$0E ROW=ERASE=EELAT=1
STAB $003B Set to ROW erase mode
MC68HC11KW1
OPERATING MODES AND ON-CHIP MEMORY
4-43