Mitsubishi microcomputers
M16C / 6N0 / 6N1 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
52
Protection
The protection function is provided so that the values in important registers cannot be changed in the event
that the program runs out of control. Figure 1.10.11 shows the protect register. The values in the processor
mode register 0 (address 000416), processor mode register 1 (address 000516), system clock control reg-
ister 0 (address 000616), system clock control register 1 (address 000716), peripheral function clock select
register (address 025E16), CAN0/1 clock select register (address 025F16), S I/O3 control register (address
01E216), oscillation stop detection register (address 000C16) port P7 direction register (address 03EF16)
and port P9 direction register (address 03F316) can only be changed when the respective bit in the protect
register is set to "1". Therefore, important outputs can be allocated to port P7 or port P9.
If, after "1" (write-enabled) has been written to the port P7 or port P9 direction registers write-enable bit (bit
2 at address 000A16), a value is written to any address, the bit automatically reverts to "0" (write-inhibited).
However, the system clock control registers 0 and 1 write-enable bit (bit 0 at address 000A16) and proces-
sor mode register 0 and 1 write-enable bit (bit 1 at address 000A16) do not automatically return to "0" after
a value has been written to an address. The program must therefore be written to return these bits to "0".
Figure 1.10.11. Protect register
Protection
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
Clock register protection bit
Processor mode register
P7/P9 direction register and
S I/O3 control register
protection bit
PRC2
Enables writing to processor mode
registers 0 and 1 (addresses 000416
and 000516)
Function
0 : Write-inhibited
1 : Write-enabled
Enables writing to the system clock
control registers 0 and 1 (addresses
000616 and 000716), oscillation stop
detection register (address 000C16),
peripheral function clock select regis-
ter (address 025E16), and CAN0/1
clock select register (address 025F16)
(Note 1)
0 : Write-inhibited
1 : Write-enabled
W
R
Nothing is assigned.
These bits can neither be set nor reset. When read, their contents are
indeterminate.
Note 1: There is only one CAN channel available for M16C/6N1 group.
Note 2: Writing a value to an address after "1" is written to this bit returns the bit
to "0" . Other bits do not automatically return to "0" and they must therefore
be reset by the program.
Enables writing to port P7/9 direction
register (addresses 03F316 and
03EF16) and S I/O3 control register
(address 01E216) (Note 2)