
R01UH0218EJ0110 Rev.1.10
Page 138 of 664
Sep 12, 2011
R32C/142 Group and R32C/145 Group
9. Protection
9.
Protection
This function protects important registers from being easily overwritten when a program goes out of control.
Registers used to protect other registers from being rewritten are as follows: PRCR, PRCR2 to PRCR4, and
PRR.
9.1
Protect Register (PRCR Register)
Figure 9.1 shows the PRCR register. Registers protected by bits in the PRCR register are listed in
Table The PRC2 bit becomes 0 (write disabled) when a write operation is performed in a given address after
this bit is set to 1 (write enabled). Set the PRC2 bit to 1 just before rewriting registers PD9, P9_iS (i = 3 to
7), PLC0, and PLC1. No interrupt handling or DMA transfers should be inserted between these two
instructions. Bits PRC0 and PRC1 do not become 0 even if data is written to a given address. These bits
should be set to 0 by a program.
Figure 9.1
PRCR Register
Table 9.1
Registers Protected by the PRCR Register
Bit
Protected Registers
PRC0
CM0, CM1, CM2, and PM3
PRC1
PM0, PM2, INVC0, INVC1, and IOBC
PRC2
PLC0, PLC1, PD9, and P9_iS (i = 3 to 7)
b7 b6 b5 b4
b1
b2
b3
Symbol
PRCR
Address
4004Ah
Reset Value
XXXX X000b
b0
Function
Bit Symbol
Bit Name
RW
Protect Register
Note:
1. The PRC2 bit becomes 0 if a write operation is performed in a given address after this bit is set to 1. Bits
PRC0 and PRC1 do not automatically become 0. They should be set to 0 by a program.
RW
Enable writing to registers CM0,
CM1, CM2, and PM3
0: Write disabled
1: Write enabled
Protect Bit 0
RW
Enable writing to registers PM0,
PM2, INVC0, INVC1, and IOBC
0: Write disabled
1: Write enabled
Protect Bit 1
RW
Enable writing to registers PLC0,
PLC1, PD9, and P9_iS (i = 3 to 7)
0: Write disabled
1: Write enabled
Protect Bit 2 (1)
PRC0
PRC1
PRC2
—
(b7-b3)
—
No register bits; should be written with 0 and read as undefined
value