
Rev.2.10 Apr 14, 2006 page 80 of 378
REJ09B0124-0210
M16C/6N Group (M16C/6NK, M16C/6NM) 9. Protection
9. Protection
In the event that a program runs out of control, this function protects the important registers so that they will
not be rewritten easily.
Figure 9.1 shows the PRCR Register. The registers protected by the PRCR register are listed below.
• Registers protected by the PRC0 bit: Registers CM0, CM1, CM2, PLC0, PCLKR, and CCLKR
• Registers protected by the PRC1 bit: Registers PM0, PM1, PM2, TB2SC, INVC0, and INVC1
• Registers protected by the PRC2 bit: Registers PD7, PD9, S3C, S4C, S5C, and S6C
(1)
NOTE:
1. Registers S5C and S6C are only in the 128-pin version.
Set the PRC2 bit to 1 (write enabled) and then write to given address, and the PRC2 bit will be set to 0 (write
protected). The registers protected by the PRC2 bit should be changed in the next instruction after setting
the PRC2 bit to 1. Make sure no interrupts or DMA transfers will occur between the instruction in which the
PRC2 bit is set to 1 and the next instruction. Bits PRC0 and PRC1 are not automatically set to 0 by writing
to given address. They can only be set to 0 in a program.
Figure 9.1 PRCR Register
RW
RW
RW
RW
PRC1
PRC0
PRC2
Protect bit 1
Protect bit 0
Protect bit 2
Writing to registers CM0, CM1,
CM2, PLC0, PCLKR, CCLKR
is enabled
0 : Write protected
1 : Write enabled
Writing to registers PM0, PM1,
PM2, TB2SC, INVC0, INVC1
is enabled
0 : Write protected
1 : Write enabled
Writing to registers PD7, PD9,
S3C, S4C, S5C, S6C
is enabled
(2)
0 : Write protected
1 : Write enabled
(1)
Reserved bits Set to 0
RW
-
-
(b5-b3)
-
(b7-b6)
Nothing is assigned. If necessary, set to 0.
When read, the content is undefined.
b7 b6 b5 b4 b3 b2 b1 b0
Protect Register
Symbol Address After Reset
PRCR 000Ah XX000000b
Bit NameBit Symbol Function
NOTES:
1. The PRC2 bit is set to 0 by writing to given address after setting it to 1. Other bits are not set to 0 by writing to
given address, and must therefore be set in a program.
2. Registers S5C and S6C are only in the 128-pin veresion.
0 0
0
Comentários a estes Manuais