U1 is the serial line driver/receiver, which converts RS232 standard serial signals to/from standard 5V TTL levels. This IC contains voltage convertors to produce the required transmission voltages (+/- 9V) from a single +5V supply.

In this application the 8 bit received data is used as 4 data bits on R0-R3 and 4 control bits on R4-R7. 3 of these control lines (R4-R6) are taken to a "3 To 8 Line Decoder", U5. The STROBE signal is taken to one of the Enable lines on U5, thereby causing the outputs from this IC to be short pulses. For example, if 00h is received, lines R4-R6 will be low, STROBE will pulse high and consequently pin 15 of U5 will pulse high and the remaining outputs will stay low.

The remaining control bit (R7) controls the power to the EPROM, when it is high all power is removed from the EPROM socket so the device can be inserted or removed. When the device is being read or programmed this line is taken low.

The 4 data lines are taken to the inputs of 4 "Quad D-Type Latches", U6-U9. The Latch Enable lines on these IC's are connected to 4 of the outputs of U5 (Y0-Y3). Data can therefore be stored in these latches by sending the required data on lines R0-R3 and the latch number (0-3) on lines R4-R6. The data will be continuously available on the latch output lines. Referring back to the previous example, if 00h is received, lines R0-R3 will all be low, and line Y0 will pulse high, storing 0h (0000b) in U6. Similarly sending 35h will store 5h (0101b) in U9

Latch U6 is used to hold the least significant nibble (4 bits - half a byte) of the data which will ultimately be programmed into the EPROM, whilst U7 holds the most significant nibble. U8 holds the EPROM type information (see later), and U9 holds 4 setup bits. Bit 1 of U9 controls whether the unit is in Read or Write (Program) mode, bit 2 sets the programming pulse length to either 1 or 40 milliseconds, bit 3 sets the programming voltage to either 12 or 21 volts, and bit 4 sets the supply voltage whilst programming to either 5 or 6 volts. Note that the latches have active-high and active-low outputs, and one or both may be used.

The data outputs from U6 and U7 are taken to a tri-state buffer (U10), which in turn drives the EPROM data lines. U10 is controlled by the R/W- line, such that it's outputs are enabled in Program mode and tri-state in Read mode.

The EPROM data lines are also connected to the data input lines on the UART (U3), and the Y7 output from U5 is connected to pin 23 of U3 (SEND). Therefore if 70h is received, the data currently on the EPROM Data Lines is transmitted back along the serial interface to the computer.

The EPROM Address lines are controlled by counters U11 and U12. These are connected to lines Y4 and Y5 from U5, and are therefore cleared to 0000h by sending 40h and the count is incremented by sending 50h. This approach is quicker than having to send the actual address each time since it only requires one byte to be sent along the serial link.

Line Y6 from U5 (PROG) is used to start a programming pulse. The programming pulse (either 1mS or 40mS) is produced by dividing down the CLOCK2 signal. This signal has a frequency of 19.2KHz (2.4576MHz divided by 128), which equates to a period of 52.1uS. This is fed to counter U13, which is normally held reset by the Set/Reset flip-flop built from U15:C and U15:D. When the PROG line pulses high the flip-flop changes state and the counter starts counting the CLOCK2 pulses. If a 1mS pulse is required, pin 5 of U14:A will be high and pins 12 and 13 of U14:B will be low. When the count reaches 19 (52.1uS x 19 = 989.9uS), all the inputs of U14:A will be high, it's output will therefore go low, changing the state of the flip-flop again, via U16:B, and resetting the counter. A 0.99mS pulse will therefore be present on the output of the flip-flop, 0.99mS being well within the 1mS +/- 5% specification. If a 40mS pulse is required U13 counts 768 CLOCK2 pulses (52.1uS x 768 = 40.01mS).

The PROG PULSE and STROBE signals are coupled via U18:A and U1 to the RS232 CTS (Clear To Send) line. This prevents the host computer from sending further data whilst a program pulse is occurring or while STROBE is still high. This means that data can be sent as fast as possible and no delays are needed in the software.

PROG PULSE- is coupled with the SEND signal to U3 by U16:A. This prevents the SEND signal getting through whilst PROG PULSE- is low. This situation will never occur in normal use, however during initialisation the software requests a 40mS program pulse immediately followed by a SEND. If the RS232 CTS line is present and working then data will be sent, since the CTS line will stop the computer sending the SEND request until after the prog pulse has finished. If CTS is not working the SEND request will be sent immediately but no data will be returned due to U16:A stopping the SEND pulse reaching U3. The software notes the lack of received data, prints a warning and then adds delays itself to allow for the program pulse. You should try to get CTS working properly as there will be a significant speed penalty otherwise.

Paging Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next



Back to Top