Jennie Abella
Applications Engineer
Intel Corporation
The Auto Programming mode is a low-cost programming alternative. Using this mode, the contents of an external EPROM are copied to the internal OTPROM of the 87C196MC. This article explains how to construct an inexpensive programmer for the 87C196MC. A programmer for the 27128 is still necessary, but these are readily available.
The 87C196MC enters a programming mode when Vpp (typically 12.5V) is applied to EA# during the rising edge of RESET#. The combination of this rising edge of EA# and the value on the PMODE pins causes the 87C196MC to enter a particular programming mode. Then the following sequence is initiated:
2. The internal OTPROM location 2018H (CCR security lock bits) is checked to see if the security key has been programmed. If they are programmed (=0), then the internal security key locations (2020H-202FH) are checked with external locations 4020H-402FH. If security is passed, the program continues. If not, the device enters an endless loop and must be reset to exit it. The LED to indicate that programming has started will not light. (Follow the powerdown procedure and then another attempt can be made to program the device.)
3. The PPW is then loaded from external locations 4014H/4015H, which much set up a 250 ms programming pulse. (The equation for this PPW value is shown in "Calculating the Programming Pulse Width" in this article.)
4. PACT# is activated (P2.5=low) to indicate that programming has started. (LED will light)
5. PVER is initialized (P2.0=high) to indicate that there are no errors to this point. (LED will not be lit)
6. External data is then read, starting at 4000H.
7. If the word is not 0FFFFH, then the Modified QuickPulse subroutine is called (Step 8). If the word is 0FFFFH, then the word is not programmed and the addess is checked to see if programming is completed (Step 10).
8. The PPW timer is started and the data word is written to the OTPROM. The program waits until an interrupt is caused by the PPW timer, which ends the programming pulse. If two writes have not been written, this step is repeated. When two writes have been written to this location, then programming continues with the next word.
9. This location is then read back from the OTPROM and compared to the external location. If it did not program correctly, then PVER is deasserted (P2.0=low) and the LED will light, indicating an error. Programming will continue even if an error is detected. The part cannot be programmed again.
10. The address is checked to see if programming has been completed. If programming is not completed, the address pointer is incremented and the next word is programmed. (This goes back to Step 6 until programming is completed.) If the address is 07FFEH, programming is completed and PACT is deactivated (P2.5=high) and an infinite loop is entered. Continue with the power-down procedure.
Figure 1 is the recommended circuit for auto programming the 87C196MC. Since BUSWIDTH is low, an 8-bit external bus is used. Code to be programmed in the 87C196MC at 2000H must be located in the external EPROM starting at location 4000H. The memory remapping is shown in Table 1. The PPW must be located in the external EPROM at location 4014H and 4015H. (See "Calculating the Programming Pulse Width" in this article.)
Table 1. Auto Programming Memory Map
External EPROM Address | Internal OTPROM Address | Description |
4014H | N/A | PPW Least-Significant Bit |
4015H | N/A | PPW Most-Significant Bit |
4000H-7FFFH | 2000H-5FFFH | Reserved locations for code and data. |
4020H-402FH | 2020H-202FH | Security key, during verification. |
P0.4-P0.7 are hardwired to Vss and Vcc and determine the programming mode. The status outputs PACT# and PVER are buffered by a 74HC14 and drive LEDs to indicate Programming ACTive (PACT#) and Programming VERification (PVER). All unused inputs are connected to ground (Vss) and unused outputs are left floating. READY, NMI, and BUSWIDTH are active and should be connected as indicated.
Auto programming is specified for a crystal frequency of 6 to 10 MHz. A 27(C)128 EPROM with tACC = 250 ns and tOE = 100 ns or faster specifications should be used.
Important: To avoid damaging the 87C196MC during auto programming, follow these rules:
2. Continue holding the device in reset after Vcc has stabilized, and apply +12.5 volts to EA# and Vpp. Refer to the data sheet for exact specifications on this voltage.
Warning: Applying voltage to Vpp when Vcc is low will permanently damage the device. The recommended circuit shows a switch that interlocks the Vpp switch to help prevent damage to the device.
3. Allow time for EA# and Vpp to be within tolerance and for the oscillator to stabilize.
4. After condition 3 is met, RESET# may be allowed to rise.
5. As soon as reset rises, the auto programming sequence begins and the PACT# LED turns on.
6. After completion of the auto programming sequence, the PACT# LED turns off and the power-down sequence should be followed.
2. Remove the +12.5 volts applied to EA# and Vpp and allow these pins to float.
Warning: EA# and Vpp must be allowed to float before removing Vcc or the device will be damaged.
3. Turn off the Vcc supply and allow time for this to reach 0 volts.
4. The device can now be removed from the auto programming circuit.
The programming pulse width needs to be 250 ms for the device to program correctly. Use the following formula to calculate the PPW_VALUE. Round the PPW_VALUE to the next higher integer value and load this value in the PPW location in the external EPROM.
For example, with an oscillator of 6MHz,
= 375
= 177H
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 |
Note
: External EPROM location 4014H is loaded with the LSB and 4015H is loaded with the MSB of PPW_VALUE.
Figure 1. PPW (4014H/4015H) example
* Legal Information © 1999 Intel Corporation