PS2 keyboard controller - Page 1
Forum section: electronics / projects

author: cowasaki
author_rank: Frequent Contributor
timestamp: May 10, 2019, 08:58:42 pm
content: I have this IC from an old Compaq keyboard. I need to use it to make a controller for about 40 buttons for a computer game. I can't find a data sheet and can't be sure I have the IC type number. All I need is the be able to identify the rows and columns.I have actually got two new Holtek keyboard controllers but I was trying to be lazy as this board is basically already made!

author: magic
author_rank: Super Contributor
timestamp: May 10, 2019, 10:41:55 pm
content: Many old PS/2 keyboards simply contain some general purpose MCU running proprietary firmware with no public documentation.If that's the case, you can only try to short various contacts and see what characters are generated.

author: cowasaki
author_rank: Frequent Contributor
timestamp: May 10, 2019, 11:57:49 pm
content: To be honest that will end up being my first option... I was just hoping someone recognised the IC. I do have a couple of Holtek HT82K629A-40DIPLF ICs I bought which are a dedicated USB/PS2 controller but I would have to build a PCB for it some thought that it would save some time if I could just use this from an old keyboard.

author: amyk
author_rank: Super Contributor
timestamp: May 11, 2019, 12:04:15 am
content: The routing of the traces and the fact that a quick Google for the part number shows images of it being used on other keyboards suggests that this is at least a semi-standard part, as otherwise they would be routed in a far more straightforward fashion.If you power it on and probe the pins you should be able to see the periodic scanning pulses on the outputs; what's left will then theoretically be the inputs.The images I mentioned above may also be helpful in determining which pins do what.

author: cowasaki
author_rank: Frequent Contributor
timestamp: May 11, 2019, 12:05:30 am
content: Quote from: amyk on May 11, 2019, 12:04:15 amArrr yes, good idea I shall have a look.

author: mariush
author_rank: Super Contributor
timestamp: May 11, 2019, 12:22:43 am
content: 40 buttons is not a large amount.There are 8 bit microcontrollers with 48 pins or more, so you could have one IO pin for each button, or you can go with 32bit ARM micros to keep things simple.Alternatively, you could simply use one 8 bit shift register for each group of 8 buttons... so 5 shift registers on the back of the circuit board.Or you can multiplex buttons, arrange them in rows and columns and power one column at a time to see which buttons in the column are pressed ... with a 1:3 multiplexing you'd only need 3+16 io pins to read 3x16= 48 buttonsex. Microchip SAM D21 ... ARM® Cortex®-M0+ SAM D21E Microcontroller IC 32-Bit 48MHz 32KB (32K xFLASH 32-TQFP (7x7) :https://www.digikey.com/product-detail/en/microchip-technology/ATSAMD21E15B-AFT/1611-ATSAMD21E15B-AFTCT-ND/68327731$ for a 32bit micro with USB and up to 26 ioor for something simpler to program and cheap if you're thinking one offs,PIC18F24K50-I/SP(dip 28pin) orPIC18F45K50-I/P-ND(dip, 40pin) would be good solutions (high frequency and contain usb and can run usb using internal oscillator etc etc)There's application notes or online tutorials showing how to do ps/2 keyboards with PIC micros... here's some links:https://www.t3ch.it/?q=pic18-connecting-ps2-keyboardhttps://www.robomart.com/blog/pc-keyboard-decoder-using-pic-microcontrollers/alsoAVR313: Interfacing a PC AT Keyboard on tinyAVR and megaAVR devices - pdf and source code for AVR, could be easily converted to PICshttps://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en591263

author: cowasaki
author_rank: Frequent Contributor
timestamp: May 11, 2019, 12:29:39 am
content: Quote from: mariush on May 11, 2019, 12:22:43 amThe Holtek IC gives 100+ keys and is USB/PS2 compatible. The thing I am creating is an input device for a computer. The software will accept keyboard or game controller inputs for any of the functions so adding a keyboard controller and linking 30-40 buttons to strange buttons on the controller not normally seen on a standard keyboard but otherwise acceptable would be perfect. IE f13, f14, f15 and other stuff. If I create my own circuit I would then have to write PS2 serial data out or get it to act as a USB device in order for Windows to accept it. The idea of using this IC temporarily is that I can get it all working with that then sit down with KiCAD and design the PCB and get it printed.

author: DaJMasta
author_rank: Super Contributor
timestamp: May 11, 2019, 12:58:59 am
content: If you have the keyboard itself, its layout can give you an idea of the sort of multiplexing the controller is looking for, but there could be a simple way to do this for a one-off before you design a device from scratch.Just hook up your buttons in literally any configuration. Then you can use software to remap whatever buttons those map to to the ones you want to use. There are some free key remappers that can target a specific keyboard (rather than remapping all of them) that use software called "interception". I've only done it with USB devices, there's a chance PS/2 is handled differently by the OS (and may actually be mapped in a way that would not overlap with a USB keyboard), the version I used was Interception with Intercept.exe (a different software that uses Interception as a base), found herehttps://github.com/TaranVH/2nd-keyboard/tree/master/Intercept

author: helius
author_rank: Super Contributor
timestamp: May 11, 2019, 01:31:56 am
content: NMB is a trade name of MinebaMitsumi Corp, which also makes ball bearings and firearms. They are one of the large keyboard OEMs, sometimes using their own mechanical switches.The controller chip is almost certainly an 8048 derivative, going by the "8C48" in the marking. It was made in 1999, but from the look of the board it is a PS/2 device, not USB.

author: amyk
author_rank: Super Contributor
timestamp: May 11, 2019, 01:44:16 am
content: Quote from: helius on May 11, 2019, 01:31:56 amI thought that too at first, but a quick glance at the backside photo shows that the pinout is not even close --- the power pins appear to be in the middle of the package, while the '48 family and related ones have them on diagonal corners. This one has I/O pins on all 4 corners (might be enough of a hint for someone to recognise the MCU family.)

author: cowasaki
author_rank: Frequent Contributor
timestamp: May 11, 2019, 08:10:03 am
content: Unfortunately I don't have the rest of the keyboard, just this part. This is a PS2 device, either will suffice for the task in hand. I will look at the 8048 Thanks.