![Hitachi H8/3152 Hardware Manual Download Page 90](http://html.mh-extra.com/html/hitachi/h8-3152/h8-3152_hardware-manual_140481090.webp)
87
8.4.3
Erase
When the EEPMOV instruction is executed with OC1 = 1 and OC0 = 0, the relevant EEPROM
page is erased.
The entire page containing the byte addressed by the EEPROM address register (R6) is erased. All
data in the page is changed to 1 when erased. The byte counter (R4L) and RAM address register
(R5) can be set to any valid values.
EEPROM
R6
1 Page
Erased
Page N + 2
Page N + 1
Page N
Page N + 2
Page N + 1
Page N
Figure 8.10 EEPROM Erase Operation
8.4.4
Overwrite
When the EEPMOV instruction is executed with OC1 = 0 and OC0 = 1, the transferred data is
overwritten on the old data.
After an overwrite operation, the EEPROM contains the logical AND of the old data and the
overwritten data.
Overwritten data
1 0 0 1 0 1 1 0
Old data
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
1 1 1 0 0 1 0 0
1 0 0 0 0 1 1 0
Resulting data
1 0 1 0 0 1 0 0
1 0 0 0 1 1 1 1
1 0 1 0 0 1 1 1
Figure 8.11 Results of Overwrite Operations (Examples)