Protection - Renesas M16C/26A Series Hardware Manual

16-bit single-chip microcomputer m16c family / m16c/tiny series
Hide thumbs Also See for M16C/26A Series:
Table of Contents

Advertisement

M
1
6
C
2 /
6
A
G
o r
u
p
(
M
1

8. Protection

Note
The PRC3 bit in the PRCR register is not available in M16C/26T.
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 8.1 shows the PRCR register. The following lists the registers protected by
the PRCR register.
• Registers protected by PRC0 bit: CM0, CM1, CM2, PLC0, ROCR and PCLKR registers
• Registers protected by PRC1 bit: PM0, PM1, PM2, TB2SC, INVC0 and INVC1 registers
• Registers protected by PRC2 bit: PD9, PACR and NDDR registers
• Registers protected by PRC3 bit: VCR2 and D4INT registers
Set the PRC2 bit to "1" (write enabled) and then write to SFR area, and the PRC2 bit will be cleared 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. The PRC0, PRC1 and PRC3 bits are not automati-
cally cleared to "0" by writing to any address. They can only be cleared in a program.
Protect register
b7
b6
b5
b4
b3
0
0
NOTE:
1. The PRC2 bit is set to "0" if data is written to the SFR area after the PRC2 bit is set to "1". The
PRC0, PRC1 and PRC3 bits are not automatically set to "0". Set them to "0" by program.
Figure 8.1. PRCR Register
R
e
. v
2
0 .
0
F
e
b
1 .
, 5
2
0
0
7
R
E
J
0
9
B
0
2
0
2
0 -
2
0
0
6
C
2 /
6
, A
M
1
6
C
2 /
6
, B
M
1
b2
b1
b0
Symbol
PRCR
Bit symbol
PRC0
Protect bit 0
PRC1
Protect bit 1
PRC2
Protect bit 2
PRC3
Protect bit 3
Reserved bit
(b5-b4)
Nothing is assigned. When write, set to "0". When read, its
content is indeterminate.
(b7-b6)
page 60
f o
3
2
9
6
C
2 /
6
) T
Address
After reset
000A
XX000000
16
Bit name
Enable write to CM0, CM1, CM2,
ROCR, PLC0 and PCLKR registers
0 : Write protected
1 : Write enabled
Enable write to PM0, PM1, PM2,
TB2SC, INVC0 and INVC1
registers
0 : Write protected
1 : Write enabled
Enable write to PD9, PACR and
NDDR registers
0 : Write protected
1 : Write enabled
Enable write to VCR2 and D4INT
registers
0 : Write protected
1 : Write enabled
Must set to "0"
2
Function
8. Protection
RW
RW
RW
RW
RW
RW

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/26aM16c/26bM16c/26t

Table of Contents