![](http://datasheet.mmic.net.cn/110000/M30201F6-SP_datasheet_3496102/M30201F6-SP_184.png)
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Protect
172
2.1.2 Protect Operation
The following explains the protect operation. Figure 2.1.2 shows the set-up procedure.
(1) Setting “1” in the write-enable bit of system clock control registers 0 and 1 causes system
clock control register 0 and system clock control register 1 to be in write-enabled state.
(2) The contents of system clock control register 0 and that of system clock control register 1 are changed.
(3) Setting “0” in the write-enable bit of system control registers 0 and 1 causes system clock
control register 0 and system control register 1 to be in write-inhibited state.
(4) To change the contents of processor mode register 0 and that of processor mode register 1,
follow the same steps as in dealing with system clock control registers.
(5) The write-enable bit of port P4 direction register goes to “0” when the next write instruction is
executed after write-enabled state is readied. Make changes in input/output immediately af-
ter the instruction that sets “1” in the write-enable bit of port P4 direction register (avoid
causing an interrupt).
Operation
2.1.1 Overview
'Protect' is a function that causes a value held in a register to be unchanged even when a program runs
away. The following is an overview of the protect function:
(1) Registers affected by the protect function
The registers affected by the protect function are:
(a) System clock control registers 0, 1 (addresses 000616 and 000716)
(b) Processor mode registers 0, 1 (addresses 000416 and 000516)
(c) Port P4 direction register (address 03EA16)
The values in registers (1) through (3) cannot be changed in write-protect state. To change values in
the registers, put the individual registers in write-enabled state.
(2) Protect register
Figure 2.1.1 shows protect register.
2.1 Protect
Figure 2.1.1. Protect register
Protect register
Symbol
Address
When reset
PRCR
000A16
XXXXX0002
Bit name
Bit symbol
b7
b6
b5
b4
b3
b2
b1
b0
0 : Write-inhibited
1 : Write-enabled
PRC1
PRC0
PRC2
Enables writing to processor mode
registers 0 and 1 (addresses 000416
and 000516)
Function
0 : Write-inhibited
1 : Write-enabled
Enables writing to system clock
control registers 0 and 1 (addresses
000616 and 000716
)
Enables writing to port P4 direction
register (address 03EA16) (Note
)
0 : Write-inhibited
1 : Write-enabled
W
R
Nothing is assigned.
In an attempt to write to these bits, write “0”. The value, if read, turns out to be
indeterminate.
Note: Writing a value to an address after “1” is written to this bit returns the bit