Replacement Keyboard Project Update

Discuss the CreatiVision hardware: models, revisions, fixing, hacking and modding.
User avatar
@username@
Posts: 320
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: Replacement Keyboard Project Update

Post by @username@ » Fri Mar 26, 2021 9:39 pm

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!
User avatar
cheshirenoir
Posts: 279
Joined: Sun Jun 02, 2019 5:17 am

Re: Replacement Keyboard Project Update

Post by cheshirenoir » Mon Mar 29, 2021 1:21 am

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
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Replacement Keyboard Project Update

Post by Scouter3d » Mon Mar 29, 2021 7:06 am

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)
keyscan_1.jpg
keyscan_2.jpg
keyscan_3.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Replacement Keyboard Project Update

Post by Scouter3d » Mon Mar 29, 2021 7:06 am

keyscan_4.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Replacement Keyboard Project Update

Post by Scouter3d » Mon Mar 29, 2021 7:07 am

and the same in a ziped Excel format...
You do not have the required permissions to view the files attached to this post.
User avatar
cheshirenoir
Posts: 279
Joined: Sun Jun 02, 2019 5:17 am

Re: Replacement Keyboard Project Update

Post by cheshirenoir » Mon Mar 29, 2021 11:25 am

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.
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Replacement Keyboard Project Update

Post by Scouter3d » Mon Mar 29, 2021 11:28 am

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...
6821_controller_interface.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
cheshirenoir
Posts: 279
Joined: Sun Jun 02, 2019 5:17 am

Re: Replacement Keyboard Project Update

Post by cheshirenoir » Mon Mar 29, 2021 12:36 pm

OK I have doublechecked all the keys and they're all fine :-)

Chesh
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Replacement Keyboard Project Update

Post by Scouter3d » Mon Mar 29, 2021 1:25 pm

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)
User avatar
@username@
Posts: 320
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: Replacement Keyboard Project Update

Post by @username@ » Mon Mar 29, 2021 11:22 pm

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 :lol:

Cheers!
Post Reply