How do I interface an 8255 to an 8052?
Submitted By: Craig Steiner FAQ Last Modified: 10/12/06
- The functionality of an 8255 port can be easily duplicated. An input port can be provided by a standard 74HC244 type buffer chip. At output port can be easily implemented by using a 74HC374 type latch. If you need a port that can be set back and forth between input and output then consider using a chip like the 74HC646. All of these solutions will be particularly suitable if you are using the 8052 with an expanded external bus mode (just as you would have connected an 8255 chip) and the chips connect to the data bus AD0 to AD7 lines. The control lines for the chips are wired to a decoding circuit that combines an appropriate combination of the address lines, the RD/ and the WR/ control signals.
So, why am I told not to use the 8255?
Submitted By: Jan Waclawek FAQ Last Modified: 10/12/06
- Besides it is quite out of date and the availability is questionable (although pullouts and surplus are still available in various areas, and at least one manufacturer (Intersil) still provides them even in modern small outline packages), the main concern is, that it is too slow for operation with modern, high speed derivatives of '51.
Also, the concept of parallel-interfaced peripherals is not preferred today, as there are microcontrollers with plenty of available pins (thanks to internal program and data memory), and also superior serially interfaced alternatives available for most of the cases. Thus, parallel interfaces - other than the microcontroller's builtin I/O ports - have only limited use today, and as such, should not be promoted (e.g. by educational institutes) to be the interface of choice (unless the application specifically requires it).
So, if you really desire to attach it to '51, you need to study closely the datasheets, mainly the timing requirements of both your '51 derivative and the particular version of 8255 you are intending to use (beware, there are various versions and speed grades of 8255 available); and you might be forced to use alternative methods of interfacing it (such as "hand" driven signalling, as opposed to the standard external-memory-mapped solution).
Some examples of how can the 8255 be attached to a 8051 are on Richard Erlacher's 8052.com homepage. However, unless you plan to use some of the specific features of 8255 (e.g. automatic handshake), it is most likely that some of the alternative solutions would serve you better.
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.