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

8XC196Kx, Jx, CA USER’S MANUAL

If the security key verification is successful, the routine loads the programming pulse width (PPW) value from the external EPROM into the internal PPW register. It then asserts PACT#, indicating that programming has begun. (PACT# is also active during reset, although no programming is in progress.) PVER is initially asserted and remains asserted unless an error is detected, in which case it is deasserted.

The routine then reads the contents of the external EPROM, beginning at 4000H. It skips any word that contains FFFFH (unprogrammed state). When it reads a word that contains any value other than FFFFH, the routine calls the modified quick-pulse algorithm, which writes that value to the OTPROM, using the appropriate number of pulses for the device, then verifies the result. The routine repeats this activity until the entire OTPROM is programmed, then deasserts PACT# and enters an endless loop. It takes approximately 40 seconds to program 16 Kbytes of OTPROM.

16.9.4 Auto Programming Procedure

If a glitch or reset occurs while programming the security key and lock bits, an unknown security key might accidentally be written, rendering the device inaccessible for further programming. To minimize this possibility, follow this recommended programming procedure.

NOTE

All addresses are given for the circuit shown in Figure 16-12 on page 16-27. If you choose a different circuit, you must adjust the addresses accordingly.

1.Using a blank EPROM device, follow these steps to skip programming of CCB0 and program the rest of the OTPROM array, including the security key.

— Place the programming pulse width (PPW) in external EPROM locations 14H–15H.

— Leave the external CCB0 location (40 18H) unprogrammed (0FFFFH).

— Place the appropriate CCB1 va lue at external location 401AH.

— Place the security key to be programmed in external EPROM locat ions 4020H–402FH.

Place the value 20H in external EPROM locations 4019H and 401BH (for the reserved OTPROM locations that require this value).

Place the desired code in the remaining external EPROM locations 4 000H and above (see Table 16-11 on page 16-28).

Execute the power-up sequence (page 16-15) to initiate auto programming.

When programming is complete, execute the powerdown sequence (page 16-15) before continuing to step 2.

16-30

PROGRAMMING THE NONVOLATILE MEMORY

2.Using another blank EPROM device, follow these steps to program only CCB0.

— Place the programming pulse width (PPW) in external locati ons 14H–15H.

— Place the appropriate CCB0 va lue in external location 4018H.

Place the security key to be verified in external EPROM locations 0020H–002FH. This value must match the security key programmed in step 1.

Leave the remaining EPROM locations unprogrammed (0FFFFH).

Execute the power-up sequence (page 16-15) to initiate auto programming.

— When programming is complete, follow the powerdown sequence (page 16-15).

At this point, you can modify the circuit, then use ROM-dump mode to write the entire OTPROM array to an external memory device and verify its contents. (See “ROM-dump Mode” for details.)

16.9.5 ROM-dump Mode

The ROM-dump mode provides an easy way to verify the contents of the OTPROM array after auto programming. Use the same circuit as for auto programming, but change the connections of the PMODE (P0.7:4) pins. To select ROM-dump mode (PMODE=6H), connect P0.6 and P0.5 to VCC and connect P0.7 and P0.4 to ground. The same bank switching mechanism is used and the memory map is the same as that for auto programming. The example circuit (Figure 16-12 on page 16-27) does not show the necessary WR# and VPP connections to allow writing to the EPROM. And although the example uses an EPROM, you could also use a RAM device. Alternatively, you could dump the OTPROM contents to any 16-bit parallel port.

For the 8XC196JV, which has 48 Kbytes of OTPROM, use a word-wide memory device or a 16bit parallel port for the ROM dump. The internal algorithm dumps the first 24 Kbytes of OTPROM (2000–7FFFH) to the 12 Kwords at 2000–4FFFH and the remaining 24 Kbytes (8000– DFFFH) to the 12 Kwords at external locations 5000–7FFFH.

NOTE

If you have programmed the DED bit (USFR.2), ROM-dump mode is disabled. (See “Controlling Fetches from External Memory” on page 16-6).

To enter ROM-dump mode, follow the power-up sequence on page 16-15. The ROM-dump mode checks the security key regardless of the CCR security-lock bits. If you have programmed a security key, a matching key must reside in the external memory; otherwise, the device enters an endless loop. If the security key verifies, ROM-dump mode fetches the PPW, then writes the entire OTPROM array to external memory. PACT# remains low while the dump is in progress, then goes high to indicate that the dump is complete.

16-31

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