
R8C/10 Group 7. Protection
Rev.1.20 Jan 27, 2006 page 30 of 180
REJ09B0019-0120
7. 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 7.1 shows the PRCR register. The following lists the registers protected
by the PRCR register.
• Registers protected by PRC0 bit: CM0, CM1, and OCD registers
• Registers protected by PRC1 bit: PM0 and PM1 registers
• Registers protected by PRC2 bit: PD0 register
Set the PRC2 bit to “1” (write enabled) and then write to any 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 will occur between the instruction in which the PRC2
bit is set to “1” and the next instruction. The PRC0 and PRC1 bits are not automatically set to “0” by writing
to any address. They can only be set to “0” in a program.
Figure 7.1 PRCR Register
P
r
o
t
e
c
t
r
e
g
i
s
t
e
r
Symbol Address After reset
PRCR 000A
16
00XXX000
2
B
i
t
n
a
m
eB
i
t
s
y
m
b
o
l
b7 b6 b5 b4 b3 b2 b1 b0
0
:
W
r
i
t
e
p
r
o
t
e
c
t
e
d
1
:
W
r
i
t
e
e
n
a
b
l
e
d
PRC1
PRC0
Function
R
N
O
T
E
S
:
1
.
T
h
e
P
R
C
2
b
i
t
i
s
s
e
t
t
o
“
0
”
b
y
w
r
i
t
i
n
g
t
o
a
n
y
a
d
d
r
e
s
s
a
f
t
e
r
s
e
t
t
i
n
g
i
t
t
o
“
1
”
.
O
t
h
e
r
b
i
t
s
a
r
e
n
o
t
s
e
t
t
o
“
0
”
b
y
w
r
i
t
i
n
g
t
o
a
n
y
a
d
d
r
e
s
s
,
a
n
d
m
u
s
t
t
h
e
r
e
f
o
r
e
b
e
s
e
t
t
o
“
0
”
i
n
a
p
r
o
g
r
a
m
.
R
R
Protect bit 0
Protect bit 1
Protect bit 2
E
n
a
b
l
e
w
r
i
t
e
t
o
C
M
0
,
C
M
1
,
O
C
D
r
e
g
i
s
t
e
r
s
0
:
W
r
i
t
e
p
r
o
t
e
c
t
e
d
1
:
W
r
i
t
e
e
n
a
b
l
e
d
Enable write to PM0, PM1
registers
0 : Write protected
1 : Write enabled
1
Enable write to PD0 register
R
When read, its content is “0”.
(
b
7
-
b
6
)
Reserved bit W
h
e
n
w
r
i
t
e
,
m
u
s
t
s
e
t
t
o
"
0
"
(
b
5
-
b
3
)
Reserved bit
RO
PRC2
R
Commenti su questo manuale