Mini keyboard PS2 and USB
Mini keyboard PS2 and USB
http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... 0528390857
This is a cheap keyboard for those of you who want something small for the 6502.
This is a cheap keyboard for those of you who want something small for the 6502.
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Mini keyboard PS2 and USB
How the devil are you supposed to type on something that small? You guys have any idea how big my front feet are?
x86? We ain't got no x86. We don't NEED no stinking x86!
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
How the devil are you supposed to type on something that small? You guys have any idea how big my front feet are?
I typed a lot of notes in meetings, typed memos, letters, etc.. I decided I better quit typing on it so much when they discontinued it. I figured that if I ever wore it out, that's it baby.


ElEctric_EyE wrote:
Doesn't seem too difficult, maybe a serial to parallel converter and a couple logic gates, then a lookup table to match data to ascii...
Both Lee Davison and I have published code to decode a PS2 keyboard. I have two versions, one uses two ports of a 6522 and the 6502 to convert the codes and the other uses an AVR to do the processing.
Mine are here:
http://sbc.rictor.org/io/pckb6522.html
http://sbc.rictor.org/io/pckbavr.html
and Lee's is here:
http://members.multimania.co.uk/leeedav ... index.html
Hope this helps. Please let us know how that keyboard works out. I might invest in one too!
Daryl
Re: Mini keyboard PS2 and USB
BigDumbDinosaur wrote:
How the devil are you supposed to type on something that small? You guys have any idea how big my front feet are?
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
Daryl,
I haven't looked into Lee's interface yet, but I have checked yours out. It looks awesomely simple using 1 20 pin AVR ATTiny 26, but my programmer doesn't do those. Seems to only handle the 14 pin AVR's. Could an ATTiny 24, or 44 be made to work?
This website: http://www.beyondlogic.org/keyboard/keybrd.htm ,explains the basic protocols half way down...
I was thinking along the lines of a serial to parallel shift register, but I would rather not spend time developing it if I don't have to...
Thanks for your help,
EE
I haven't looked into Lee's interface yet, but I have checked yours out. It looks awesomely simple using 1 20 pin AVR ATTiny 26, but my programmer doesn't do those. Seems to only handle the 14 pin AVR's. Could an ATTiny 24, or 44 be made to work?
This website: http://www.beyondlogic.org/keyboard/keybrd.htm ,explains the basic protocols half way down...
I was thinking along the lines of a serial to parallel shift register, but I would rather not spend time developing it if I don't have to...
Thanks for your help,
EE
Yes, the ATtiny24 should work and it had just enough I/O ( 2 for keyboard, 8 for the data bus, and two for handshaking). You will need to buffer the data - either through a 6522 or 74 series buffer.
The AtTiny26 code uses 778 bytes of flash and only uses RAM for subroutine return-address stack storage. (it uses the registers for data storage).
I have the decoder running in an ATM8 on my SBC-3 and it's pulling double duty by also providing an RS-232 channel as well. It is accessed via the 65SPI controller.
Daryl
The AtTiny26 code uses 778 bytes of flash and only uses RAM for subroutine return-address stack storage. (it uses the registers for data storage).
I have the decoder running in an ATM8 on my SBC-3 and it's pulling double duty by also providing an RS-232 channel as well. It is accessed via the 65SPI controller.
Daryl
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
8BIT wrote:
Yes, the ATtiny24 should work and it had just enough I/O ( 2 for keyboard, 8 for the data bus, and two for handshaking)...
Daryl
Daryl
Got the keyboard in today, so I thought I'd share. It's not as small as the ebay link made it out to be.
Nothing works yet but it looks cool, eh?

Re: Mini keyboard PS2 and USB
if you don`t mind me asking, I`m curious as to Why your using the PS2/USB adapter and not just plugging it in directly to a USB socket?
very few of these adpters are Active devices and are merely pass-through, with D+/D- going directly to Clk and Data, GND/+5V remain the same.
a simple beep test with a continuity meter will confirn this easily, and removes the bulky sticky-outy thing with one less segway for error.
also, if anyone`s interested I`ll post the source code I use on NINA-6502 for the USB keyboard interface that uses a PIC Chip, then there`ll be 3 ways to do it
very few of these adpters are Active devices and are merely pass-through, with D+/D- going directly to Clk and Data, GND/+5V remain the same.
a simple beep test with a continuity meter will confirn this easily, and removes the bulky sticky-outy thing with one less segway for error.
also, if anyone`s interested I`ll post the source code I use on NINA-6502 for the USB keyboard interface that uses a PIC Chip, then there`ll be 3 ways to do it
Also on Twitter as "YT2095".
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
Re: Mini keyboard PS2 and USB
Wow, this was a long time ago...
And thanks for your offer!
What I wound up doing for the PS2 interface was to use a controller core from opencores.org and put it in the FPGA.
Regarding interfacing a project to a PC through USB, several of us have used ICs, that come with free drivers for Windows. I'm sure they have Linux by now...
And thanks for your offer!
What I wound up doing for the PS2 interface was to use a controller core from opencores.org and put it in the FPGA.
Regarding interfacing a project to a PC through USB, several of us have used ICs, that come with free drivers for Windows. I'm sure they have Linux by now...
Re: Mini keyboard PS2 and USB
I have a USB keyboard for my SBC, and i have to use the green USB to PS/2 adapter. PS/2 is simple, and mouse as well.
Re: Mini keyboard PS2 and USB
yeah, SBC to PC is pretty easy with the FTDI chips (about £2 on ebay), or even the PIC 18f22k50, 18f2550/4550.
the s/ware I did was the other way around, where it parses a USB Keyboards data into Parallel and Serial output for the SBC to use.
as for the green adapters I`v no idea if they`re different at all, but it would be worth checking with a continuity tester to see if it is just a simple pass-through type.
on the off chance that it May help someone in the future doing a search for such a thing, my code is here:
;Chip Settings
#chip 18F4685,20
#config OSC=HS, PWRT=ON, WDT=OFF
;Defines (Constants)
#define PS2Clock PORTB.1 'to D+ on USB socket
#define PS2Data PORTB.0 'to D- on USB socket
#define SerOutPort PORTB.7
#define SendAHigh Set SerOutPort Off
#define SendALow Set SerOutPort On
dir portc out
DIR PS2Clock IN
DIR PS2Data IN
Dir SerOutPort Out
InitSer 1, r9600, 1 + WaitForStart, 8, 1, None, Invert
Main:
KeyIn = INKEY
if KeyIn = 0 then
goto Main
end if
portc = KeyIn
SerSend 1, KeyIn
wait 1 ms
goto Main
all you need is to download GCBasic (it`s free and quite small), hook up a PIC 18F4685 with a 20MHz crystal to a PicKit2 and go to `Compile an download with PicKit2` in the pulldown menu and it`s done!
this will do both USB and/or PS2 directly with or without the use of adapters.
it hardly even deserves to be called "Code"
the s/ware I did was the other way around, where it parses a USB Keyboards data into Parallel and Serial output for the SBC to use.
as for the green adapters I`v no idea if they`re different at all, but it would be worth checking with a continuity tester to see if it is just a simple pass-through type.
on the off chance that it May help someone in the future doing a search for such a thing, my code is here:
;Chip Settings
#chip 18F4685,20
#config OSC=HS, PWRT=ON, WDT=OFF
;Defines (Constants)
#define PS2Clock PORTB.1 'to D+ on USB socket
#define PS2Data PORTB.0 'to D- on USB socket
#define SerOutPort PORTB.7
#define SendAHigh Set SerOutPort Off
#define SendALow Set SerOutPort On
dir portc out
DIR PS2Clock IN
DIR PS2Data IN
Dir SerOutPort Out
InitSer 1, r9600, 1 + WaitForStart, 8, 1, None, Invert
Main:
KeyIn = INKEY
if KeyIn = 0 then
goto Main
end if
portc = KeyIn
SerSend 1, KeyIn
wait 1 ms
goto Main
all you need is to download GCBasic (it`s free and quite small), hook up a PIC 18F4685 with a 20MHz crystal to a PicKit2 and go to `Compile an download with PicKit2` in the pulldown menu and it`s done!
this will do both USB and/or PS2 directly with or without the use of adapters.
it hardly even deserves to be called "Code"
Also on Twitter as "YT2095".
-
ElEctric_EyE
- Posts: 3260
- Joined: 02 Mar 2009
- Location: OH, USA
Re: Mini keyboard PS2 and USB
YT2095 wrote:
...as for the green adapters I`v no idea if they`re different at all, but it would be worth checking with a continuity tester to see if it is just a simple pass-through type...
Code: Select all
USB PS2
1 (5V) 4 (5V)
2 (D-) 1 (+data)
3 (D+) 5 (+clk)
4 (GND) 3 (GND)