![Hitachi H8/3152 Hardware Manual Download Page 85](http://html.mh-extra.com/html/hitachi/h8-3152/h8-3152_hardware-manual_140481085.webp)
82
8.2
Register Descriptions
8.2.1
EEPROM Control Register (ECR)
ECR is an 8-bit register that controls the type of write or erase operation performed on the
EEPROM.
Bit:
7
6
5
4
3
2
1
0
—
—
—
—
—
—
OC1
OC0
Initial value:
1
1
1
1
1
1
1
1
Read/Write:
R
R
R
R
R
R
R/W
R/W
Bits 7 to 2—Reserved: Always read as 1 and cannot be written to.
Although not used at present, reserved bits may be used in the future. When writing to ECR, write
0 to these bits.
Bits 1 and 0—Operation Control 1 and 0 (OC1 and OC0): These bits select the type of
EEPROM write/erase operation.
Four operations can be selected by OC1 and OC0 as follows.
Bit 1: OC1
Bit 0: OC0
Description
0
0
Rewrite
1
Overwrite
1
0
Page erase
1
Write/erase disabled
(Initial value)
To prevent unintended writing and erasing, the OC1 and OC0 bits are both set to 1 automatically
at a reset, in sleep mode, and at the end of a write or erase operation. It is accordingly necessary to
clear one or both of these bits before every write or erase operation.