Keyboard Solution, UzePS2, or what have you

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Keyboard Solution, UzePS2, or what have you

Post by D3thAdd3r »

uze6666 wrote:Repeat works on my little Uzebox keyboard but it is suppressed in uzem by SDL. Your PS/2 doesn't repeat?
It works on the hardware perfectly, just verified, for some reason I thought I had tried it and it didn't..bad memory sometimes. Forgot SDL doesn't send the repeated SDL_KEY_DOWN(or whatever it is) message for typematics by default. If interested in more accurate emulation you should be able to do a:

Code: Select all

SDL_EnableKeyRepeat(int delay, int interval);
//best to use (SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL);
I don't think it matters, but I think fully emulating it is easy like that if it doesn't affect something else.
uze6666 wrote:For maximum flexibility, the firmware returns what it receives from the keyboard as-is, so that's keys codes and break codes too. So yes, you could do a 'WSAD' game since the uzebox receives everything.
That seems the smartest way to go about it, I haven't had much change to actually try using it in a program yet but I think there might be a critical feature needing to be added. Is there a way the host could send the adapter raw PS/2 commands? What I mean is, how could I send the keyboard the bytes "0xED,0b00000111" which is the command to set the scroll,caps,num LEDs all to on? I agree most everything should be the host responsibility including that.
uze6666 wrote:But I don't think there's a way to stop it completely with scan code set 2.
Oh you are right, my document says it has to be set 3 to do that stuff. I wonder how commonly supported set 3 is in old keyboards.
uze6666 wrote:Btw, in your ps/2 dongle, did you keep a way to reflash the attiny?
Yep, I stole a socket pin from another controller and put it in one of the N/C pins hooked to reset on attiny so everything was broken out. I use Arduino to power the attiny through controller +pin, then just jumper wires into the ISP to the corresponding MOSI/MISO/SCK pins on the SNES plug->attiny. It works, if I recall correctly,I didn't even program the chip before I expoxied it together(damn sure triple checked continuity though), but it would be a pain to set up repeatedly to develop on as opposed to a real ISP plug. Have to remember the ISP orientation/pinout, which SNES pins are what, etc.

Also if we can send raw commands, I don't see why this adapter wouldn't work with a PS/2 mouse with just more code on the host side. I have a SNES mouse and it's cool, but I used to have an old logitech laser mouse that supported PS/2 with an adapter. I still firmly remember the transition from ball to laser mouse somewhere around 1999-2000 as a big moment in computing :geek: Much smoother.

Edit-it seems there are is at least some character missing like the '$' any maybe more. Just typing the top keys "`1234567890-=" which shifted is "~!@#$%^&*()_+" should show it, or else my keyboard is wonky.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Keyboard Solution, UzePS2, or what have you

Post by uze6666 »

That seems the smartest way to go about it, I haven't had much change to actually try using it in a program yet but I think there might be a critical feature needing to be added. Is there a way the host could send the adapter raw PS/2 commands? What I mean is, how could I send the keyboard the bytes "0xED,0b00000111" which is the command to set the scroll,caps,num LEDs all to on? I agree most everything should be the host responsibility including that.
Yes it's planned we'll be able to send command to the keyboard. To set the leds, typematic rate and reset the keyboard.
If interested in more accurate emulation you should be able to do a:
SDL_EnableKeyRepeat(int delay, int interval);
//best to use (SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL);
Already done! ;)
Oh you are right, my document says it has to be set 3 to do that stuff. I wonder how commonly supported set 3 is in old keyboards.
From the docs I read, only set 2 is guaranteed and must be supported. So it would be safer and simpler to stick to this one. When commands to keyboard are implemented we can change the typematic to the slowest rate possible in order to minimize the traffic.
Edit-it seems there are is at least some character missing like the '$' any maybe more. Just typing the top keys "`1234567890-=" which shifted is "~!@#$%^&*()_+" should show it, or else my keyboard is wonky.
Quite possible there a couples typos in the scan code table. I'll double check tomorrow.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Keyboard Solution, UzePS2, or what have you

Post by D3thAdd3r »

Crap my bad. I had the old keyboard demo on this Uzebox, indeed the new high resolution version works beautifully.

Pressing the F2 button a few times yields some strange results, no idea what is going on with that.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Keyboard Solution, UzePS2, or what have you

Post by uze6666 »

Found that the small"Mc Saite" keyboard is available at AliExpress for just 15$ with free shipping. If some would like a Uzebox keyboard send me a PM, I'll order a couple and assemble them, should be about 25$+shipping.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Keyboard Solution, UzePS2, or what have you

Post by D3thAdd3r »

uze6666 wrote:I was looking into the attiny self reprograming and not wanting to re-invent the wheel, found this: http://jtxp.org/tech/tinysafeboot_en.htm. All the grunt work is done. :mrgreen: So with it, we just have to make a special HEX to upgrade the keyboard firmware. I'll try it out in the next few days.
You have a tons of Uzebox stuff going on with the portable, etc, so it's just a curiosity that I ask if it's for sure this solution will work? I'm thinking about making up another keyboard using the method you used sometime, not any urgency to it, but I'm wondering if I should rig in an ISP before I epoxy it all up and close it(I haven't started yet but don't want to cut an unnecessary ISP hole). Also an interesting method for other possible adapters in the future like a Tornado spinner, light gun, etc.
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Keyboard Solution, UzePS2, or what have you

Post by nicksen782 »

If you are concerned with the size of the ISP header perhaps you could design it to be used with an adapter. For example I've seen serial ports rigged up to use 3.5 mm headphone jacks. The idea of a device being released that cannot be updated (bugs?) sounds like a bad idea. It is better to make the upgrade inconvenient instead of difficult.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Keyboard Solution, UzePS2, or what have you

Post by uze6666 »

I'm not 100% sure it will work since I did not test that bootloader but it should. I'd really want to complete this before I forget the rest! But if anybody what's to try to make it work, feel free to do so since I won't probably have time for 1-2 weeks.
The idea of a device being released that cannot be updated (bugs?) sounds like a bad idea. It is better to make the upgrade inconvenient instead of difficult.
Totally agree. That's why, in the one I hacked, I actually soldered all the wires to a 8-pin DIP socket so I can pop-it out until the bootloader is done.

Btw, I have sent a pcb for fabrication last week. Nothing fancy, but it will be much easier to solder everything together. I have put a footprints for a mini din and an ISP connector, just in case. I'll send you one when they come in and make a small assembly tutorial on the wiki.
keyboardpcb.png
keyboardpcb.png (10.69 KiB) Viewed 7114 times
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Keyboard Solution, UzePS2, or what have you

Post by uze6666 »

Update! PCBs are in, looks good, but seem I've put some of the top layer text on some wrong layer :? . Anyhow, should not affect the functionality. I'll post more when I have assembled it on another keyboard...
Attachments
keybpcb.jpg
keybpcb.jpg (68.7 KiB) Viewed 7041 times
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Keyboard Solution, UzePS2, or what have you

Post by D3thAdd3r »

Another nice board. That's a lot better than rigging up wires, tape, and glue. That nearly looks like it would fit inside an SNES plug depending on how big of PS/2 sockets you buy(I literally had to grind mine down to make it fit), wonder if it could be made to? It made me look for a new PS/2 keyboard to install one in, and I found one I didn't have to dumpster dive for.

I frequent thrift store looking for vintage computing items(cheap hobby), and found something I usually wouldn't care about. I had to buy it though for $3.99 brand new with box, plastic, and 3.5" driver disk...since it's perfect for the keyboard interface. It is a circa 1996 wireless IR keyboard with built in track ball, both PS/2 of course! Picture says it all, I get a laugh out of it sitting next to a nice new logitech unifying keyboard+mouse; but in 1996 I bet this would feel like a premium unit! Oh yeah, it works great with the keyboard adapter with 0 latency...as long as you keep line of site to the receiving unit :ugeek:
retrokeyboard.jpg
retrokeyboard.jpg (95.94 KiB) Viewed 7008 times
I will be dedicating this one to Uzebox and I think the PCB should go in the receiving unit just fine. If we ever get PS/2 mouse working I think the trackball should be fine for it too. Thought it might amuse someone since it makes me chuckle, the thing is pretty cool in a 1990's beige everything kind of way.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Keyboard Solution, UzePS2, or what have you

Post by uze6666 »

Nice! :)
Post Reply