Skip to content
0:00 / 0:00

#ps/2#keyboardprotocol#serialprotocol

So how does a PS/2 keyboard interface work?

Ben Eater

1.4M subscribers • 28 videos on Hallway

YouTube
  • Recommended by 2 people: 1 on Hacker News and 1 on Lobsters.
  • Presented by Ben Eater

Intermediate. Assumes working knowledge.

570K views5 years ago2 recommendations

HardwareSystems programmingEmbedded systemsElectronicsRetro computing

Ben Eater explains the clocked serial protocol and scancodes used by PS/2 keyboards to transmit keypresses to a computer.

Check out eater.net for more computer engineering stuff! List of scancodes from the video: docs.google.com/document/d/1w--ouGvSSf93tFltmBcSRGMN8Rte7aya… Support these videos on Patreon: patreon.com/beneater or eater.net/support for other ways to support. ------------------ Social media: Website: eater.net Twitter: x.com/beneater Patreon: patreon.com/beneater Reddit: reddit.com/r/beneater Special thanks to these supporters for making this video possible: Aleksey Smolenchuk, Alexander Wendland, Andrew C. Young, Anson VanDoren, Anthanasius, Armin Brauns, Ben Cochran, Ben Dyson, Ben Kamens, Ben Williams, Bill Cooksey, Binh Tran, Bouke Groenescheij, Bradley Pirtle, Bradley Stach, Brent Reusing, Brian T Hoover, Bryan Brickman, Bryan Glezerson, CaffeinatedClockmaker, Carlos Ambrozak, Christopher Blackmon, Dale Andrew Darling, Daniel Jeppsson, Daniel Tang, Dave Burley, Dave Walter, David Brown, David Clark, David Cox, David House, David Sastre Medina, David Turner, David Worsham, Dean Winger, Dissy, dko, Dmitry Guyvoronsky, dstensnes, Dušan Dželebdžić, Dzevad Trumic, Emilio Mendoza, Eric Busalacchi, Eric Dynowski, Erik Broeders, Eugene Bulkin, George Foot, George Miroshnykov, Harry McDow, Ingo Eble, Ivan Sorokin, james schaefer, Jared Dziedzic, Jason DeStefano, Jason Specland, JavaXP, Jay Binks, Jayne Gabriele, Jeffery Springs, Jeremy A., Jim Kelly, Jim Knowler, Jim Van Meggelen, Joe Beda, Joe OConnor, Joe Pregracke, Joel Jakobsson, Joel Miller, John Fenwick, John Meade, Jon Dugan, Joseph Portaro, Joshua King, Kai Wells, Kefen, Kenneth Christensen, Kent Collins, Koreo, Lambda GPU Workstations, Larry, László Bácsi, Lukasz Pacholik, Marcus Classon, Martin Roth, Mats Fredriksson, Matt Krueger, Matthäus Pawelczyk, melvin2001, Michael Garland, Michael Tedder, Michael Timbrook, Michael Weitman, Miguel Ríos, mikebad, Mikel Lindsaar, Miles Macchiaroli, moi n, Nicholas Counts, Nicholas Moresco, Nick, Örn Arnarson, Paul Pluzhnikov, Paul Randal, Pete Dietl, Phil Dennis, Philip Hofstetter, Phillip Glau, PixelSergey, ProgrammerDor, Randal Masutani, Randy True, Raoul van Prooijen, Renaldas Zioma, Ric King, Rob Bruno, Robert Comyn, Robert Diaz, Roland Bobek, sam raza, Sergey Kruk, SonOfSofaman, Stefan Nesinger, Stefanus Du Toit, Stephen, Stephen Riley, Stephen Smithstone, Steve Jones, Tayler Porter, TheWebMachine, Tom, Tyler Latham, Vincent Bernat, Vladimir Solomatin, Walter Montalvo, Warren Miller, xisente, Yee Lam Wan, דויד אללוף

Why it's here

2 people recommend this

What people say. Recommended as a clear explanation of the PS/2 keyboard protocol and clocked serial communication.

jameson Lobsters • Recommends

How does a PS/2 keyboard interface work?

zackbloomon Hacker News • Recommends

On “The last generation of typewriter repairmen (2010)”

There's a good video on how PS/2 works here: link to this video It's pretty straight-forward. There are also pre-made kits for digitizing typewriters if that interests you.

u/_Skuzzzyin r/embedded • Mentions

Typical way folks convert PS2 signal? Was poking around and watched Ben Eater's PS2 video link to this video but one thing I was trying to understand is how computers typically consume these events, is there simply a loop running to read the contents of the shift register? Does it typically empty the shift registers to make sure it doesn't double read? This video does a good job of getting the data into a digital format, but wondering typical ways computers consume it. Any links would be helpful

thristianon Hacker News • Mentions

On “How does USB device discovery work? [video]”

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: link to this video - Somebody on Patreon asked about USB keyboards having higher latency than PS/2, so he made a video about the basic USB protocol: link - He made the OP video about USB keyboards being limited to holding six keys at once.

bear8642on Hacker News • Mentions

On “It's Time for Operating Systems to Rediscover Hardware”

think might be at end of this one < link to this video > though there's a few he's done recently on USB spec

RJIb8RBYxzAMX9uon Hacker News • Mentions

On “IBM PS/2 Keyboard Modification”

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/20 and USB keyboards1 work. USB's a vastly more complicated protocol compared to PS/2. 0 link to this video 1 link