6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Apr 28, 2024 9:03 pm

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Aug 04, 2010 12:31 pm 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 04, 2010 5:57 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
I had to get one! It was only $4US dollars, and I've been looking into interfacing a PS2 keyboard with my PWA project. 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...

Thanks for posting that Chuck!

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 05, 2010 4:36 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8151
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Aug 05, 2010 5:23 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
Quote:
How the devil are you supposed to type on something that small? You guys have any idea how big my front feet are?


It does look like the width of the keys would have to be slightly sub-standard. The keyboard on my HP-71 handheld computer shown below is about 60% of standard size, and I was able to type on it at about 30wpm, almost 60% of what I can do on a full-sized keyboard. My fingers are pretty slim though.

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.

Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Aug 05, 2010 1:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1681
Location: Sacramento, CA
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...


It's a little more complicated than that. However, it can be done.

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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 05, 2010 1:31 pm 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
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?


I used my thumbs to type on my LG env3 cell phone before it got ran over by a car. They're functional and a small child might be able to type on one of them but if you were to price a keyboard for a PDA or Xbox 360 then the price goes way up. This is a bargain.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 06, 2010 1:27 am 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, 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

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Aug 06, 2010 2:51 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1681
Location: Sacramento, CA
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 11, 2010 8:49 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, 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


I've not had time to research, but do all the ATTiny series have common opcodes? Can I use the same driver or would I have to experiment?

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?

Image

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 11, 2010 9:55 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1681
Location: Sacramento, CA
If I recall correctly, they all share a common opcode list. However, the onboard resources will be different. My quick look at the ATTiny24 led me to think you should be able to use my ATTiny26 code as-is.

If you end up with errors, let me know I I can help you work throught them.

Daryl


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 09, 2012 2:18 pm 
Offline
User avatar

Joined: Sat Dec 01, 2012 10:31 pm
Posts: 16
Location: England.
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 :)

_________________
Also on Twitter as "YT2095".


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 09, 2012 4:32 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
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...

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 09, 2012 5:14 pm 
Offline
User avatar

Joined: Mon Aug 08, 2011 2:48 pm
Posts: 808
Location: Croatia
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.


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 09, 2012 6:00 pm 
Offline
User avatar

Joined: Sat Dec 01, 2012 10:31 pm
Posts: 16
Location: England.
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" :wink:

_________________
Also on Twitter as "YT2095".


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 09, 2012 6:48 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
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...

It is a pass thru type and I ohmed out the adapter I have. The pin numbers for PS2 and the USB are referenced to wikipedia, although they were mirrored in my case. I think I have it right:

Code:
   USB        PS2
 1 (5V)      4 (5V)
 2 (D-)      1 (+data)
 3 (D+)      5 (+clk)
 4 (GND)     3 (GND)

_________________
65Org16:https://github.com/ElEctric-EyE/verilog-6502


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: