0

What is the big difference between the 8255 PPI and the 8042 PPI? (except that the 8255 has more IO)

Things that I spotted:

  • the 8042 seems to have its own clock (not using the CPU one) which seems to be ~12-12.5mhz
  • the 8042 is also named a "8-BIT SLAVE MICROCONTROLLER", so what does that mean
  • the 8042 seems to be far more complicated (talking about EPROM and programming in the datasheet)

The only thing I found is that the 8042 seems to be used in the IBM PC/AT as a keyboard controller.

So can it do the same as a 8255 (read and write to IO), is it somehow "Programmed" and not driven by the CPU and if it is, how would you do that?

4
  • 3
    You must mean 8255, if you are talking about differences in PC and AT keyboard interfaces?
    – Justme
    Commented Feb 7, 2023 at 19:30
  • you're right... I just used the chip i had in my head and didn't realize i was talking about the wrong chip, sorry
    – juffma
    Commented Feb 7, 2023 at 20:42
  • 5
    If the question is supposed to be about the 8255, please edit it to remove the incorrect mentions of 8288.
    – dave
    Commented Feb 8, 2023 at 0:23
  • 1
    Uh, please edit it to remove all the incorrect mentions of 8288?
    – dave
    Commented Feb 8, 2023 at 22:24

2 Answers 2

10

The 8042 is no PIO chip at all, but essentially a (very small) full-blown computer on a chip - a microcontroller. It contains a small amount of RAM (256 Bytes), ROM (4K, One-time-programmable or preconfigured), a timer/counter, and a series of 18 GPIO pins. You could buy the 8042 pre-programmed as a keyboard controller for the IBM PC or AT (using firmware from companies like Phoenix or Award, which was probably its most-known application), or an empty one and push your own software to it (and run it completely stand-alone in a completely different application nothing to do with keyboards). A special feature of the 8042 is a built-in bus interface to allow it to easily integrate with Intel master CPUs like the 8086 - but it doesn't necessarily nead to run along one of them.

The 8255 however, is a completely different thing - It's a peripheral chip to the 80xx line of CPUs that provides 3 byte-wide digital I/O ports. It shares the capability to provide programmable parallel ports with the 8042 (and has 6 more bits to them), but has no CPU capabilities of its own - it needs a CPU in the system to operate. In the home computer architectures, most early parallel port cards used a 8255 to drive the printer port (later, dedicated multi-I/O chips were used that could provide other peripheral functionality).

4
  • I'm sorry... I mislead you, i meant the 8255
    – juffma
    Commented Feb 7, 2023 at 20:40
  • @juffma fixed it
    – tofro
    Commented Feb 7, 2023 at 21:27
  • 1
    @tofro But early IBM PC parallel printer ports did not use the 8255. They never did.
    – Justme
    Commented Feb 7, 2023 at 22:22
  • 1
    @Justme yes, you’re right - but everyone else did ;)
    – tofro
    Commented Feb 8, 2023 at 12:18
4

The 8255 is a PPI, the 8042 isn't, and neither is the 8288 a PPI but it is a Bus Controller which decodes the native 8088 CPU control bus signals into separate usable bus control signals to have signals for reading and writing memory and IO ports, used by all the peripherals, chips and the ISA bus slots.

The 8255 is just a parallel interface chip that sits on the 8088 CPU bus and has parallel IO ports. It contains some extra features but these are not used on a PC and XT. The CPU can just read the input ports and write the output ports, to achieve various things, and it is used for a lot of various things on a PC and XT.

Port A of 8255 is used for reading keyboard scan code, but it is received from keyboard by separate logic block, a shift register, and the readout happens in parallel.

Port B of 8255 is used for output to control various stuff, most common people know is controlling the PC speaker.

Port C is used as status input, such as for reading motherboard DIP switches.

The 8255 PPI lives in 8088 IO addresses 60h to 63h.

The 8042 is also "just" chip that sits on the 80286 CPU bus on a PC AT. It also has inputs and outputs, but it is a microcontroller, a CPU that executes software code stored inside it. The main function is that it sort of partly replaces the 8255 PPI and external logic which receives keyboard data, which is why it is commonly dubbed as the 8042 keyboard controller The implementation is such that it emulates the 8255 PPI enough that software using the PC and XT hardware directly for keyboard input will also work on an AT with the 8042.

In reality the 8042 implements a bi-directional keyboard interface with the bi-directional AT keyboard. The AT keyboard accepts commands from PC to control the Caps/Scroll/Num Lock lights and also to set typematic rate and delay.

What's not immediately visible to the user is that the XT and AT keyboard protocols are incompatible and they even communicate using different scan code sets, so the 8042 also converts the AT scancodes to match the XT scancodes for compatibility, so all software that expects the original XT scan codes will work. The 8042 can be set to turn off the scancode translation.

Because the 8042 keyboard controller only lives in 80286 CPU addresses 60h and 64h, the other functionality of ports 61h to 63h are replicated in system chipset.

1
  • That explanation helped, but i realized i was using the wrong chip, i meant the 8255 as you wrote correctly. Howerver now i Understand the Difference i think, so the 8255 is just a simple "translator" between IO lines while the 8042 actually can perform it's own logic on the IO devices
    – juffma
    Commented Feb 7, 2023 at 20:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .