9 register protection, 9-1 overview, 9-2 setting of the register protection function – Panasonic MN101C77C User Manual

Page 94: 9-3 rewrite procedure

Advertising
background image

Chapter 2 CPU Basics

II - 42

Register Protection

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.

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

x

Interrupts may change the procedure of the program and disable sequence writes. Make

sure that write is done properly or disable interrupts during write.

x

Write to a register is executed even when several writes, which include access to RAM

area (x'00000' to x'02FFF) are done.

LOCKEN

0

Enable

Register protect function selection

Disable

0

1

2

4

5

6

7

3

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

KEYCNT

LOCKEN

-

-

-

-

-

-

-

1

Advertising
This manual is related to the following products: