Author Topic: PS2 keyboard controller  (Read 2583 times)

0 Members and 1 Guest are viewing this topic.

Offline cowasakiTopic starter

  • Frequent Contributor
  • **
  • Posts: 605
  • Country: gb
PS2 keyboard controller
« on: May 10, 2019, 08:58:42 pm »
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! 
« Last Edit: May 10, 2019, 09:05:20 pm by cowasaki »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: pl
Re: PS2 keyboard controller
« Reply #1 on: May 10, 2019, 10:41:55 pm »
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.
 

Offline cowasakiTopic starter

  • Frequent Contributor
  • **
  • Posts: 605
  • Country: gb
Re: PS2 keyboard controller
« Reply #2 on: May 10, 2019, 11:57:49 pm »
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.
« Last Edit: May 10, 2019, 11:59:34 pm by cowasaki »
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8526
Re: PS2 keyboard controller
« Reply #3 on: May 11, 2019, 12:04:15 am »
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.
 

Offline cowasakiTopic starter

  • Frequent Contributor
  • **
  • Posts: 605
  • Country: gb
Re: PS2 keyboard controller
« Reply #4 on: May 11, 2019, 12:05:30 am »
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.

Arrr yes, good idea I shall have a look.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5170
  • Country: ro
  • .
Re: PS2 keyboard controller
« Reply #5 on: May 11, 2019, 12:22:43 am »
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 buttons

ex. Microchip SAM D21 ... ARM® Cortex®-M0+ SAM D21E Microcontroller IC 32-Bit 48MHz 32KB (32K x 8) FLASH 32-TQFP (7x7)  : https://www.digikey.com/product-detail/en/microchip-technology/ATSAMD21E15B-AFT/1611-ATSAMD21E15B-AFTCT-ND/6832773
1$ for a 32bit micro with USB and up to 26 io

or for something simpler to program and cheap if you're thinking one offs, PIC18F24K50-I/SP (dip 28pin) or PIC18F45K50-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-keyboard
https://www.robomart.com/blog/pc-keyboard-decoder-using-pic-microcontrollers/

also
AVR313: Interfacing a PC AT Keyboard on tinyAVR and megaAVR devices  - pdf and source code for AVR, could be easily converted to PICs
https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en591263

« Last Edit: May 11, 2019, 12:27:56 am by mariush »
 

Offline cowasakiTopic starter

  • Frequent Contributor
  • **
  • Posts: 605
  • Country: gb
Re: PS2 keyboard controller
« Reply #6 on: May 11, 2019, 12:29:39 am »
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 buttons

ex. Microchip SAM D21 ... ARM® Cortex®-M0+ SAM D21E Microcontroller IC 32-Bit 48MHz 32KB (32K x 8) FLASH 32-TQFP (7x7)  : https://www.digikey.com/product-detail/en/microchip-technology/ATSAMD21E15B-AFT/1611-ATSAMD21E15B-AFTCT-ND/6832773
1$ for a 32bit micro with USB and up to 26 io

or for something simpler to program and cheap if you're thinking one offs, PIC18F24K50-I/SP (dip 28pin) or PIC18F45K50-I/P-ND (dip, 40pin) would be good solutions (high frequency and contain usb and can run usb using internal oscillator etc etc)

The 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.
 

Offline DaJMasta

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: us
    • medpants.com
Re: PS2 keyboard controller
« Reply #7 on: May 11, 2019, 12:58:59 am »
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 here  https://github.com/TaranVH/2nd-keyboard/tree/master/Intercept
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3688
  • Country: us
Re: PS2 keyboard controller
« Reply #8 on: May 11, 2019, 01:31:56 am »
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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8526
Re: PS2 keyboard controller
« Reply #9 on: May 11, 2019, 01:44:16 am »
The controller chip is almost certainly an 8048 derivative, going by the "8C48" in the marking.
I 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.)
 

Offline cowasakiTopic starter

  • Frequent Contributor
  • **
  • Posts: 605
  • Country: gb
Re: PS2 keyboard controller
« Reply #10 on: May 11, 2019, 08:10:03 am »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf