The reason the Pause/Break key has such a weird scan code is because old 84-key keyboards didn't have that key and used Ctrl+Num Lock for Pause/Break. If you look at the scancode it's actually a make sequence for control and num lock, followed by a break sequence for both-so it acts like you quickly presesed and released control+num lock even if you hold it down.
@luizzeroxis3 жыл бұрын
That's really cool!
@Mike.Kachar3 жыл бұрын
Does that mean that, for keyboards/laptops that do not have a pause/break key (nowadays), that they can use Ctrl+Num Lock for that same function? For Windows OS's, in my job, I frequently give people the hotkey of Win Key + Pause/Break key to give me the info I need, and sometimes I hear that they don't have a Pause/Break key. In those situations, would Win Key + Ctrl + Num Lock work?
@owenvogelgesang73143 жыл бұрын
@@Mike.Kachar I think if a keyboard is cut down enough to not have a pause/break key, it probably doesn't have a number pad either
@voodoolilium3 жыл бұрын
@@owenvogelgesang7314 My laptop actually has most of numpad and no pause/break. I don't think the Num Lock is a normal num lock though, I think it switches the keys in hardware, because the numpad doesn't have any nav keys on it. BUT, I'm sure somewhere out there these is a keyboard with a numpad but no pause/break, especially if you consider the world of custom mechanical keyboards, although that's a whole other can of worms....
@theowinters63143 жыл бұрын
Same thing for Print Screen, on old keyboards you would press shift-numpad *, and other then the extended code (probably because to indicate it's a multibyte code) it's still that.
@marred22773 жыл бұрын
"I've got about 8 of 'em here, at least as far as you know" LOL
@nickvoncloft45663 жыл бұрын
i counted a sliver of one off screen
@fabianmerki42223 жыл бұрын
he used ctrl+c and ctrl+v ... how many scan codes?
@DanielBeecham3 жыл бұрын
@@waldolemmer gotta be at least 12?
@janhaverkamp28423 жыл бұрын
This killed me too.
@AcheForWake3 жыл бұрын
That made me laugh,
@osirisgolad3 жыл бұрын
"I've got about eight of them here; at least as far as you know..." Should we send someone to check on you?
@nickvoncloft45663 жыл бұрын
i counted a sliver of one offscreen
@eternaldoorman52283 жыл бұрын
😂
@Tedd7553 жыл бұрын
Choked on my coffee when he said that.
@RedwoodRhiadra3 жыл бұрын
The serial output of the bottom-most visible board didn't have any wires headed further down, so 8 was how many he had...
@zetaconvex19873 жыл бұрын
@@nickvoncloft4566 It's breadboards all the way down.
@YoursTruelyMe23 жыл бұрын
To anyone reading... Ben's website under credentials says "I went to school for computer science, but failed out after the first year and have no degree" Why I bring this to attention is because with such a deep understanding, I assumed this guy had several PhDs. The fact that one of these videos is more informative than some of the most rigorous 4 year programs is a true testament to self education. This is the golden corner of KZbin, please never stop.
@dandan78843 жыл бұрын
seems like those who value knowledge dont value degrees nearly as much, dont they
@jeromethiel43233 жыл бұрын
That's because computer science degrees don't teach digital logic. Not like this, anyway. Modern computer science is all about high level languages, because they want you as divorced from the metal as they can get. I actually had 2 semesters of digital logic, and we hand built everything on breadboards, just like Ben does. But i was not in computer science, i was in electronics, which is different. Because digital logic is a very useful tool when you are building electronic devices, you often end up with "digilog" circuitry, where you have some analog and some digital working together to accomplish a function.
@BetweenTheBorders3 жыл бұрын
@@dandan7884 It really, really depends. Undergraduate work is stuff you can usually teach yourself to greater or lesser effect. Graduate work is more about synthesizing ideas and research while doctoral level work tends to be almost pure theory. I am wildly over-simplifying. I would argue that this level of deep dive is easily graduate level presentation. The second he makes his own die, you send someone to check on him and I'll see if we can find him an honorary doctorate. ;) That being said, yes, a degree is not an education, but if you try hard enough, you can become educated while earning a degree.
@monad_tcp3 жыл бұрын
@@dandan7884 I got a degree just for social contract with my family. So they would stop bothering me. I was already well into the profession since 14yo. Entirely self-learned. Also me: I wonder if one day I could design my own CMOS chip, that's why I went to Uni, not to get the basics.
@TheEmeraldMenOfficial3 жыл бұрын
Well, think: Thomas Edison was expelled from the second grade. Albert Einstein was considered dumb in high school. Micheal Faraday never went to school and was illiterate. Winston Churchill failed English and Latin class in high school. Self-education is more effective than most education systems out there.
@samp-w74393 жыл бұрын
Everybody gangsta' until he slides in 8 identical copies of the shift register. (At least as far as we know)
@monad_tcp3 жыл бұрын
And I though cook shows were crazy with their tricks of pulling 2 of the thing already made from under the table.
@Roxor1283 жыл бұрын
Something to clarify: The two pins Ben said were unused only applies to keyboards. Mice use them and leave the ones used by a keyboard unused. If you've got a PS/2 keyboard with a trackball in it that still only uses one plug, the trackball will be using those pins while the main keyboard uses the other two.
@solhsa3 жыл бұрын
Ah, that explains how some systems have a single ps/2 port and you can use an adaptor to hook both keyboard and mouse in.
@tirocska3 жыл бұрын
Thanks! I was reading the comments hoping to learn what the other 2 pins are for. (And also the reason for the strange bit-mapping of the keys.)
@NiyaKouya3 жыл бұрын
That also explains how "dual personality" PS/2 ports on modern mainboards (probably) work. The board/chipset/cpu knows if a keyboard or mouse is plugged in by which data/clock pin is used.
@Bunkers-Boys3 жыл бұрын
so now ben needs to build a mouse interface
@HenryLoenwind3 жыл бұрын
@@solhsa And it explains why they moved from the 5-pin connector to the 6-pin connector.
@bertholtappels10813 жыл бұрын
This guy turns a KEYBOARD PROTOCOL into binge-worthy content. That’s one of those things about 2021 that I didn’t see coming.
@MarioManTV3 жыл бұрын
After watching his VGA interface video, I could watch this man cobble together *any* IO protocol, in discrete logic circuits, all day. And I’d be captivated the whole time.
@deedewald17073 жыл бұрын
Well put !
@LeoStaley3 жыл бұрын
Wish I understood. I don't even know what ground and shield mean.
@topilinkala1594 Жыл бұрын
@@LeoStaley In a real computer the shield is connected to the mains ground which is the same protective ground that is in the chassis of the computer. The ground is the 0 VDC on the +5 VDC voltage supply.
@RuiMartins3 жыл бұрын
Scan codes are based on a matrix of vertical and horizontal lines, at least for the main section of the keyboard. That is why key "1" and "2" start with Hex1 (same matrix vertical), and similar for "3","4","5" starting with Hex2 and "6","7","8" starting with Hex3, ... they belong to the same keyboard matrix vertical scan line. The right Hex digit is the horizontal matrix scan line. The other special keys, like: "F"unction , Insert, Home, PageUp, Delete, End, PageUp, System/PrintScreen, Scroll Lock, Break/Pause, ... depend on how they were mapped on the Matrix of the first keyboard that added them. For example, F1 to F6, where originally listed vertically on the left side of the keyboard, hence all their codes start with Hex0. The IBM standard evolved with each successive keyboard, with new keys, that were usually mapped to the closest vertical and horizontal lines of the scan matrix. Basically to make it as simple as possible to route the matrix circuit onto the keyboard PCB, since any pattern can be easily handled by the software layer.
@HenryLoenwind3 жыл бұрын
Yes. The first keyboard to use those codes didn't send a byte, it sent two nibbles for the row and column. But when the first PC came around, they already needed a microcontroller to map row/col onto those backwards compatible scancodes. And so they started a tradition that still lives on today...
@allanrichardson3135 Жыл бұрын
I remember reading that the original K/B interface had the driver program in the CPU send the column number to the keyboard, and the keyboard would send back a byte containing a 1 bit for each key in that column that was pressed. The driver had to maintain a map of which keys were pressed by rotating through the columns and saving the bits many times per second, and detecting when one or more changed from its previous value. Needless to say, the second time around was much more efficient.
@MIKAEL2123453 жыл бұрын
"8 of them as far you know" LMAO. This and the zooming out on the data the HOME key was sending was so funny to me. It's like watching the old commercials "But wait there's more!"
@ouya_expert3 жыл бұрын
call now and get another 11 bits absolutely free, plus shipping and handling
@BertGrink3 жыл бұрын
Or those cooking shows where the host/chef says "Here's one i made earlier"
@DerMarkus19822 жыл бұрын
"If you release the key *now* , you'll get an "F-Zero" byte *along with* your regular scancode! And if you use an extended key, you'll get *three* bytes when you let go!" "But wait, there's *yet more* ! I haven't started talking about PrintScreen and Pause/Break! Get yout uber-load of bytes RIGHT NOW!"
@SnowyPup3 жыл бұрын
22:20 Man, this really hits home
@zvava3 жыл бұрын
this is the greatest dad joke ever
@HenrikDanielsson3 жыл бұрын
Morgan Freeman narrating the epilogue of this series: "...and as far we know, Ben is still out there, happily building scancode decoders 'til this day...".
@khatharrmalkavian33063 жыл бұрын
When he said, "...for all you know," I imagined a five foot mound of breadboards behind him.
@nickvoncloft45663 жыл бұрын
samuel l jackson would make it better by throwing in cursewords
@tomyyoung26243 жыл бұрын
Yes changes, UTC +9 hours all of the period
@willofirony3 жыл бұрын
He had 256 breadboards, wired together to make a word processor. The next episode is going to be a doozy!
@FranklinChou3 жыл бұрын
@@khatharrmalkavian3306 Slices of breadboards?
@N0Xa880iUL3 жыл бұрын
Your channel is worth more than gold. This stuff you are making is timeless.
@electronicengineer3 жыл бұрын
I totally agree with your statement. Ben's way of teaching is, in my opinion, the best way for me to learn. I love every single video this man makes because he presents his massive knowledge one step at a time, sequentially explained, so even slow people, like myself, can follow his thinking, as he progresses, and actually Understand his thinking. A master teacher, Ben is. Fred
@red_ford233 жыл бұрын
somehow this stuff is gonna save a space mission someday because finally this info is being passed cross generations properly. This is an amazingly clear presentation. Thank you.
@To-mos3 жыл бұрын
@@red_ford23 Welcome to interplanetary mechanic school, this is your holographic AI driven teacher Ben Eater recorded from the year 2021.
@apkat20663 жыл бұрын
@@electronicengineer I made 4 bit RAM ckt using only D FLIP FLOPS And Basic gates:kzbin.info/www/bejne/p2jFi6Zog82caqeu
@apkat20663 жыл бұрын
@@To-mos I made 4 bit RAM ckt using only D FLIP FLOPS And Basic gates:kzbin.info/www/bejne/p2jFi6Zog82caqeu
@MovieMationStudios3 жыл бұрын
Ben busted out that ready-made second shift register breadboard like a Food Network chef
@BertGrink3 жыл бұрын
Exactly! 😂
@Roxor1283 жыл бұрын
I'm a little disappointed he didn't use the phrase "here's one I prepared earlier".
@ZeroSleap3 жыл бұрын
I cannot state enough,the fact that your channel is one of the few channels concerning computer science/engineering that is WHOLLY bingable. Every video makes you ask for more,bravo!
@garychap83843 жыл бұрын
Great video, man, it took me right back to my early hacker days : ) We used to swap out PS/2 keyboards in target sites, with a modified one that could install malware and act as a bidirectional radio link to the attacker. Nobody ever suspected that the keyboard was an attack (and communication) vector. Call centres were one of our favourite targets as they had access to the targets customer systems and the high turnover of call staff made employee positioning ridiculously easy. Basically, you'd put your foot on the keyboard cable and make a visible show of trying to pull the keyboard forwards to a comfortable position at the front of the desk. Of course, because you're resting a foot on the cable, the cable would appear too short. Then, you'd look under the desk and sigh ... disconnect the keyboard and pass it under the desk (as though trying to free the cabling) ... once under the desk we'd quickly swap the keyboard with one in our bag... and then bring it back up. Done correctly it's a fast and smooth way to switch keyboards undetected. Now, there were a few things that most people don't consider... 1. Like the video said, a keyboard isn't an input device - it's a bidirectional input/output device 2. The keyboard can act as external media - installing malware and communicating with it once installed 3. A modified keyboard can act as a simple RF node, bypassing network security and backdooring standalones 4. Keyboards are (or, rather, were) never investigated or suspected to be vectors for persistent malware. We used a slow, low power PIC chip between the keyboard IC and the PS/2, powered from the PS/2 line itself. Malware once installed on the PC could send a sequence to the KB to let it know that the malware was available... but, if the KB didn't get the sequence after a few minutes, it would wait till a suitable moment _(a timeout after last keystroke)_ and then buffer any new keystrokes temporarily - whilst installing the malware! The malware installation was easy. Rapidly injected keystrokes opened the console via hotkey, dropped to black foreground and used the 'debug' command, to create and execute a tiny .com program in memory (the chain-loader) as hex. This tiny chain-loader program would then stream the real malware image from the keyboard using a faster more efficient method (binary data) that didn't echo into the console window. The malware would then execute via debug, closing the console and installing into the filesystem. After the KB has sent the last byte of the malware to the chain-loader it would then release any keystrokes in the buffer as normal and return to regular working. The user just saw a brief console window flash, if they were paying attention. This would never be seen again, as once the malware was installed, the periodic PS/2 'malware available' sequence kept the keyboard happy. We also experimented with a system that would identify logins (by comparing first keystrokes after boot) ... then wait till it had been on more than 12 hours AND more than 4 hours since last keypress. It would then assume that the machine had been left on overnight, and would log-in using the stolen credentials and install : ) Our agent could then swap keyboards with another machine they didn't have credentials for... under the guise of "stealing a nicer keyboard" ... in call centres nobody cares... they find it funny if you steal the managers keyboard. Scavenging nicer headsets, ear foam, voice tubes, mice and keyboards is quite common in call centre environments ; ) The malware was pretty sweet, and could be updated wirelessly. The malware on the PC communicated with the PS/2 keyboard, which stored user passwords, web passwords, and other data - and released it via short range wireless on the hour every hour. Every hour the RF module would listen for 10 seconds for a short binary "hello" sequence before going back to sleep. If it heard a "hello sequence" it would stream out all of its saved data. It would then listen for another 10 seconds before going to sleep again. A similar "thanks" sequence would cause the CPU to clear any stored data (successful transmission) You can do the same today in USB keyboards, using an ISM, GSM or WiFi module and any microcontroller with an integrated USB receiver (or emulator) ... a couple of IO pins and some onboard (or i2c) SRAM. These days they can also act as an AP with hidden SSID as the chips are cheap and low power... or, employ mobile data, a SIM and a 3G/4G module. The latter is particularly nice as it allows an attacker to remotely use the PC as a remote node into the LAN (for further penetrations) without having to negotiate the perimeter security. In the old days, fetching data off the poisoned device was as simple as walking past it at the appropriate time, with a similarly modified device set to capture information over RF. We used to use a modified walkman or portable radio in our pocket - as, again, these were never suspected as being malevolent. Back in the day, we didn't have the ISM band, GSM modules or cheap digital RF modules with good shaping... we used very simple bead-like devices that were carrier only, and we used checksums to validate message reception : ) These days it's a LOT more dangerous to allow a modded KB into an organisation. Yep, PS2 keyboards really bring back some great memories of misspent youth : ) Thanks for taking the time to make this video. Tinkering is it's own reward.
@halfacanuck2 жыл бұрын
Bad ass.
@mayaencuk38289 ай бұрын
Very enjoyable reads, every line of it. In fact I read it twice man! Purely scifi, espionage stuffs... 😂😂😂
@DoogieLabs3 жыл бұрын
Watching you cut the cable at one end instead of in the middle thereby having the DIN pigtail for later triggered my OCD.
@deedewald17073 жыл бұрын
Yes same !
@HorochovPL3 жыл бұрын
Two shift registers on a single board? Don't worry, I have another similar board. Wait, there's three actually! So, how many boards does Ben have? All of them.
@uwezimmermann54273 жыл бұрын
it's boards all the way down! (not elephants!)
@Yootzkore3 жыл бұрын
It's almost AVGN 64-32-16-8-4-2-1-½-¼-bit meme material.
@lightwaves18593 жыл бұрын
i'm fairly convinced he has a replicator.
@GuildOfCalamity3 жыл бұрын
Is there an award for break board wiring neatness? Because if there is, it DEFINITELY goes to Ben.
@StefanoBorini3 жыл бұрын
I did some research on the scancode origin when self-building a keyboard. I was not able to find anything authoritative, so the best guess I have for its strange pattern is the ye olde connection matrix they chose originally for the buttons. In other words, in the old days they connected the buttons with a reasonable (cheap to produce) row/col network, then the internal chip scans the rows and gets which column is connected to identify which key is pressed. So what you might get in the original, basic set, is simply the encoded row/column position of the button _according_ to the wiring matrix (not the visual layout). But I might be wrong.
@mikefochtman71643 жыл бұрын
I think you're on to it. We tore an old Hazeltine 1500 'dumb' terminal apart and found the 'scan' chip that interfaced the row/col switch matrix to ASCII. Sent the ASCII to RS-232 interface and that was about all there was on the 'output' side of the terminal. Of course the 'input' side to the screen was more complicated. :)
@okuno543 жыл бұрын
I would be extraordinarily unsurprised by this. Today we can just throw an arduino (or even a full raspberry pi!) into a keyboard and do a bunch of processing in the keeb itself, but back in the day you probly had to build all the functionality out of nand/nor gates, I dunno, maybe as many as four gates per IC 0.o
@BertGrink3 жыл бұрын
Yeah I was thinking along the same lines as I watched the video, so that does seem quite likely.
@BertGrink3 жыл бұрын
@@okuno54 As far as I know, when IBM introduced the original PC Model 5150, the keyboard had an Intel 8048 microcontroller built in, and all subsequent keyboards have had either that chip, a clone, or some modern derivative, for backwards compatibility.
@tomyyoung26243 жыл бұрын
Yes break code!
@whoknows82252 жыл бұрын
this man puts so much effort in his projects, it's bone chillingly good.
@dsgeyer3 жыл бұрын
“Black is 5v, figures” lololol love these videos. I need to quit everything and just do these videos all day
@Puner543 жыл бұрын
Quite Informitive!
@BlackEpyon3 жыл бұрын
In automotive wiring, black is usually 12v, and white is ground.
@omniyambot98763 жыл бұрын
@@BlackEpyon and all my life my instinct tells me every black is ground and red is postive V
@BlackEpyon3 жыл бұрын
@@omniyambot9876 IKR? That's where you get in trouble. And then in the US/Canada, mains AC, black is hot, and white is neutral, and you could potentially have a VERY bad time if you get those mixed up.
@omniyambot98763 жыл бұрын
@@BlackEpyon yeah man that's why I try not to touch high power lines until I'm very very sure what is going on
@TarakuT3 жыл бұрын
Thanks for this info. I was working on a old 8/16 computer and trying to build something to give me a monitor out and input for a keyboard. I managed to get a RGB TTL out and now a PS/2 keyboard to work thanks to your videos. I was about to give up. I work at a recycling place and we get in all kinds of 74 series logic. as well as old computers. now that I have this stuff at my disposal, I started building computers from the ground up. and with the help of your videos and others, things are getting better. I think everyone that is getting into computing and design should look into the older ways of doing things first. then they can improve and create things with a better knowledge and understanding on how things work. Maybe one day someone will redo the way computes work making them faster and better. If I decide to start a KZbin channel . it will be all thanks to you and the amazing people that I have talked with.
@SamBebbington3 жыл бұрын
He’s alive!
@Dinnye013 жыл бұрын
I'm pretty sure these videos take a long time to make.
@erueratait-jamieson4803 жыл бұрын
I was worried he’d Ben Eaten!
@josephrobertson50903 жыл бұрын
He's been making an army of these modules lol
@vbkfivn3 жыл бұрын
Ben, I just wanted to thank you for all the work you do in these videos. They really helped me find my passion for computer engineering.
@djcsdy23 жыл бұрын
The scan codes make a lot more sense if you arrange them on an IBM Model F keyboard, which is probably where they originated. It looks like the scan codes come from each key's position on the Model F keyboard matrix, with the low 3 bits representing the key's row from bottom to top, and the high 5 bits representing the column. This doesn't exactly correspond to each key's physical row and column but each column in the keyboard matrix instead corresponds to a cluster of keys on the keyboard. For example F4, F6, F8, F10, Tab, and Alt are assigned to column 1 of the keyboard matrix and are all physically adjacent to each other on the keyboard. F9 is the bottom-left key so it makes sense that it's assigned code 0x01. There are a couple of oddities that stand out. F7 must surely have originally been assigned code 0x02 but has changed to 0x83 for some reason. Backtick appears to be in a cluster with Alt and Tab but was at the other end of the keyboard on the Model F. Perhaps it has been reassigned a spare code to correspond to its modern physical location. Some other weird codes such as F11 are easily explained as keys that didn't exist on the Model F and have simply been assigned spare codes. Similarly the keys with extended codes didn't exist on Model F either.
@XT823 жыл бұрын
Great video. So basically, the PS/2 keyboard uses a UART protocol, but with an extra clock signal (USART). Maybe you could use a 8250 or 16550 UART chip to interface the keyboard to the 6502 computer, if you can find a matching baud rate. The 16550 even has a FIFO buffer for storing up to 16 bytes coming from the keyboard. The chip could be connected to the shared address and data busses you already have in the computer. An interrupt could be generated each time a new byte arrives. Also, it would be great to add serial communication capabilities to the 6502 computer.
@nagualdesign3 жыл бұрын
Brilliant. The story got even more interesting as it went on. 10/10 for effort!
@brianevans43 жыл бұрын
I can't even imagine how much work this video must've taken. The research, the testing, the scripting, the setup, the filming, the editing. many hours I'm sure. But it was worth it, such an interesting video
@VictorSavelle Жыл бұрын
KZbin finally decided it is time for me to find your channel, Ben. Amazing work!
@agvulpine3 жыл бұрын
Hint: There are scan codes for POWER, SLEEP, and WAKE. If you send those scan codes through a PS/2 interface on any modern PC (that still has PS/2 interfaces), you can make it instantly interrupt power or go to sleep. When I say instantly, I mean ungracefully turn off without question or delay.
@m.kostoglod79492 жыл бұрын
Some recent enterprise motherboards with ps/2 interface do not comply with those scancodes, they simply do not react!
@j7ndominica0512 жыл бұрын
I had a keyboard with a Power button in place of the Print Screen key. I had to remove it and cover the slot with tape.
@Inf1e Жыл бұрын
it acts like 98 power button, which is controlled by BIOS (UEFI in modern scenario)
@itsthesola103 жыл бұрын
"5v is black" Okay, now what? Next you're gonna tell me data is red? "data is red" oh no.
@Vaibhavhayaran13 жыл бұрын
It's 2030 and Ben is building a Quantum computer on breadboard.
@diggoran3 жыл бұрын
I'd very much like to see that happen! Such advancements in quantum computing over the next decade that it can be done on regular copper, aluminum, and steel components!
@ArnCiS963 жыл бұрын
You making my childhold dreams come true, next thing I wonder how mouse is working with same interface, waiting so much for future videos like this
@ElektrikDunyam3 жыл бұрын
exactly !!!
@iivarimokelainen3 жыл бұрын
*childhood
@ryanchase61943 жыл бұрын
SP/2 mice use the unused pins, pins 2 and 6 in the diagram he used. This is how you can have both keyboards and mice on the same input.
@harshavikramaraos72113 жыл бұрын
Hats off to you, Sir. The way you arranged everything on the breadboard without any clumsiness. Awesome
@AjinkyaMahajan3 жыл бұрын
Mindblowing Explanation man You Nailed it
@zactron19973 жыл бұрын
27:10 "I've got 8, as far as you know..." that's a golden moment. Love this channel.
@ChristieNel3 жыл бұрын
Games used to have issues with cursor keys filling up the buffer, because they sent more data. So if you played against a friend on the same keyboard, give them the cursors.
@Spedley_21423 жыл бұрын
I'd totally forgotten about that. I often used to try and fill the keyboard buffer before the machine posted. :)
@ELYESSS3 жыл бұрын
@@Spedley_2142 those beeps
@thizthizzydizzy3 жыл бұрын
@@ELYESSS Oh, that's what that was I always wondered why mashing the keyboard on startup made the computer beep
@nothingTVatYT3 жыл бұрын
These DOS multi-user games were fun, especially the ones that let you customize the controls. I once watched two friends, one used the insert, delete, home etc. and the other used the very left side with Alt and Ctrl. Guess what happened. :-)
@ChristieNel3 жыл бұрын
@@nothingTVatYT Haha! Yes. Buffer overflow.
@DaniilHomyak3 жыл бұрын
This part when Ben explains how NumPad numbers correspond with “E0” keys blew my mind! I just sat there thinking about how much work & engineering went into this small part of an input device like 30 years ago. And as Ben fully explained this to me (international relations & linguistics student, English being my second language) I felt shook to the core for some reason. Thank you, Ben Eater, for your great content & making it breathtaking at least for me!
@nagasaipurvaz42513 жыл бұрын
You know he is professional when he strip wires with finger nails
@BlackEpyon3 жыл бұрын
I used to use my teeth when I was a kid.
@nagasaipurvaz42513 жыл бұрын
@@BlackEpyon I use teeth now too
@stevensgarage64513 жыл бұрын
Never seen that before
@gen1573 жыл бұрын
@@BlackEpyon Can't use my teeth anymore for that. It feels weird. Metal on teeth is awful.
@watchableraven35173 жыл бұрын
@@nagasaipurvaz4251 Your own?
@widicamdotnet3 жыл бұрын
I just repaired my old AT Keyboard (DIN plug, electrically the same protocol) last week and I'm now using it again after 15 years. Thanks to this excellent demonstration and explanation I now think I understand a bit better what it's doing :-)
@Qfeys3 жыл бұрын
I would actually really be interested in seeing you build a circuit that puts the letters to asci, singles out the F-keys and maybe cause interrupts, and singles out the other special keys. Maybe if ctrl or alt is pressed that a key does not go to the letters register but to the commands register. Things like that would be really cool to see.
@mustafareason65713 жыл бұрын
One way of converting the 16 bit output to ascii is to use a 16 address line eprom, the output from the shift registers are connected to the address lines of the eprom, ascii comes out of the data lines. This converts the scan code “address” into an equivalent byte. It’s wasteful on space as most of the eprom is blank. This was how northgate (if anyone is old enough to remember their excellent keyboards) handled multi language keyboards. They used a larger eprom where the upper 4 address lines are linked to a dip switch that sets the appropriate language. A key cap puller was supplied to swap round the key cap. The scan codes are a direct result of the key matrix rows/columns. Some manufacturers use different matrix layouts and then added a converter to produce compatible scan codes.
@willofirony3 жыл бұрын
It is a gift to take a very dry subject and make it, not just interesting but awesome. Throw in a bunch of educated comments and its a tutorial. I love this channel.
@Ronenlahat3 жыл бұрын
This is one of the coolest videos I watched. You just kept pulling out circuit boards
@sensiblewheels3 жыл бұрын
32:33 yup, dedicated hardware to read and hold state for the keyboard! Great video on interfacing!
@N3tech3 жыл бұрын
My breadboards look like rotten spaghetti, while yours look like works of art.
@BlackEpyon3 жыл бұрын
I usually take a twist tie or spare piece of single-core wire, and tie the buses together. If possible, I'll also colour code them, such as green being data, blue being address, etc, but I don't use pre-formed jumpers except for power/ground, otherwise you keep needing to cut and form them, which slows things down.
@jozefbania3 жыл бұрын
You should play Factorio and make 10 rockets per launch using belts only that will teach you how to route anything. LOL.
@foty86793 жыл бұрын
@@jozefbania To be fair though. If i remember correctly he has pre bent cables
@sadhlife3 жыл бұрын
@@foty8679 pre-bent by himself :)
@Niosus3 жыл бұрын
Well, it could be worse. I just bought a house and decided to take a look at how the central heating boiler is wired to the thermostats. I mean, the boiler only has two wires as input. Short them, and it turns on. How bad could it be? Turns out it look like a bowl of spaghetti, with a bunch of unterminated brown wires sticking out. And if there is one thing I remember from that introductory course to home wiring in high school: "brown is the color your pants will be when you touch it". I promptly closed the box, and checked the batteries on the smoke alarm. I guess I'll figure this out in summer... Note to self, also buy a new CO alarm. That thing expired 3 years ago.
@watsoft703 жыл бұрын
Wow, my first visit and I'm "SUBSCRIBED". I'm pretty sure I just followed all of that and it's deffo not down to my ability...amazingly well presented!
@Mallyhubz3 жыл бұрын
Some of my favourite comedians have an odd parody bit.
@MyName-tb9oz3 жыл бұрын
Ouch.
@DanielLopez-up6os3 жыл бұрын
Wonderful Video, for something that ive used to years but didnt know how it worked.
@valshaped3 жыл бұрын
You could probably just pump the scan codes into an eeprom, and have it output ASCII (or some control codes), and maybe check for E0/F0 in hardware if you needed them
@PankajDoharey3 жыл бұрын
WoW you just taught us how to reverse engineer, fundamentally any signal from any device. I always had the same intuition but never tested my theory. Thanks for the amazing video.
@CandyGramForMongo_3 жыл бұрын
You’ve explained the “is my PC locked up?” test of toggling the CapsLock key! If the PC cannot “talk” to the keyboard to turn on/off the CapsLock light, it’s locked up. Thanks!
@deedewald17073 жыл бұрын
Fundamentally knowing & understanding those fundamentals !
@Handskemager3 жыл бұрын
How you don’t have more subscribers is beyond me, quality stuff with humor can’t be beat. Keep up the good work !
@petarstoyanov90243 жыл бұрын
Your channel should be mandatory learning for all human beings starting at age 12. Thank you very much, this was extremely valuable. Im building a firmware/driver combo almost from scratch for an open source periphery ecosystem and this is my first step on the electronic/software part of my project!
@BigMikeECV3 жыл бұрын
That was tremendous fun to watch. I understood what you were doing even though I haven't built any digital circuits since college in the early '80s.
@wChris_3 жыл бұрын
The 6522 has an integrated shift register with automatic IRQ dispatching! So my solution would be to have some logic to only shift in those 8 data bits into the VIA chip and write a small routine reads from the Shift Register. Additionally you can have use a bit on port B to indicate the status if the key was valid.
@MultiMidden3 жыл бұрын
Some 8-bit 6502 based computers used a 6522 for the keyboard. I know for a fact that BBC Micro series of computers used one and I should imagine others did as well.
@H3wastooshort3 жыл бұрын
bump
@canaDavid13 жыл бұрын
@@MultiMidden Yeah, but there the 6522 interfaced the keyboard matrix directly (through porta and portb), not throug a serial interface.
@CaptainDangeax3 жыл бұрын
@@canaDavid1 The 6526 if the C64 also did the same, a 8x8 matrix for keyboard using PA and PB
@steakanemon293 жыл бұрын
Hey I'm a student from Germany. I build this circuit for a project in school. It was my final project of my High School i guess, as you would say. Afterall it's a relatively big deal here in germany. I used you Circuit and plugged it into a custom pcb from my school and displayed the Keys pressed in a LCD Display. I wanned to thank you very much, because i got an A for my project. It wouldn't have been possible without your help. Thanks. Keep it up!
@mikolanimator3 жыл бұрын
Ben, thank you so much for your videos. They are awesome. You make an intimidating subject seem so simple. Thank you for all that you’re doing. Would love to see you sometime building a fully functional keyboard controller the same way you built the video card. I don’t know if it’s feasible. If not from discrete logic, (would be cool though), maybe built around an existing IO chip. Also would be great , at some point, to learn how to interface it with 6502 or a Breadboard project. Thank you again. You are amazing.
@mceajc3 жыл бұрын
I adore this content. Not only informative, but compellingly informative. The more I learn, the more I need to know!
@nohagad28933 жыл бұрын
This guy is truly amazing I hope one day he could explain sophesticated subjects such as DMA
@BertGrink3 жыл бұрын
I cannot speak for Ben, of course, but i do suspect that he will make a video about it in due course.
@Dynamic_Flyer3 жыл бұрын
Explaining complex stuff in a clear, easy to understand way. Brilliant!
@lexus4tw3 жыл бұрын
5V Black, Orange Ground, Red Data, totally obvious color choices :'D
@hermitoldguy63123 жыл бұрын
Red, orange and brown - or as we colour-blind folks say, brown, brown and brown.
@diydad77043 жыл бұрын
Same with my 3D printer that's a chinese original. Guess now we know where this cable comes from. "China's been treating us very unfair!" (D.J.T.) Like he ever knew the meaning of a cable color... LMAO
@lexus4tw3 жыл бұрын
@@diydad7704 in cheap products they use colors which are availabel, got an cat5 cabel once with 3 green/white pairs :D
@Rx7man3 жыл бұрын
@@lexus4tw were they connected properly???
@cojawfee3 жыл бұрын
I'm guessing that adapter was made from spare ribbon cable, and that's why Ben happened to have cables of the same color, because they are all next to each other on rainbow colored ribbon cables. Whatever factory that made that adapter probably assumed that no one would ever need to open it, so no need to have standardized colors, so they just the next four wires.
@shalombd6123 жыл бұрын
Ohhh i am in love with these channel
@DamianReloaded3 жыл бұрын
I love this. I've always wanted to have some insight into these kind of things. Outstanding content. Keep'em coming!
@mrnixie3 жыл бұрын
Absolutely magic how all the jumper wires are just the right length and shape! Musta taken a lot of practice builds. This is the clearest explanation of the PS2 interface that I have even seen. Well done
@erbro3 жыл бұрын
He actually has a video about how he makes the jumper wires. Definitely worth watching!
@devnol3 жыл бұрын
What if you didn't invert the latch clock and just fed it a falling edge clock, so that when it rises it would trigger the latch?
3 жыл бұрын
That's what I was thinking too. This is probably latching faster though, so you can use the falling edge clock to do some other processing of the latched data.
@burakyildiz89213 жыл бұрын
I always look the comments before writing what I think and most of the time one other guy already wrote exactly what I think. How is that possible? By the way, this time there are two.
@pv2b3 жыл бұрын
Or just use the clock from before the inverter
@Redrield3 жыл бұрын
@@pv2b Exactly what I was thinking while watching, you get a delay of half a clock cycle and it ends on a rising edge so the data is going to be latched by the end
@devnol3 жыл бұрын
@@burakyildiz8921 It's the power of collective thinking. ;)
@redsquirrelftw3 жыл бұрын
That was really neat. I don't know why but I kept jarring out every time you brought in another register. It was just so casual.
@WarrenGarabrandt3 жыл бұрын
I've been looking forward to this video. Thanks!
@delawarepilot3 жыл бұрын
(Looks at my breadboard) It may have been assembled by bird preparing for spring.
@haniyasu82363 жыл бұрын
11:45 omg he just fixed a timing problem by effectively adding a redstone repeater
@ornessarhithfaeron35763 жыл бұрын
Yup. Not exactly (then again, you said "effectively" so you know it yourself), but you're right. If you know the redstone trick with making a redstone clock without using repeaters (just redstone torches and redstone dust and any block), it's basically two of these things together. That type of redstone clock is basically several NOT-gates in series, the delay happening because of minecraft ticks. So what he did is put two NOT-gates in series. But yeah, you're pretty much right overall. That's more or less what he did.
@thizthizzydizzy3 жыл бұрын
The original repeaters (before repeaters existed) was just a couple of NOT gates (redstone torches) The repeater's recipe reflects this too :P
@lucaseastman18773 жыл бұрын
@@thizthizzydizzy That's like a little easter egg. That's cool.
@Scaramouche1223 жыл бұрын
Dog
@dioneto68553 жыл бұрын
when he said that wanted some delay i thought 'just connect to 2 inverters" not clearly with minecraft in mind but now i realize that minecraft may have influenced me to think that way
@ojcgv213 жыл бұрын
This is really cool man, I'm an electrical engineer and I never had this explanation as a student.
@meylaul50073 жыл бұрын
to people who try matching the oscilloscope-output to the lights: read the lights from right to left, while reading the oscilloscope from left to right. I recommend 17:51 for that. :) That may help with the occasional confusion as was the case for me. :D But great video!
@tomschmidt3813 жыл бұрын
Love seeing an old school IBM PS/2 keyboard. I'm typing these comments on one now. Have a couple of NOS in case this one ever dies. I've had to tough it out without the benefit of the Windows key. Back in the 1990s I was at NEC Tech and got drafted to write PC KBC (keyboard controller) code. At the time PCs used an Intel 8041 as the smart keyboard interface. This started with the IBM AT (Intel 286) and a second serial interface was added to it when mice became popular. The 8041 was basically an 8048 with the 8-bit bus interface. It was also responsible for managing the dreaded GateA20 feature and resetting the 286 from protected mode. Debugging was fun, no in circuit emulator but I had a nifty firmware emulator to sortofkindof get the code working. Then had to resort to breakpoints and writing to shared memory. Keyboards and mice use the same electrical interface and connector pinout. Most KBC firmware only knew how to process the device it expected on the specific port. Later there was some effort to improve the PS/2 interface to accept multiple devices but the popularity of USB killed that. I was not aware of trackballs using the two spare pins but that may have happened later. I'd hate to post of picture of what my breadboards look like.
@matthias75343 жыл бұрын
Ayo! That's what I needed! Thanks 😊 You explain everything in the way that no one does. Your videos are perfect!
@MarcelHuguenin3 жыл бұрын
Very informative and entertaining. Have never given it a thought how it would work but this makes a whole lot of sense. Thanks Ben!
@walthzer69103 жыл бұрын
When you think he reached a top with the VGA graphics card he comes up with this. Just magnificent.
@DouglasFish3 жыл бұрын
I've wanted to know how this works for the longest time but never thought of it again. Thank you Ben!
@joeo63783 жыл бұрын
“You can see i have about 8 of them here, as far as you know”. Lol. I like to imagine that there are more. Just keeps going. Able to keep track of hundreds of key presses will all the breadboards you have lined up.
@maxflentge3 жыл бұрын
Loved this video! Instant subscription!
@alxcuisine95753 жыл бұрын
The Printscreen sequence looks like a Macro for a Mortal Kombat Finisher / Fatality Combo 🤣🤣
@darkstatehk3 жыл бұрын
Love this channel. I could sit, watch and listen all day long.
@A11V1R153 жыл бұрын
When he talked about adding a delay, I tought about Minecraft's redstone repeater and then the solution was exact what one could do in Minecraft withou a repeater: invert the signal twice
@B-System3 жыл бұрын
Redstone engineering is entirely legit.
@Bill-Phuk3 жыл бұрын
PS2 to the old AT adaptor, took me right back to my days of starting to know computers when CPUs etc needed jumpers to set multipliers and voltages.
@zachbaker1083 жыл бұрын
I think a lot of us would find it very useful if you put a basic breadboard kit on your website as well. For example, it would contain a. Few breadboards, capacitors, resistors, wires, jumpers, buttons, LEDs, and maybe a 7 segment display or something cool, as well as some other components. It would give us a place to start, and the components could be used in any circuit we want to make.
@JosephDavies Жыл бұрын
Adafruit sells great little starter kits just like what you describe!
@modelrogers.193 жыл бұрын
I saw the title on this and before I had another thought I am here. Thank you Ben!
@minarashad5113 жыл бұрын
I had a feeling throughout the video that something will explode, after watching ElectroBoom for 2 hours.
@mandisaplaylist2 жыл бұрын
8:40 You don't actually want to "invert the clock" because on the falling edge the data signal is changing and thus you may get into timing issues. On the rising edge of the clock the data signal is stable so that is when you want to pick up the bit. I believe that this was done exactly to ease interfacing these keyboards with this type of shift register. On the other hand you want to trigger the latch with the inverted clock so you don't try to latch stuff while the chip is shifting (and getting something like "half-shifted data").
@eternaldoorman52283 жыл бұрын
Lots of IBM development history there! Those ps/2 keyboards had a great feel though.
@Rx7man3 жыл бұрын
lasted forever, as well as the silk screening on the keys lasted too.. I have a 2 year old logitech and I've worn through all the silk screen and I'm working my way down the plastic (especially on the backspace key :P)
@robegatt3 жыл бұрын
Heavy duty stuff!
@electronicengineer3 жыл бұрын
They were great. I even still have one somewhere, because I found it, personally, to be a "gold standard" for keyboard input devices. Fred
@SteveJones172pilot3 жыл бұрын
I know.. I was jealous of the ownership of the keyboard itself!! :-)
@233kosta3 жыл бұрын
@@Rx7man The key caps are dye sublimed, the dye is actually embedded into the plastic. They're also made of PBT so they don't yellow over time.
@AhmedHan3 жыл бұрын
Thank you for your efforts for teaching us this topic.
@gork423 жыл бұрын
If you want to interface with a 6502 you’d traditionally use a 6522 or 6526. You could do it from scratch too but you’d have to build a counter and some error logic to fix your latch and add a buffer.
@UTRG-UnderTheRain3 жыл бұрын
As always with your videos this is a great tutorial
@sensibleb3 жыл бұрын
I can't believe I didn't know how to convert 8-bit hex to binary by splitting it into two 4-bit chunks. That's so simple!
@okuno543 жыл бұрын
It's why hex became so popular actually! If you read up on older computers, you'll find that octal was also quite popular for a while, because 9-, 12-, 24-, and 36-bit machines were fairly common (all of which have word sizes that break apart easily into three bits). Now that industry has standardized on 8-bit bytes, it's a little strange to see every programming language that support octal number literal, but they're there as legacy.
@SimonBuchanNz3 жыл бұрын
@@okuno54 partially because of posix permission bits, which you might still consider legacy 😋 But honestly it's so easy and safe to add them if you already have other base number forms you basically need a reason not to.
@scififan6983 жыл бұрын
Youngsters ;-)
@Kitulous3 жыл бұрын
that's what we call "tetrady" (tetrads?) in Russian, from the word "tetra"-four (in greek) upd: yeah, you can call that a nibble, but who really uses nibbles in 21st century
@BlackEpyon3 жыл бұрын
When my brain isn't working, I like to use the little calculator built into Windows for it's "programming" mode.
@Claudiu.3 жыл бұрын
So dramatic and surprising to see how many boards you had prepared. Very well explained and educational as usual. Initially I was thinking that you would delay the shift cycle with a capacitor, but that would probably take way longer than the small delay you made with the double invertors. Excited to see your next ones. Thank you!
@aaronjamt3 жыл бұрын
11:45 couldn't you just hook the non-inverted clock to the latch clock? That would trigger it on the rising edge of the keyboard clock/falling edge of the shift register clock.
@kiefac3 жыл бұрын
I don't have any sources for this, but I'd imagine the shift register chip doesn't like having its latch clock turned on indefinitely. Might heat up a transistor or smth
@teslakovalaborator3 жыл бұрын
Sure, I had a same thought. I is more reliable than relying on propagation delay. Only problem that comes to mind are power spikes, but they won't disrupt the circuit, because data has been already latched.
@teslakovalaborator3 жыл бұрын
@@kiefac No, you have to distinguish enable from clock. Enable is active, as long as it receives an active state. Clock on the other hand is active only at the rising edge of its input. Sequential logic is immune to static states on their clock pins, so that won't hurt anything
@kiefac3 жыл бұрын
@@teslakovalaborator I wasn't referring to errors in logic, but more that the actual transistors used on that part of the silicon might not tolerate having power sent to them all the time. I don't know much about the actual circuits used in ICs though, so there's probably something I don't understand, like maybe the rising edge circuitry essentially cuts off power once it goes high? (Also, I suppose the latch outputs are designed to be left on for any length of time, and they would probably use the same one or two transistors throughout the whole chip?)
@n2n8sda3 жыл бұрын
No.
@PureAudioTones3 жыл бұрын
I am so excited when I see a new video from Ben. I guess I'm not alone.
@tripiecz3 жыл бұрын
You could perhaps use a RS-232 to TTL convertor and connect an old computer terminal like the DEC VT100 to the breadboard computer. Then you'll need no keyboard interface and no video card and you'll see why terminals used to be so popular when these ICs were still expensive.
@brencostigan3 жыл бұрын
Correct, and that is why I still have mine - the wife always complains about lugging the DEC VT320 with us when we’ve moved house. I’m never parting with it. Plus the orange text is beautiful.
@clownhands3 жыл бұрын
This was the most satisfying thing I’ve watched today. Thank you!
@tyisafk3 жыл бұрын
Me, a nail biter, seeing someone strip wires by hand: Pure sorcery.
@blueskyredkite3 жыл бұрын
Fascinating, as always. Thank you.
@HisVirusness3 жыл бұрын
When this computer is completed, it's going to be the size of a refrigerator. We have indeed come full-circle.
@ville_syrjala3 жыл бұрын
Nah, his next project will probably involve vacuum tubes and hand woven core memory. And it will fill up his garage.
@BetweenTheBorders3 жыл бұрын
@@ville_syrjala Great, now I expect his I/O to be punch cards.
@renakunisaki3 жыл бұрын
Check out my new computer, it's literally a room full of people computing.
@dentakuweb3 жыл бұрын
That was the best video I've seen in a while. You put a lot of thought into it and it was very clear and informative.