Design IdeasMarch 3, 1997 |
Jerzy R Chrzaszcz, Warsaw University of Technology, Warsaw, Poland
The PLD in Figure 1 and the corresponding Listing 1 help you change the direction of external buffers connected to an 8255 parallel peripheral interface. The 8255 integrates three programmable 8-bit ports with handshake and interrupt logic. In some applications, drive capabilities of the ports are insufficient, and you must add external buffers. If the data direction is fixed, you can use unidirectional buffers or just strap the control pins of bidirectional buffers. Even changing the direction of data flow on the fly is no problem, as long as you can afford spare 8255 pins to control the buffers using software. However, if your application needs every pin of the 8255's ports, then the circuit in Figure 1 is useful.
This circuit is a registered transcoder. The I/O-write (IOW) strobe drives the clock input. Whenever you write to the control register with a mode word, the logic transcodes the mode definition and latches the results in the output register. For all other I/O writes, the register contents remain unchanged. The PLD encodes the outputs to provide direct control for 245-type buffers. A logic 1 means sending from port; a logic 0 means a receive from outside.
Ports A and B of the 8255 operate bytewise, and, for modes 0 and 1, bits D4 and D1 of the control word explicitly define their direction. In mode 2, line PC6, acting as a data-read strobe, controls the direction of port A (Listing 1). Control for port C is more complicated. In mode 0, you can set groups PC7 through PC4 and PC3 through PC0 as inputs or outputs. In modes 1 and 2, particular lines have predefined functions. Thus, separate direction control is generally necessary for every line of port C. Only PC0 and PC1 are always both inputs or both outputs, and, therefore, the proposed PLD provides common control for these lines.
Because of pin-count limitations, you must externally decode the hit condition, which signals access to the control register (CS, A1, and A0). However, if your application uses no mode combinations, you can easily change PLD definitions and add A1 and A0 inputs at the expense of merging control for some PC bits. (DI #1997)
| Figure 1 |
| This PLD and the corresponding listing enable a system to change the direction of an 8255's external buffers. |
Listing 1--Autopilot for 8255 external buffers |
| EDN Access | Feedback | Subscribe to EDN | Table of Contents |