Keyboard interface hardware

3 Apr 2021
121 558 Aufrufe

Check out for more 6502 goodness
Support these videos on Patreon: or for other ways to support.


Social media:

Special thanks to these supporters for making this video possible:
Aleksey Smolenchuk, Alexander Wendland, Andrew C. Young, Anson VanDoren, Anthanasius, Armin Brauns, Asherah Connor, 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, Carlos Ambrozak, Christopher Blackmon, Clint Bridges, Dale Andrew Darling, Daniel Jeppsson, Daniel Tang, dans, 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, Dušan Dželebdžić, Dzevad Trumic, Emilio Mendoza, Eric Dynowski, Erik Broeders, Eugene Bulkin, George Foot, George Miroshnykov, Harry McDow, Ian Tait, Ingo Eble, Ivan Sorokin, James Capuder, james schaefer, Jared Dziedzic, Jason DeStefano, Jason Specland, JavaXP, Jaxon Ketterman, Jay Binks, Jayne Gabriele, Jeremy A., Jim Kelly, Jim Knowler, Jim Van Meggelen, Joe Beda, Joe OConnor, Joe Pregracke, Joel Miller, John Fenwick, John Meade, Jon Dugan, Joseph Portaro, Joshua King, Jurģis Brigmanis, Kai Wells, Kefen, Kenneth Christensen, Kent Collins, Kitick, Koreo, Lambda GPU Workstations, Larry, László Bácsi, Lucky Resistor, Lukasz Pacholik, Marcos Fujisawa, Marcus Classon, Martin Roth, Mats Fredriksson, Matt Krueger, Matthäus Pawelczyk, melvin2001, 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, raoulvp, Renaldas Zioma, Ric King, Rob Bruno, Robert Comyn, Robert Diaz, Roland Bobek, sam raza, Scott Holmes, 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, Wraithan McCarroll, xisente, Yee Lam Wan

  • Let's see now. Output - Check Keyboard - Check Data Storage - Missing Would be nice if the next project is a SPI interface to drive a SDCARD for data storage.

    John CochranJohn CochranVor 11 Stunden
  • Please make a video in 16 bit microprocessor

    Rinku MajiRinku MajiVor 13 Stunden
  • Thank you Ben for all your videos

    Manny SinghManny SinghVor 22 Stunden
  • Are there any keyboard interface ic and display interface ic available in market??? Like LCD driver IC you already used...

    Sagar BhaleraoSagar BhaleraoVor Tag
  • this man is going to do something big, but only taking small steps he already made a bad 6502 pc he already made a bad video card AND NOW HE MAKES A WORKING KEYBOARD SYSTEM??

    FrostieFrostieVor Tag
  • Calling it now, shift register to receive the data and it interrupts on the stop bit to read it.

    AIO inc.AIO inc.Vor Tag
  • how many bens have you eaten

    Alguien De InternetAlguien De InternetVor Tag
  • Having the 522's interrupt and the latch enable trigger from the same line seems like a risky data hazard.

    iwantagoodnamepleaseiwantagoodnamepleaseVor 2 Tage
  • I love this, but could you make a RPN programmable scientific calculator kit/tutorial? HP 35s is just too expensive

    Štefan RástockýŠtefan RástockýVor 2 Tage
  • I wouldn't be surprised if this series will be how to program an OS from scratch in the future

    Alsen 99Alsen 99Vor 3 Tage
  • Hey, do you think you could show us how to make an EGA-to-Composite adapter? I want to be able to run DOS tech demos and DOS games using CGA graphics on EGA hardware without losing the ability for them to exploit NTSC artifact compression and create additional colors. Also, the only EGA cards with Composite video output will only produce Monochrome over composite :/

    Amaroq StarwindAmaroq StarwindVor 4 Tage
  • I love how whenever Ben runs into something unexpected, he figures out the issue in a really seamless manner, doesn't stumble in his explanations, just keeps recording. I also loved his explanation of how a Schmitt Trigger works.

    Kat the FoxtaurKat the FoxtaurVor 4 Tage
  • Can't wait until we implement GEOS on a 8x8 LED matrix

    stupossibleifystupossibleifyVor 5 Tage
  • Thank you ☺️

    Ajay PanchalAjay PanchalVor 5 Tage
  • my bad when I first read your channel name I thought it said bean eater

    PuffelPuffelVor 5 Tage
  • He touches my ego😈

    Mr. ADHILMr. ADHILVor 5 Tage
  • Wow, so cool

    Sans UndertaleSans UndertaleVor 5 Tage
  • Bro you need to make your own computer from scrach

    ??????????Vor 6 Tage
  • Extremely low level😍

    Onur KARAKAYAOnur KARAKAYAVor 6 Tage
  • Nice, I didn't understand a thing

    Alejandro NavaAlejandro NavaVor 6 Tage
  • When Ben is done with this computer I nominate it to be named "Apple Eater"

    ijoshuadockeryijoshuadockeryVor 6 Tage
  • This is awesome stuff. I am thinking about either the 6502 or 8 bit. What's the main difference in both kits? Also, if I wanted to by a few extra logic IC chips, where do you normally go to buy them?

    John RossoJohn RossoVor 6 Tage
  • I comment for the algorithm

    snapysnoopsnapysnoopVor 7 Tage
  • Up next: Build your own RTX 3070 graphics card, faster than Nvidia sending you one.

    MilesMilesVor 7 Tage
  • I am very much interested in learning assembly language. Can you make a complete series on assembly language.

    Tech OdishaTech OdishaVor 7 Tage
  • You're one of the amazing guy who teach how actually working inside the computer❤

    Sanjaya AnuradhaSanjaya AnuradhaVor 7 Tage
  • i need this keyboard

    Muhammad FaheemMuhammad FaheemVor 7 Tage
  • Hello Sir , I have quick question that is why power is always 5 V, why not 5.5 V or 4.5 V or 6, 7, 8, 9 V etc. ?

    Sabihul HafizSabihul HafizVor 7 Tage
  • Hey so we can make a 32 bit conputer with gpu on bread board or a commercial pc if we convert it into pcb ???

    AceAceVor 7 Tage
  • Big noob here, can't you have a capacitor in the output of the 1st inverter to mitigate the bouncing (with a fast charge and little bit slower discharge) ?

    antoine lievreantoine lievreVor 8 Tage
  • In the future he is gonna hook up this keyboard, his graphics card, make operating system and have fully functional everyday-use computer ;)

    Wędrowiec PawełWędrowiec PawełVor 8 Tage
  • Digital circuits don't like analogue signals. Best use the 74HC14 Hex Schmitt inverter. Same footprint but it will properly amplify the input and clean it up. OOps Jumped the gun there, knew you would cover that. Could probably shorten the RC delay now you have better defined cut off threshold for logic levels.

    Peter DawesPeter DawesVor 8 Tage
  • WOW. Your videos are great, every single film are very interesting.

    Adam GrzybowskiAdam GrzybowskiVor 8 Tage
  • Awesome! Great video! very useful

    Ken LottsKen LottsVor 8 Tage
  • What do the other two voltage values mean for the inverter spec (16:48) ? Ben was always picking the middle one (for example 3.15V as the minimum HIGH Level input voltage) but the box also lists 1.5 and 4.2.

    bnvdarklordbnvdarklordVor 8 Tage
  • Omg I finally understand what a peak rectifier is. Thanks Ben!

    Jameson401Jameson401Vor 8 Tage
  • As a programmer I just kind of accept that the hardware is magic even after watching these videos

    Falxie_Falxie_Vor 8 Tage
  • Ben is on track to teach the world how to build a Commander x16 before they actually release one! Love both projects. But love this detail!

    Chris GreenoughChris GreenoughVor 8 Tage
  • I admire you sir, please recommend some books to learn about it.

    Khushvir CheemaKhushvir CheemaVor 9 Tage
  • Great video. It would have been a good opportunity to discover the Shift Register feature of the 6522 VIA.

    Alexandre DumontAlexandre DumontVor 9 Tage
  • Super video! I applauded for NZ$5.00 👏👏

    Clark MillsClark MillsVor 9 Tage
  • Hey Ben Eater, when you finish the project, try to join the worst video card with the computer, with keyboard control making sure that, for the worst video card you do the pcb, for the motherboard you put the control for the keyboard, and as a final touch try to make support for the cpu, so that you make the first pc created by home and free programming by other users to improve either performance or functionality or try to make a nice pc where you can start some game, and make it also become an office PC for small upgrades that have been introduced by YOU and other USERS. Thank you for reading me.

    Snap DragonSnap DragonVor 9 Tage
  • I've read previously that the IBM Model M uses a slightly non-standard signal that isn't quite the same as other PS/2 keyboards - is that true and do you have any insight into how/why?

    rebmcrrebmcrVor 9 Tage
  • I wonder if he's going eventually program the kernel.

    João MartinsJoão MartinsVor 9 Tage
  • great video. thanks a thousand times for putting your time and effort in this project. you have been a great inspiration source to me. I wish you would make a video about memory banking and methods to address memory space larger than 64KB with 16bit address BUS. I have some ideas, which might sound stupid, like splitting a long address into 2 parts of 16its and sending the higher order address followed by the lower order address to a some sort of logic circuit with some counters that keeps track of the larger address since 6502 can only count to 64KB, instead this decoder of some sort or the memory address manager circuit will be able to access say a 128KB, 512KB.. memory using it's larger address bus, say 24bit or more. Or maybe a logic to do bank switching. It would be a really interesting challenge.

    ilgaarilgaarVor 9 Tage
  • Did you switch the LCD screen to 4-bit mode in order to free some ports on the interface adapter? By the way, this series of videos is really great, basically all of what I know now about digital electronics and the passion that has risen in me about it came from here, and I am pretty sure other sources wouldn't have been capable of doing it. Keep doing the work you are doing because it really is the best out there. Right now I'm tackling a little project wich involves reprogramming a flashlight and in semptember I'm gonna start a bachelor in mechanical engineering with focus on electronics and programming, all because of you!

    Tommaso MorandiniTommaso MorandiniVor 9 Tage
  • Why no 555?

    Colin AlstonColin AlstonVor 9 Tage
  • "Keyboard interface hardware" ?!? Pft. ... by Ben Eater ??!!! Hold my databus.

    Mattias W.Mattias W.Vor 9 Tage
  • 26:56: Ahhh, the HP-15C - what a beauty!

    Michael JørgensenMichael JørgensenVor 9 Tage
  • Excellent video as always Mr Eater. You are a gift to youtube

    Blake ScherschelBlake ScherschelVor 9 Tage
  • The effort you put into explaining is greatly appreciated.

    Ean EricksonEan EricksonVor 10 Tage
  • all of the "things that go wrong" and the process to fix them are my favorite parts of these videos. they would be so much less useful if you just built it perfectly from the get-go

    ridespiralsridespiralsVor 10 Tage
  • Super video! I applauded for CA$2.00 👏

    glenn allanglenn allanVor 10 Tage
  • Hi, I made this video using the serial communication between the PS / 2 keyboard and a Z80 microprocessor. Very similar to the 6502, but I used a device for serial communication. I am very curious to see how you will convert from ps/2 to ascii. I did it using the keyboard value to address a table with the ascii data. I love your video, congratulations on the video

    Leonardo PJLeonardo PJVor 10 Tage
  • I'm reliving my teens as a 1980s era computer geek.

    GnudarveGnudarveVor 10 Tage
  • increments sak

    JAG 0937 EBJAG 0937 EBVor 10 Tage
  • Ben, You Rock.

    Analog DudeAnalog DudeVor 10 Tage
  • ben your equivalent of measuring start stop with the capacitor is like using a pulse extender in minecraft lmfao

    a persona personVor 10 Tage
  • "Hmm, could use a diode to shape that charge / discharge curve, but that seems dumb so I bet he got a better solution in mind" -> Ben adds a diode. "Oh."

    MythriciaMythriciaVor 10 Tage
  • Lots of students searching for answers that are missing in school. What's wrong with these teachers.

    robert mccullyrobert mccullyVor 10 Tage
  • great idea to use Schmitt inverter to clean up the decaying RC voltage!

    LukeLukeVor 10 Tage
  • This series is right on time for me. I'm about to build an SYM-1 from a new old stock (43 years old!) unused motherboard in the next few months (It's a variant, but it's from Synertek; I believe it's the SM-100 OEM line motherboard). It's 6502 based. I want to build the original KTM2 and/or KTM3 modules for it at some point, but they are much more complicated and pricey to make. I'm looking at possibly modding the KTM design with my own more modern KB interface so I don't have to build my own keyboard, and/or making a simpler KB interface direct to the machine.

    Brianna SchumanBrianna SchumanVor 10 Tage
  • You can take a Monoflop instead of the Inverter to solve the problem

    Viktor HugoViktor HugoVor 10 Tage
  • Idea for the 6502 project: remove that LCD display and make it compatible with the world’s worst graphics card and viola a fully functional computer

    Elyas gamingElyas gamingVor 10 Tage
    • Didnt he do that in another video?

      PerkyElixir22 YTPerkyElixir22 YTVor 10 Tage
  • I just need another brain to understand your knowledge.

    Sam J. PaulSam J. PaulVor 10 Tage
  • 👍

    Elektronik AtölyemElektronik AtölyemVor 10 Tage
  • That's an interesting approach! I thought about using XORs to calculate parity, then use ANDs to check if the start/stop/parity/my parity combo is correct. That output would be the interrupt trigger. It consumes more hardware, but it is "safer" and easier for the software, since it filters noise and corrupted inputs.

    emcostaemcostaVor 10 Tage
  • Real Life Shenzhen i/o!!

    Michael MaldonadoMichael MaldonadoVor 10 Tage
  • Finally. A decent implementation of the ps/2 interface hardware for 8-bit computer. Thanks for video

    Владимир ТатуновВладимир ТатуновVor 10 Tage
  • and here i am .... still stuck on the ram implementation. cant figure out why that made it not working anymore. cant have bought 2 defective ram modules...

    DarthZackTheFirstDarthZackTheFirstVor 10 Tage
    • Consider posting on People may be able to help you there if you describe your issue

      Dimitris KaragiannisDimitris KaragiannisVor 10 Tage
  • Is there a link to the previous video building the shift registers that is referenced in this video?

    Paul Anthony VildPaul Anthony VildVor 10 Tage
    • This is really part 2. Here's part 1:

      BrightBlueJimBrightBlueJimVor 10 Tage
  • Are there any videos explaining easily how some chips do what they do?

    Gabriel PetreGabriel PetreVor 10 Tage
  • Super video! I applauded for $10.00 👏👏👏

    Papa PigsPapa PigsVor 10 Tage
  • I am soaking this up. What a great installment of a truly great series.

    Alan CanonAlan CanonVor 10 Tage
  • By the time graphics cards are available again, Ben's computer runs Crysis.

    Tommy 'TomTom' TomestiniTommy 'TomTom' TomestiniVor 10 Tage
  • I hate to speculate but I feel like this is going the way of a game of snake using the videocard

    Giorgio ElgarGiorgio ElgarVor 11 Tage
    • @BrightBlueJim Oh yeah I know, mitxela is one of my favorite channels

      Giorgio ElgarGiorgio ElgarVor 10 Tage
    • Oh! You need to look at this, then: This is a game machine based on the Atmel ATmega128 that outputs to an oscilloscope. It plays Pacman, Tetris, Snake, Lunar Lander, and Mario Brothers, each of which was a weekend project.

      BrightBlueJimBrightBlueJimVor 10 Tage
  • Have you managed to accidentally enable extended memory through your keyboard controller?

    Kartik Cating-SubramanianKartik Cating-SubramanianVor 11 Tage
    • Are you referring to the a20 line? I think that joke is perhaps rather specific to people to are interested in x86 operating system or bootloader development

      Emil FriðrikssonEmil FriðrikssonVor 10 Tage
  • Finally i understand RC timers! Thanks.

    Karl MKarl MVor 11 Tage
  • You should provide a course for beginners. How to use a breadboard, basic electronics, etc type of thing to go along with these more advanced sessions.

    Collected ReaderCollected ReaderVor 11 Tage
  • So in theory with the right rom code you can use this thing to run basic like one of those early 80s portable computers that run on batteries and had a similar display

    piecaruso97piecaruso97Vor 11 Tage
    • @BrightBlueJim I remember there was a small Tandy portable computer that had a display similar to the one used here by Ben and that run on batteries, add maybe a cassette interface and basic support and Ben’s machine has similar capabilities basically. I know about the chips but I couldn’t not think about how close this machine is to one of those 80s machines

      piecaruso97piecaruso97Vor 10 Tage
    • Not exactly - you need a lot more than a CPU and a ROM to make an early 80s computer. But that's pretty much what Ben is describing, one chip at a time. This particular project is one of several using the 6522 "Versatile Interface Adapter" chip, which was a chip designed specifically to simplify building a system with the 6500 series CPUs. Watch Ben's series on the 6502, which goes into great detail about how to make a full personal computer of the early 80s kind. So far he hasn't gone into such things as operating systems or standalone BASIC systems that don't need an OS, but I expect those will be coming along.

      BrightBlueJimBrightBlueJimVor 10 Tage
  • Ben's projects bring me back 35yrs to when I first started in engineering. Love how the simple, RC/Schmitt-trigger solution fits with the spirit of the projects. Have a slight suggestion for a more "professional" solution. Use a 74LS393 dual counter to make a 7-bit counter clocked off the 1Mhz. Tie the inverted keyboard clock to the CLEAR line. The counter will be reset every 43us by the keyboard clock, and held in reset for 43us. Use the 6th bit of the counter to make a 32us pulse, beginning 64us after the last keyboard clock for the interrupt pulse. Then use the 7th bit (inverted) with an AND gate on the 1Mhz clock to stop the counter, until reset by the next keyboard clock. Again NOTHING against Ben's solution, just offering a different perspective, in the same vein of "teaching". peace out!

    Ron BasqueRon BasqueVor 11 Tage
    • I’m sorry it honestly was not my intention to be insulting. And I guess you’re correct professional may have been a poor choice of words. Just thought others would be interested in a digital alternate.

      Ron BasqueRon BasqueVor 10 Tage
    • This is not more professional. To be clear, the objective of engineering is to get the desired task done reliably, with the minimum cost required. If you were designing this within a custom chip, where you don't have the option of producing delays by using resistors and capacitors, and where you would likely have a clock input, this might be a valid approach, but for a low cost solution, it is overkill. And sure, there are always alternative ways to do things that present different tradeoffs, but calling your approach "more professional" is a bit insulting, I think.

      BrightBlueJimBrightBlueJimVor 10 Tage
  • Great video... although I was yelling "Schmitt Trigger" repeatedly from the back of the class room... sorry about that..... really looking forward to seeing the software.

    edgeeffectedgeeffectVor 11 Tage
  • Ben, I'd like to tell you that your content is very inspiring and i have the Idea of crating similar content on youtube in Arabic for college students :)

    Ehab AhmedEhab AhmedVor 11 Tage
  • I need that resistor board, wow!

    My 3D printed lifeMy 3D printed lifeVor 11 Tage
  • Ben Eater 2025: Building a Computer that runs Minecraft using breadboards

    1997CWR1997CWRVor 11 Tage
    • It could happen!

      BrightBlueJimBrightBlueJimVor 10 Tage
  • Finally an explanation of Schmitt triggers I understand!

    nullplan01nullplan01Vor 11 Tage
  • Super interesting! Thanks.

    FrikFrikVor 11 Tage
  • encouraging

    Nicholas KinneyNicholas KinneyVor 11 Tage
  • What's going on with your SNR here? You have 5V signals and have like 1 Vpp of noise on the oscilloscope. That's a ton of noise.

    ChrisChrisVor 11 Tage
  • I'm sitting here yelling "no, use a 7414 instead of a 7404" and then I remember Ben's teaching style. Then I sit back and watch for the object lesson. OMG, I wish I had a teacher like Ben many years ago. These videos stand out as some of the finest teaching I've ever seen.

    Pixel SchnitzelPixel SchnitzelVor 11 Tage
  • Eureka. I now understand the symbol for a Schmitt Trigger.

    Julian NichollsJulian NichollsVor 11 Tage
  • Suggestion, make it so the interface will only trigger an interrupt for the cpu on key press/release and not on key held.

    Gideon Max MerlingGideon Max MerlingVor 11 Tage
    • @BrightBlueJim I know, he could add another micro controller that does that

      Gideon Max MerlingGideon Max MerlingVor 10 Tage
    • That's quite a bit more complicated, and WAY easier to implement in software than hardware, because in order to detect the difference between an initial press of a key from an automatically repeated key, you have to know whether you have already received a key down code without a corresponding key up code. Or to put it another way, you have to know the current state of the whole keyboard, which is a lot of bits.

      BrightBlueJimBrightBlueJimVor 10 Tage
  • You could do the parity check in hardware and AND it with the interrupt signal...

    HenryLoenwindHenryLoenwindVor 11 Tage
    • In fact, I now recall that the first computers I used, which were university computers I connected with a modem to a Teletype, used 7 bits with parity, and the Teletype just ignored the parity. Later on, parity went out of style, and most modems were set to 8 bits, no parity, with my guess being that this was because there was little point in generating parity when most terminals ignored it anyway.

      BrightBlueJimBrightBlueJimVor 10 Tage
    • @HenryLoenwind Ah. I was thinking that the parity bit was one of the 8 bits. So yeah, it probably is better to handle parity in hardware, if you need to do it at all. I say that because with simple parity, about all you can do is just throw away any codes that fail parity. But this can be problematic with a keyboard, in that if a "key up" code fails parity, the computer will think that the corresponding key was never lifted. I'm not even sure why a direct wire connection that is typically only a few feet long even needs parity, and the fact that missing a character can be just as bad as receiving the wrong character makes it even less useful.

      BrightBlueJimBrightBlueJimVor 10 Tage
    • @BrightBlueJim In this case the limiting factor is input pins. You're limited to a single byte here, so splitting the 11 bits up into 2 bytes and feeding them to the CPU one after the other would be the bigger effort. Parity and start/stop bit checking takes less hardware than multiplexing the input.

      HenryLoenwindHenryLoenwindVor 10 Tage
    • You could, but one of the most important skills in engineering is deciding which things to do with hardware, and which to do with software. Parity checking in hardware is certainly possible, but unless extreme speed is needed (which is not the case for a keyboard interface), it's usually better done in software.

      BrightBlueJimBrightBlueJimVor 10 Tage
  • What changes did you make to the Lcd wiring to open up the extra pins on the 6522?

    Brian BeckiusBrian BeckiusVor 11 Tage
  • I am both delighted and unsurprised that you are a Vim user. Excellent video!

    Matt BMatt BVor 11 Tage
  • Do you have plans to support extended chars (aka Latin/EU ones)?

    DREDDDREDDVor 11 Tage
  • U r angel

    Mahmoud AbdlshafiMahmoud AbdlshafiVor 11 Tage
  • You sound like a younger LGR guy

    ThatMysteriousMan1ThatMysteriousMan1Vor 11 Tage
  • American programmers always use "Hello, world!". What is wrong with that? Well, if I was saying hello to you I would type "Hello Ben!". No comma! It is grammatically incorrect to use the comma between 'hello' and the subject you are addressing. Sorry to be the grammar police! lol

    Galbi 3000Galbi 3000Vor 11 Tage
    • Actually, from what I've seen, only about half of American programmers put that comma in there.

      BrightBlueJimBrightBlueJimVor 10 Tage
  • Your circuit reminds me or the 555 timer you explained in a different video.

    Joseph ChamnessJoseph ChamnessVor 11 Tage