Chapter 7. Protection - Renesas M16C Series Hardware Manual

16-bit microcopmuter
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

R8C/11 Group
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, HR0, HR1 registers
• Registers protected by PRC1 bit: PM0 and PM1 registers
• Registers protected by PRC2 bit: PD0 register
• Registers protected by PRC3 bit: VCR2 and D4INT registers
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, PRC1 and PRC3 bits are not automatically set to "0"
by writing to any address. They can only be set to "0" in a program.
P r o t e c t r e g i s t e r
b 7
b 6
b 5
b 4
b3
b 2
0
0
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 .
Figure 7.1 PRCR Register
Rev.1.20
Jan 27, 2006
REJ09B0062-0120
b 1
b 0
S y m b o l
P R C R
B i t s y m b o l
P R C 0
Protect bit 0
P R C 1
Protect bit 1
P R C 2
P r o t e c t b i t 2
P R C 3
P r o t e c t b i t 3
R e s e r v e d b i t
( b 5 - b 4 )
R e s e r v e d b i t
(b7-b6)
page 44 of 204
A d d r e s s
A f t e r r e s e t
0 0 0 A
0 0 X X X 0 0 0
1 6
2
Bit name
Enable write to CM0, CM1, OCD,
HR0, HR1 registers
0 : Write protected
1 : Write enabled
Enable write to PM0, PM1
registers
0 : Write protected
1 : Write enabled
E n a b l e w r i t e t o P D 0 r e g i s t e r
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
E n a b l e w r i t e t o V C R 2 , D 4 I N T
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
When write, should set to "0"
When read, its content is "0".
7. Protection
Function
R W
R W
R W
R W
1
R W
R W
RO

Advertisement

Table of Contents
loading

This manual is also suitable for:

R8c/11 seriesR8c/tiny series

Table of Contents