Ok didn't get much time to look at this but it seems to be working still on the test keyboard(and PS2 mouse supports a rarely used polling mode and should be possible without interrupts, but I didn't get that functioning correctly). I made a connector out of a nice ~$2 China/ebay PS2 solder on plug/boot thing connected to a chopped off SNES controller end. Forgive the "schematics".... and the code could be really cut up right now and I don't recall what I was experimenting with months ago. I also found PS2KeyPolled but it didn't experiment much or get that to work if I recall. You will see each keystroke doubled because it is drawing the "make" and "break" messages for each keystroke right now. Let me know what you think about it, but I think it's a dead end because it's too slow as you'll see.
Now I had an interesting thought last night that I believe is correct. If we want to have keyboard games, then we have to support users that don't have a keyboard(the vast majority) otherwise the programs with keyboard support will just be a novelty enjoyed by a few hardcore fans. So I had the idea that whatever the hardware keyboard interface is like we need a light weight virtual on screen keyboard that does the same thing(put some bytes in a buffer). This is what I worked up last night and I plan to implement a chat client experiment using it. Check it out and let me know what you think. BTW Alec I noticed you in the chatroom too late I think, I quickly recompliled a couple messages(it's the only way I have to send a custom message right now) but with this real time communication should be feasible right now.
Alec, I think your original idea with the ATtiny is the best but I do think real PCBs would need to be made. I wonder if we could somehow use a really small one like an 8 pin that might fit in a smaller profile/cleaner plug.
Keyboard Solution, UzePS2, or what have you
Keyboard Solution, UzePS2, or what have you
- Attachments
-
- ps2.zip
- (197.09 KiB) Downloaded 386 times
Re: Keyboard Solution, UzePS2, or what have you
Here's the hex for the virtual keyboard to play with. It works pretty well and can enter any character we should need. Some of those tiles aren't right in the tile set I'll fix that
- Attachments
-
- virtualkeyboard.hex
- (131.23 KiB) Downloaded 394 times
Re: Keyboard Solution, UzePS2, or what have you
The virtual keyboard is a great idea Lee! We should tweak the use of all buttons to speed up typing, I.e using L or R for CAPS as you did and perhaps A for backspace, START for send, etc. An "auto-repeat" when moving would be a nice addition too.
Re: Keyboard Solution, UzePS2, or what have you
Good point there. Like you say with enough shortcuts an experienced user might be able to get type entered reasonably quick. I thought too about aligning the characters vertically instead of angled like a real keyboard. Playing with it more I often guess wrong where the cursor will go when I press up or down. I like how it looks but I wonder if a keyboard more like that of a cellphone would be more efficient in the end where all the less often used characters are on a different page. I am kind of leaning that way since then the keyboard is easily narrow enough to use it in mode 3 too, and no reason it couldn't still have compatible output with the hardware keyboard. I'll chip away at it sporadically like I do.
Re: Keyboard Solution, UzePS2, or what have you
Thinking about it, this whole keyboard thing is distracting us from the more important network stuff. The virtual keyboard should do the job for now, when I have more time I'll finish up the hardware one.
Re: Keyboard Solution, UzePS2, or what have you
For some reason I felt compelled to finish that keyboard thing once and for all. I've been working on it in the past week and I can now report it's done and working well. The design is pretty simple and only uses an Attiny26 (which seems to be obsolete by now) on the P2 port. The protocol I designed plays nice along with the polls on P1 port so it could be used for other devices in the future. Like perhaps an input for a rotary encoder (T2K, Arkanoid, etc).
I'll be making a pcb design as soon as I order some AtTiny25.
As for the firmware I was thinking of these functions:
-Initialize
-Reset
-Get device ID
-Get firmware revision
-Get scancode (for the keyboard)
-More?
So that should open quite a few possibilities like Uzechat, the telnet games, a Basic interpreted etc.
I'll be making a pcb design as soon as I order some AtTiny25.
As for the firmware I was thinking of these functions:
-Initialize
-Reset
-Get device ID
-Get firmware revision
-Get scancode (for the keyboard)
-More?
So that should open quite a few possibilities like Uzechat, the telnet games, a Basic interpreted etc.
Re: Keyboard Solution, UzePS2, or what have you
Very cool, I would like to build one soon. Do you see any reason a tiny85 wouldn't work? They happen to be a recommended chip for a v-usb project which I want to try out and I have a bunch of them doing nothing.
Re: Keyboard Solution, UzePS2, or what have you
I really wanted to use 8 pins attiny25/45/85 but alas their pinout made it harder. Right now, I need the INT0 pin to respond quickly (and simply) to the keyboard clock. But, on the tiny25, this pin is shared with a SPI bus pin I also need to interface with the SNES port.D3thAdd3r wrote:Very cool, I would like to build one soon. Do you see any reason a tiny85 wouldn't work? They happen to be a recommended chip for a v-usb project which I want to try out and I have a bunch of them doing nothing.
But you know me, I like a challenge, so now that it works fine as-is, I will try to use a pin change interrupt on another free pin. It's a bit more work but at 16mhz, there's plenty of cycles for that. Another motivation for using attiny25, is the internal PLL to run at 16Mhz with no external parts.
Finally, another thing I'd like would be to be able to update the firmware via the host. There's no bootloader concept per se on the tiny so I don't know if it's possible with the above design.
Re: Keyboard Solution, UzePS2, or what have you
Luckily, I had 2 AtTiny85 lying around so I ported the code and used a pin change interrupt instead of INT0. I ran in all sort of weird bugs but I managed to make it work in the end. I really like the minimal parts count, can't be less than that really, all pins are used and there's no other external parts. Here's the final design. Note that it work equally with a AtTiny25/45/85 as the firmware takes less than 25% of the 128 bytes of RAM of an AtTiny25.
download section.
I've commited the firmware along with a small keyboard demo: https://code.google.com/p/uzebox/source ... rdFirmware
I'll try to make a small PCB this week. Still have to add all the commands (like returning the device id) and wrap-up the kernel code. And update Uzem too...
Let me know how it works out for you!
I've put the Eagle schematic in the I've commited the firmware along with a small keyboard demo: https://code.google.com/p/uzebox/source ... rdFirmware
I'll try to make a small PCB this week. Still have to add all the commands (like returning the device id) and wrap-up the kernel code. And update Uzem too...
Let me know how it works out for you!
-
- Posts: 27
- Joined: Mon Jan 06, 2014 12:20 pm
Re: Keyboard Solution, UzePS2, or what have you
This is quite cool, and makes me wonder if we can have an Uze in a keyboard case with a joystick port on the side, etc..