Chapter 3 2 Kbyte EEPROM Module (EETS2KV1)
MC9S12HZ256 Data Sheet, Rev. 2.04
112
Freescale Semiconductor
3.4.1.3
Valid EEPROM Commands
Table 3-10 summarizes the valid EEPROM commands. Also shown are the effects of the commands on
the EEPROM array.
CAUTION
An EEPROM word must be in an erased state before being programmed.
Cumulative programming of bits within a word is not allowed.
The sector modify command (0x60) is a two-step command which first erases a sector (2 words) of the
EEPROM array and then re-programs one of the words in that sector. The EEPROM sector which is erased
by the sector modify command is the sector containing the address of the aligned array write which starts
the valid command sequence. That same address is re-programmed with the data which is written. By
launching a sector modify command and then pipelining a program command it is possible to completely
replace the contents of an EEPROM sector.
3.4.1.4
Illegal EEPROM Operations
The ACCERR flag will be set during the command write sequence if any of the following illegal
operations are performed causing the command write sequence to immediately abort:
1. Writing to the EEPROM address space before initializing ECLKDIV.
2. Writing a misaligned word or a byte to the valid EEPROM address space.
3. Writing to the EEPROM address space while CBEIF is not set.
4. Writing a second word to the EEPROM address space before executing a program or erase
command on the previously written word.
5. Writing to any EEPROM register other than ECMD after writing a word to the EEPROM address
space.
6. Writing a second command to the ECMD register before executing the previously written
command.
7. Writing an invalid command to the ECMD register in normal mode.
8. Writing to any EEPROM register other than ESTAT (to clear CBEIF) after writing to the command
register (ECMD).
Table 3-10. Valid EEPROM Commands
ECMD
Meaning
Function on EEPROM Array
0x05
Erase Verify
Verify all memory bytes of the EEPROM array are erased. If the array is erased, the BLANK bit
will set in the ESTAT register upon command completion.
0x20
Program
Program a word (two bytes).
0x40
Sector Erase
Erase two words (four bytes) of EEPROM array.
0x41
Mass Erase
Erase all of the EEPROM array. A mass erase of the full array is only possible when EPDIS and
EPOPEN are set.
0x60
Sector Modify
Erase two words of EEPROM, re-program one word.