Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
68
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

8XC196Kx, Jx, CA USER’S MANUAL

16.3.1 Controlling Access to Internal Memory

The lock bits in the chip configuration register (CCR0) control access to the OTPROM. The reset sequence loads the CCRs from the CCBs for normal operation and from the PCCBs when entering programming modes. You can program the CCBs using any of the programming methods, but only slave programming mode allows you to program the PCCBs.

NOTE

The developers have made a substantial effort to provide an adequate program protection scheme. However, Intel cannot and does not guarantee that these protection methods will always prevent unauthorized access.

16.3.1.1Controlling Access to the OTPROM During Normal Operation

During normal operation, the lock bits in CCB0 control read and write accesses to the OTPROM. Table 16-3 describes the options. You can program the CCBs using any of the programming methods.

Table 16-3. Memory Protection for Normal Operating Mode

Read Protect

Write Protect

Protection Status

LOC1 (CCR0.7)

LOC0 (CCR0.6)

 

 

 

 

1

1

No protection. Run-time programming is permitted, and the entire

 

 

OTPROM array can be read.

 

 

 

1

0

Write protection only. Run-time programming is disabled, but the

 

 

entire OTPROM array can be read.

 

 

 

0

1

Read protection. Run-time programming is disabled. If program

 

 

execution is external, only the interrupt vectors and CCBs can be

 

 

read. The security key is write protected.

 

 

 

0

0

Read and write protection. Run-time programming is disabled. If

 

 

program execution is external, only the interrupt vectors and CCBs

 

 

can be read.

 

 

 

Clearing CCB0.6 enables write protection. With write protection enabled, a write attempt causes the bus controller to cycle through the write sequence, but it does not enable VPP or write data to the OTPROM. This protects the entire OTPROM array from inadvertent or unauthorized programming.

Clearing CCB0.7 enables read protection and also write protects the security key to protect it from being overwritten. With read protection enabled, the bus controller will not read from protected areas of OTPROM. An attempt to load the slave program counter with an external address causes the device to reset itself. Because the slave program counter can be as much as four bytes ahead of the CPU program counter, the bus controller might prevent code execution from the last four bytes of internal memory. The interrupt vectors and CCBs are not read protected because interrupts can occur even when executing from external memory.

16-4

PROGRAMMING THE NONVOLATILE MEMORY

16.3.1.2Controlling Access to the OTPROM During Programming Modes

For programming modes, three levels of protection are available:

prohibit all programming

prohibit all programming, but permit authorized ROM dumps

prohibit serial port programming, but permit authorized ROM dumps, auto programming, and slave programming

These protection levels are provided by the PCCB0 lock bits, the CCB0 lock bits, and the internal security key (Table 16-4). When entering programming modes, the reset sequence loads the PCCBs into the chip configuration registers. It also loads CCB0 into internal RAM to provide an additional level of security.

You can program the CCBs using any of the programming methods, but only slave programming mode permits access to the PCCBs, and only slave and auto programming allow you to program the internal security key.

Table 16-4. Memory Protection Options for Programming Modes

LOC1

LOC0

Security Key

 

(CCR0.7)

(CCR0.6)

 

Programmed

Protection Status

 

 

 

 

PCCB

CCB

PCCB

CCB

?

 

 

 

 

 

 

 

 

 

1

1

1

1

No

No protection. All programming modes allowed.

 

 

 

 

 

 

1

X

0

X

Yes

All programming disabled. ROM-dump permitted with

 

 

 

 

 

matching security key.

 

 

 

 

 

 

X

X

X

X

Yes

Serial programming disabled.

 

 

 

 

 

 

1

0

1

0

Yes

Serial programming disabled. Auto and slave

 

 

 

 

 

programming permitted with matching security key.

 

 

 

 

 

 

0

X

0

X

X

All programming unconditionally disabled.

 

 

 

 

 

 

If you want to prohibit all programming, clear both PCCB0 lock bits. If these bits are cleared, they prevent the device from entering any programming mode.

If you want to prevent programming, but allow ROM dumps, leave the PCCB0 read-protection bit (PCCB0.7) unprogrammed and clear the PCCB0 write-protection lock bit (PCCB0.6). To protect against unauthorized reads, program an internal security key. The ROM-dump mode compares the internal security key location with an externally supplied security key regardless of the CCB0 lock bits. If the security keys match, the routine continues; otherwise, the device enters an endless internal loop.

16-5

Соседние файлы в предмете Электротехника