So how does a PS/2 keyboard interface work?

Channel:Ben Eater · Length:33:07 · Published:2021-03-06 · Views:571758

Watch on YouTube

Summary

Ben Eater explains how the PS/2 keyboard interface works, covering its clocked serial protocol and scancodes. He builds up the hardware-level understanding needed to read keypresses.

Why HN recommends it

HN commenters point to it as the clearest explanation of the PS/2 protocol, usually when keyboard interfaces come up.

There's a good video on how PS/2 works here — HN, 2021

Electronics & circuit design · Embedded systems & DIY electronics

Subtitles (excerpt)

keyboards are one of the most familiar computer input devices and for many years this ps2 interface was ubiquitous it also happens to be a relatively simple interface which makes it great for interfacing with a home built computer like the 6502 and if you don't happen to have a home built computer well check out eater.net 6502 for kits and links to all the videos on my channel on how i went about building this but anyhow if we look at this ps2 connector you can see there are six pins in here and actually only four of them are used two of them pins three and four provide power to the keyboard and then the other two pins five and one are clock and data for communication with the keyboard so that the keyboard can send information about keystrokes now to connect to these pins i'm going to use a cable here that has the opposite connector and i can just use this and i'm just going to cut this end off and then strip off the insulation to get to the wires inside and inside here we've got looks like four wires red black orange brown as well as the shield so go ahead and strip these as well they're thin enough i can just use my fingernails and i'll just twist these to kind of clean everything up so there we go

On Hacker News

There's a good video on how PS/2 works here: [VIDEO] It's pretty straight-forward. There are also pre-made kits for digitizing typewriters if that interests you. — zackbloom, 2021-04
I'd imagine it would be very difficult, and would require a relatively powerful MCU. Ben Eater's made a few videos discussing how PS/2[0] and USB keyboards[1] work. USB's a vastly more complicated protocol compared to PS/2. [0] [VIDEO] [1] [LINK] — RJIb8RBYxzAMX9u, 2021-10
think might be at end of this one < [VIDEO] > though there's a few he's done recently on USB spec — bear8642, 2021-09
Piggy-backing this comment to add some context for the OP video: This "USB device discovery" video is actually the latest in a series of videos where Ben Eater is building a simple 8-bit computer on breadboards. He hooked up a PS/2 keyboard as an input device, and then got sucked into a tangent of investigating and explaining keyboard protocols. - He investigates the PS/2 keyboard protocol: [VIDE… — thristian, 2021-07

Related videos