Replacement Keyboard Project Update
- @username@
- Posts: 323
- Joined: Tue Oct 22, 2013 6:59 pm
- Location: Scotland
Re: Replacement Keyboard Project Update
Hi Tom,
Yeah put me down for it
Here's a link to the howto connect https://www.instructables.com/Connect-A ... -Keyboard/
Thereafter, it should be a simple lookup table and post.
Arduino themselves have a really good tutor on ATMega breadboarding for arduino-product.
Cheers!
Yeah put me down for it
Here's a link to the howto connect https://www.instructables.com/Connect-A ... -Keyboard/
Thereafter, it should be a simple lookup table and post.
Arduino themselves have a really good tutor on ATMega breadboarding for arduino-product.
Cheers!
- cheshirenoir
- Posts: 279
- Joined: Sun Jun 02, 2019 5:17 am
Re: Replacement Keyboard Project Update
I'll be honest, that was my first thought. It makes sense as a solution, and again, PS/2 to Arduino is already thoroughly solved. Only problem is, I wasn't able to determine how to bridge the pins. It doesn't seem to have a common ground rail or power rail, so my usual friend, "transistors" are probably out. It also relies on shorting 3 pins together (Which I haven't seen anywhere else) so that's a twist.
If either of you can work out a nice elegant way of doing the basic electronics, I can build a prototype pretty quickly (I have all the raw parts lying around for the most part) and I'll happily run it up from there.
I already have the triplets mapped, obviously, so if you can simulate that 3 button press with control lines from an arduino, I can build the adapter.
BTW, if we need to, we could go up to a Teensy if we need more pins.
Cheers!
Chesh
If either of you can work out a nice elegant way of doing the basic electronics, I can build a prototype pretty quickly (I have all the raw parts lying around for the most part) and I'll happily run it up from there.
I already have the triplets mapped, obviously, so if you can simulate that 3 button press with control lines from an arduino, I can build the adapter.
BTW, if we need to, we could go up to a Teensy if we need more pins.
Cheers!
Chesh
Re: Replacement Keyboard Project Update
Hi Chesh,
@username@ and me try to go for a Arduino, USB Keyboard, MT8808 analog switch solution... (i found the MT8808 solution in the Commodore "C=KEY" project..)
my arduino will arrive today, the MT8808s will take a few weeks...
i guess additional testing is alway welcome :0)
Cheers, TOM:0)
PS: Here is my reverse engineered go at the CV Keymapping, can you please compare them to your keyboard design?
Cheers again, TOM:0)
@username@ and me try to go for a Arduino, USB Keyboard, MT8808 analog switch solution... (i found the MT8808 solution in the Commodore "C=KEY" project..)
my arduino will arrive today, the MT8808s will take a few weeks...
i guess additional testing is alway welcome :0)
Cheers, TOM:0)
PS: Here is my reverse engineered go at the CV Keymapping, can you please compare them to your keyboard design?
Cheers again, TOM:0)
You do not have the required permissions to view the files attached to this post.
http://www.8bit-homecomputermuseum.at Find me here...
Re: Replacement Keyboard Project Update
You do not have the required permissions to view the files attached to this post.
http://www.8bit-homecomputermuseum.at Find me here...
Re: Replacement Keyboard Project Update
and the same in a ziped Excel format...
You do not have the required permissions to view the files attached to this post.
http://www.8bit-homecomputermuseum.at Find me here...
- cheshirenoir
- Posts: 279
- Joined: Sun Jun 02, 2019 5:17 am
Re: Replacement Keyboard Project Update
Heh. Just to add some confusion, my numbers are back-to-front to yours. My pin 1 is your pin 10 and vice versa.
Easy enough for me to fix...
I'll check mine against your spreadsheet. I think mine should be pretty accurate as I've tested it with a "real" DPST momentary switch.
Easy enough for me to fix...
I'll check mine against your spreadsheet. I think mine should be pretty accurate as I've tested it with a "real" DPST momentary switch.
Re: Replacement Keyboard Project Update
Here is my go at understanding the hardwareside of reading the Creativision keyboard and joysticks...
In the CV the 6821 PIA reads the keyboard and joystick inputs. (it also feeds the soundchip with data and does the tape I/O)
During reading:
Port B (PB0 - PB7) are put into Input mode (they are three-state-high-impedance)
PB0 - PB7 are pulled "high" with the 8 x 3.3K resistors (so if no key is pressed or joystick moved all Port B bits are "1")
4 Pins of Port A (PA0 - PA3) are put to output mode and set to "high"
Every 20ms, PA0 - PA3 are set to "low" for a short impuls (strobe) at first PA 0,1 (the right controller) then PA 2,3 (the left controller) (as the 20ms equal 50Hz, i guess this happens during an interrupt?)
If a key is pressed or a joystick moved 1,2 or 3 Port B lines are connected to a corresponding Port A line => and the short "low" strobe pulls the Port B lines "low", so pressed keys are read as "0"s
The 16 diodes (D0 - D15) provided that only during the "low" strobe on the PA lines the state of the PB lines is influenced by keypresses/joymoves (as no connection to a "high" PA line ie. a +5V signal can get thru the diodes, only a connection to "low" can pull the PB lines "low")
I hope i got this right :0) any comments from the experts?
Cheers, TOM:0)
This is the fitting part of the Creativision schematic...
In the CV the 6821 PIA reads the keyboard and joystick inputs. (it also feeds the soundchip with data and does the tape I/O)
During reading:
Port B (PB0 - PB7) are put into Input mode (they are three-state-high-impedance)
PB0 - PB7 are pulled "high" with the 8 x 3.3K resistors (so if no key is pressed or joystick moved all Port B bits are "1")
4 Pins of Port A (PA0 - PA3) are put to output mode and set to "high"
Every 20ms, PA0 - PA3 are set to "low" for a short impuls (strobe) at first PA 0,1 (the right controller) then PA 2,3 (the left controller) (as the 20ms equal 50Hz, i guess this happens during an interrupt?)
If a key is pressed or a joystick moved 1,2 or 3 Port B lines are connected to a corresponding Port A line => and the short "low" strobe pulls the Port B lines "low", so pressed keys are read as "0"s
The 16 diodes (D0 - D15) provided that only during the "low" strobe on the PA lines the state of the PB lines is influenced by keypresses/joymoves (as no connection to a "high" PA line ie. a +5V signal can get thru the diodes, only a connection to "low" can pull the PB lines "low")
I hope i got this right :0) any comments from the experts?
Cheers, TOM:0)
This is the fitting part of the Creativision schematic...
You do not have the required permissions to view the files attached to this post.
http://www.8bit-homecomputermuseum.at Find me here...
- cheshirenoir
- Posts: 279
- Joined: Sun Jun 02, 2019 5:17 am
Re: Replacement Keyboard Project Update
OK I have doublechecked all the keys and they're all fine
Chesh
Chesh
Re: Replacement Keyboard Project Update
Thanks!
(i had 1 typo and one wrong key due to a short while meassuring in my first keymap)
We may ask for your help with the testing, when we have a working prototype setup :0)
Cheers, TOM:0)
(i had 1 typo and one wrong key due to a short while meassuring in my first keymap)
We may ask for your help with the testing, when we have a working prototype setup :0)
Cheers, TOM:0)
http://www.8bit-homecomputermuseum.at Find me here...
- @username@
- Posts: 323
- Joined: Tue Oct 22, 2013 6:59 pm
- Location: Scotland
Re: Replacement Keyboard Project Update
Hi Tom,
BIOS routine at $FA00 deals with keyboard polling, as you correctly say, every VDP INT or 20ms(PAL).
PIA DDRB is set to all inputs, DDRA is set low nibble only as outputs.
DDRA has values $7,$B,$D,$E as selectors - so logic inverted - being 0111b,1011b,1101b and 1110b.
BIOS outputs selector above to DDRA, then reads from DDRB and EORs this to $FF - or invert it for the software folks like me
BIOS has two lookup tables, one for odd ($FBC2) and one for even ($FBB2).
I'll go through these tables and list them next.
May need a lager to get me through the tedium
Cheers!
BIOS routine at $FA00 deals with keyboard polling, as you correctly say, every VDP INT or 20ms(PAL).
PIA DDRB is set to all inputs, DDRA is set low nibble only as outputs.
DDRA has values $7,$B,$D,$E as selectors - so logic inverted - being 0111b,1011b,1101b and 1110b.
BIOS outputs selector above to DDRA, then reads from DDRB and EORs this to $FF - or invert it for the software folks like me
BIOS has two lookup tables, one for odd ($FBC2) and one for even ($FBB2).
I'll go through these tables and list them next.
May need a lager to get me through the tedium
Cheers!