Panasonic MN101C77C Setting of the Register Protection Function, Rewrite Procedure, Loop MOV

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 94
Image 94

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.

KEYCNT

7

6

5

4

3

2

1

0

-

-

-

-

-

-

-

LOCKEN

 

 

 

 

 

 

 

 

(At reset: - - - - - - - 0)

 

 

 

 

LOCKEN

Register protect function selection

 

 

 

 

 

0

Disable

 

 

 

 

1

Enable

Figure 2-9-1 Key Control Register (KEYCNT: x'03F2B', R/W)

2-9-3 Rewrite Procedure

Write 03 to the CPUM register:

LOOP

MOV

x'**', (CPUM)

 

MOV

x'03', (CPUM)

 

CBNE

x'03', (CPUM), LOOP

** indicates Don't care

xInterrupts may change the procedure of the program and disable sequence writes. Make sure that write is done properly or disable interrupts during write.

xWrite 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

Page 94
Image 94
Panasonic MN101C77C, F77G user manual Setting of the Register Protection Function, Rewrite Procedure, Loop MOV, Cbne