Chapter 2 CPU Basics
2-9
Register Protection
2-9-1
Overview
This LSI features a function to protect important register data. When this function is enabled, data is
rewritten only when write is done for several times to a register and other write is disabled. Registers with
this function are as follows.
CPU mode control register (CPUM: x'03F00')
Memory control register (MEMCTR: x'03F01')
2-9-2
Setting of the Register Protection Function
Set the L0CKEN flag of the key control register (KEYCNT) to "1" to enable the register protection func-
tion.
7
6
KEYCNT
-
2-9-3
Rewrite Procedure
Write 03 to the CPUM register:
LOOP
Interrupts may change the procedure of the program and disable sequence writes. Make
sure that write is done properly or disable interrupts during write.
Write to a register is executed even when several writes, which include access to RAM
area (x'00000' to x'02FFF) are done.
II - 42
Register Protection
5
4
3
-
-
-
-
Figure 2-9-1
Key Control Register (KEYCNT: x'03F2B', R/W)
MOV
x'**', (CPUM)
MOV
x'03', (CPUM)
CBNE x'03', (CPUM),
2
1
0
-
-
LOCKEN
LOCKEN
LOOP
(At reset: - - - - - - - 0)
Register protect function selection
0
Disable
1
Enable
** indicates Don't care