Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:52 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PS2 keyboard chip, more inputs?

Author Message
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 04:09am 13 Mar 2012
Copy link to clipboard 
Print this post

Just thinking out loud. The 'mite has a PS2 keyboard interface. A PS2 keyboard has like 100 keys. Thats 100 digital inputs, accessible with the INKEY$ command.

Is there a PS2 encoding chip, that can take switch or digital inputs and send out PS2 serial data, for connection to a Maximite.

It would give us a lot of extra digital on/off inputs, say for monitoring, etc, and means we still have the 20 odd 'mite pins to control and sense analogue, duration, etc.

One application would be a custom built ( and compact ) keyboard, with say 12 keys, instead of a full sized keyboard.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 04:37am 13 Mar 2012
Copy link to clipboard 
Print this post

Like this


KeyPad

We could rip this apart and see how's it is done.
I assume the keys will be in a matrix

John
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 05:48am 13 Mar 2012
Copy link to clipboard 
Print this post

Yeah sort of. Thats a neat little keyboard, but I'm more after the chip itself. Chances are the chip in that keyboard is under a blob of black epoxy unfortunately.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 06:04am 13 Mar 2012
Copy link to clipboard 
Print this post

The original PC / AT /PS2 Keyboards were a simple matrix of keys & an Intel single-chip 8048 microcontroller. Nothing complex, the same could be done today using a simple Pic or similar micro-controller.
Edited by djuqa 2012-03-14
VK4MU MicroController Units

 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 07:54am 13 Mar 2012
Copy link to clipboard 
Print this post

Just a thought we can use 1 analogue pin and a resistor ladder





John
 
Hneo2au
Newbie

Joined: 03/03/2012
Location: Australia
Posts: 5
Posted: 08:54am 13 Mar 2012
Copy link to clipboard 
Print this post

Do a search for Ultimarc I-pac2 keyboard encoders.
They have a interface that emulates a keyboard from contact inputs.
A bit pricey though.
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 12:43pm 13 Mar 2012
Copy link to clipboard 
Print this post

Hi ,

long time ago (2009)i do a little project to read a USB/PS2 keyboard and send the
ASCII code as serial.
It just use a simple little Pic 16F688
The header file is prepared for 3 different keyboard layout , actually it
was just the German layout active , The US and FR layout are just a copy/paste
from the German one. You then just have to put the right code under this sections
to be able to use the US and FR layout.
Read the comments at start from the *.c file to know how to use the other layout.

Here the Schematic :




2012-03-13_224251_16F688_USB_Keyboard_Decoder_schematic.zip

and the source code made with CCS C PIC compiler.
2012-03-13_223718_Keyboard_16F688.zip

I no more have this circuit at home for made the US and FR or other layout.
I hope it can help
This circuit is so small that you can directly integrate it into a KB and send
the serial data tough the PS2 cable

Cheer.

Edited by darthmite 2012-03-15
Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 08:34pm 13 Mar 2012
Copy link to clipboard 
Print this post

Tests must be done to see how fast you can switch without loosing the count. How fast is that chip? Is doing a multiplexing?
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 09:11pm 13 Mar 2012
Copy link to clipboard 
Print this post

Another approach if you want more signal lines is to use the Remote 8-bit I/O expander for I2C bus - PCF8574. You can put 8 of these on an I2C bus and each has 8 "quasi-directional I/O ports". To run them you also need a digital input for the chip(s) to notify the processor there is inbound data.
2012-03-14_070625_PCF8574_data_sheet.pdf

There is also version called PCF8574A which can have 16 chips on the bus but it seems to use an extra address bit which, I think, will prevent its use with the MM.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 02:59am 14 Mar 2012
Copy link to clipboard 
Print this post

How about these,

MC74HC595A
8-Bit Serial-Input/Serial or
Parallel-Output Shift
Register with Latched
3-State Outputs

http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf

They use serial SPI out, not I2C but they're also cascadable. No input, just output but if that's what you want. Sparkfun even have a tutorial on them:

http://www.sparkfun.com/products/10680

GregEdited by paceman 2012-03-15
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 07:21am 14 Mar 2012
Copy link to clipboard 
Print this post

  Gizmo said   Just thinking out loud. The 'mite has a PS2 keyboard interface. A PS2 keyboard has like 100 keys. Thats 100 digital inputs, accessible with the INKEY$ command.

One application would be a custom built ( and compact ) keyboard, with say 12 keys, instead of a full sized keyboard.

Glenn

This is something I did many years ago.
I started with an old keyboard that had crook keys, put the hacksaw through the board and kept the electronics.
The keys are multiplexed so you need switches or relays to get the inputs.
I am currently doing things in reverse.
I have a USB keyboard being fed from a maximite (the electronics are bigger than the maximite). This keyboard is in a laptop and the key press is needed to wake a program up.
The maximite operates a reed relay which operates the 'space' key on the laptop.
Working out which wires go to which key is the hard part.

Jim
VK7JH
MMedit   MMBasic Help
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 09:40am 14 Mar 2012
Copy link to clipboard 
Print this post

  TassyJim said  
I am currently doing things in reverse.
I have a USB keyboard being fed from a maximite (the electronics are bigger than the maximite). This keyboard is in a laptop and the key press is needed to wake a program up.
The maximite operates a reed relay which operates the 'space' key on the laptop.
Working out which wires go to which key is the hard part.

Jim


Hi Jim,

I used an 18F2550 (my FreeJALduino board) with Jalv2 language and USB keyboard library to simulate a second USB keyboard, actually firing a train of [Space key] codes, needed in a game which I played with my daughter. It had also a switch (an input to microcontroller), for On/Off the output. This helped me to protect my keyboard .

It is very easy to setup and program if you are accustomed with PIC 18F programming. The Jal language is very easy and intuitive if you programmed before in Pascal or Verilog...

It would be great if Maximite could allow the software upload form a serial interface (using also FTDI) and letting USB setup for the users (or different versions of the firmware). But you can't do everything from an interpreter. Sooner or later you must go to real programming (mikroElektronika have mikroBasic for PIC32). Anyway, PIC32 for just that is definitely an overkill.Edited by vasi 2012-03-15
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 09:57am 14 Mar 2012
Copy link to clipboard 
Print this post

  vasi said   Tests must be done to see how fast you can switch without loosing the count. How fast is that chip? Is doing a multiplexing?


The 16F688 is 8Mhz , the serial is set to 9600 baud , when i have use it i don't
have loose any chars i pressed on the KB.
You will see in the source that the PIC only wait and translate the keyboard scan-code.
I don't have use interrupt , it's a pure bit banging system because every KB don't
send the bits at the same speed.
And about how fast it was , you can consider that it was exactly the speed of the KB

Cheers.

Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 10:33am 14 Mar 2012
Copy link to clipboard 
Print this post

  darthmite said  
  vasi said   Tests must be done to see how fast you can switch without loosing the count. How fast is that chip? Is doing a multiplexing?


The 16F688 is 8Mhz , the serial is set to 9600 baud , when i have use it i don't
have loose any chars i pressed on the KB.
You will see in the source that the PIC only wait and translate the keyboard scan-code.
I don't have use interrupt , it's a pure bit banging system because every KB don't
send the bits at the same speed.
And about how fast it was , you can consider that it was exactly the speed of the KB

Cheers.


Hi, I mean the keyboard chip Glenn pointed.
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024