Keyboard hookup with minimal means (dream)

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
WattSekunde
Posts: 24
Joined: 22 May 2018, 10:25

Re: Keyboard hookup with minimal means (dream)

Post by WattSekunde »

marcelk wrote: 02 Jun 2018, 16:17 I agree that two more shift registers is not nice. The one on the board is already a little cheater. After all, software could easily sample the game controller bits during vertical pulse. The 74HC595 is rather complex because it has 16 flip-flops and a tri-state buffer. We're effectively not using its latching capability, but still, it could have been a 74LS244 as was on the prototype breadboard. [Our excuses for replacing it: more pins, no space, and no motivation at the time to shovel even more into software. We conveniently blamed the complexity on the "modern" game controller :?.]
:D
marcelk wrote: 02 Jun 2018, 16:17 The 4 chip design is fine, they are on the other end of the cable of course. If this will work we can also make the ATtiny-solution compatible: don't let it send ASCII codes but send codes matching your matrix layout.
Thanks! I also start thinking about key codes and layout. With a full 8x8 Matrix and the shift button bit moved to position [BUS 5] it's possible to build a direct 7-bit Ascii compatible keyboard. This gives us the most minimalistic way to use the actual build in font but I am not sure if this gives us the best possible keyboard layout for the Gigatron with a lot of symbols we don't really need. Maybe we also change some characters in the ASCII Font for simple blocky gfx like on the C64. Maybe we could have some dedicated Gigatron software relatet keys to speed up programming or control hardware or font related stuff...

I am currently trying some 5x8 and 8x8 Layouts. It would be ideal if they are both basically usable with the same interface/"driver" code.
But that would be a separate discussion later at this forum.
marcelk wrote: 02 Jun 2018, 16:17 There is some chip count reduction possible by hooking directly into the Gigatron circuit. I'm looking at the Y register outputs... On the breadboard I had one LED on its unused pin. They are also close to J4, unlike the LEDs. On the receiving end it is not as clear unless by removing the 74HC595 anyway and putting a 74HCT244 back there.
Yes, but I am not sure how much users are willing to modifying their hardware? For me it is easy to wire some signals to the DB9 or patch alternative opcodes etc. But I would also prefer to have a most community machines compatible. It would be interesting to start a survey about it.

As I saw the Gigatron for the first time I thought I would hack it to the max. But I think the relative big RAM and ROM are made for more complex software. And therefore a compatible system brings more exchangeability and fun thru the active community.

Back to the Gigatron Matrix Keyboard Interface (GMKI): First I'll try to use the available signals on DB9 only. We will see how far this comes. Now I have to setup an Arduino and start learning GCL :) .
WattSekunde
Posts: 24
Joined: 22 May 2018, 10:25

Re: Keyboard hookup with minimal means (dream)

Post by WattSekunde »

YES! - It works really well with no modification at the original Terminal.ino test program. I thought I get, at least, problems with key bouncing. Ok there are not real keys yet, but that's the next thing to come. :D

Gigakey: https://www.youtube.com/watch?v=cllN2JeLDZM
Gigakey.jpg
Gigakey.jpg (148.26 KiB) Viewed 6856 times
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: Keyboard hookup with minimal means (dream)

Post by at67 »

Great stuff, hurry up and finish it, I want to build it ;P
WattSekunde
Posts: 24
Joined: 22 May 2018, 10:25

Re: Keyboard hookup with minimal means (dream)

Post by WattSekunde »

1. Brian Benchof just now featured this project on the HaD front page. It is a small build using tactile switches and two PCBs for structural integrity. Might give ideas.

2. I also want a matrix board of course. I still have that donor C64. That keyboard is a dumb device, it doesn't even have diodes. Simple 8x8.

3. Out of curiosity I opened another PS/2 keyboard, and of course there is a matrix keyboard inside there as well. But more important, there is space and its cable has 5 wires: this is also a good candidate for converting to a TTL design down the road as well. (No rush for me. I will copy WattSekunde's design at some point.)
IMG_3665.jpg
IMG_3665.jpg (132.74 KiB) Viewed 6830 times

[Edit MvK: No idea what is happening with the forum, but this was posted by MvK, not WS...]
WattSekunde
Posts: 24
Joined: 22 May 2018, 10:25

Re: Keyboard hookup with minimal means (dream)

Post by WattSekunde »

This Forum has some Glitches like in Matrix? Btw. It seems that I am controlling the Matrix :ugeek:. The last contribution is not mine!? But my original answer to at67 has vanished...? I copied it back into this answer:

--- repost of the vanished answer to at67 ---
at67 wrote: 08 Jun 2018, 14:36 Great stuff, hurry up and finish it, I want to build it ;P
:lol: Thanks! I think my schematics are nearly ready. Today I had the vague Idea to build a DB9 connector into the keyboard to chain the keyboard with the gamepad or upcoming hardware...

This week I started learning GCL to write some real HW tests for the key entry. Parallel I am working on a good keyboard layout that matches the Gigatron style. I think I'll start a new thread to discuss a good key assignment. Beside ASCII we should/could have a lot of special function keys.

Btw. Your software work is great! Especially MIDI and Tetris. And I am sure some day we have some "Ready." prompt ;). Even the instruction set modifications looking very interesting to me. I would love to follow them all together. But first I have to finish the keyboard.
---
Last edited by WattSekunde on 11 Jun 2018, 09:32, edited 2 times in total.
WattSekunde
Posts: 24
Joined: 22 May 2018, 10:25

Re: Keyboard hookup with minimal means (dream)

Post by WattSekunde »

??? wrote: 08 Jun 2018, 21:21 1. Brian Benchof just now featured this project on the HaD front page. It is a small build using tactile switches and two PCBs for structural integrity. Might give ideas.

2. I also want a matrix board of course. I still have that donor C64. That keyboard is a dumb device, it doesn't even have diodes. Simple 8x8.

3. Out of curiosity I opened another PS/2 keyboard, and of course there is a matrix keyboard inside there as well. But more important, there is space and its cable has 5 wires: this is also a good candidate for converting to a TTL design down the road as well. (No rush for me. I will copy WattSekunde's design at some point.)

IMG_3665.jpg
Thanks for the interesting links. I also have some keyboards laying around. They are waiting for the tear down ;) But I think my first try would be a hand wired one...

Also a very interesting keyboard related site: http://xahlee.info/kbd/keyboarding.html
WattSekunde
Posts: 24
Joined: 22 May 2018, 10:25

Re: Keyboard hookup with minimal means (dream)

Post by WattSekunde »

The C64 Keyboard is an 8x8 line matrix keyboard. Ideal to test with my circuit... Where is my old C64 ... :lol: Yes, I definitely try it!

Here is my final circuit/schematic {so far ;-)} and some of my first steps in GCL ...
Attachments
Gigatron Keyboard 1.4.5b.jpg
Gigatron Keyboard 1.4.5b.jpg (503.27 KiB) Viewed 6800 times
GigaGCLPixel.jpg
GigaGCLPixel.jpg (510.52 KiB) Viewed 6800 times
Minuteman6X.jpg
Minuteman6X.jpg (327.66 KiB) Viewed 6800 times
User avatar
marcelk
Posts: 488
Joined: 13 May 2018, 08:26

Re: Keyboard hookup with minimal means (dream)

Post by marcelk »

The C64 style matrix keyboard is quite a classic in the home brew scene, but with it you don't get to pick your key assignment. With a custom PCB you have a good chance to emit pure ASCII, with the key mapping issue nicely solved at the source! Your shift key line is positioned well for that, I love it.

The only clash between game controller signals and ASCII codes is button [A] vs. [Del]: both are $7f. This is perfectly fine in my view and I don't plan on taking steps to untangle them. In the terminal-style applications (WozMon etc.), hitting [A] on a connected game controller initially does nothing because the cursor will be at the beginning of a line anyway. And [Del] is ok'ish as an alias for [A] when under keyboard control. Besides, the C64 had a similar entanglement between joystick port 1 and keyboard, so it is nice to recreate some of that retro experience :-)

Two questions about you schematic:
1. Are all diodes near the connector needed? (I'm looking at the one on SER_DATA for example. It wasn't there in earlier version).
2. What kind of tool do you make these pretty sketches in? It looks like an application, not a scan of a physical paper?
WattSekunde
Posts: 24
Joined: 22 May 2018, 10:25

Re: Keyboard hookup with minimal means (dream)

Post by WattSekunde »

marcelk wrote: 20 Jun 2018, 10:48 The C64 style matrix keyboard is quite a classic in the home brew scene, but with it you don't get to pick your key assignment. With a custom PCB you have a good chance to emit pure ASCII, with the key mapping issue nicely solved at the source! Your shift key line is positioned well for that, I love it.
Thanks, yes I'll wire up a custom keyboard. Hand wired and build up from single cherry like single keys like the custom pc keyboards. But first I connected my old C=64 Keyboard, add a little C64-Ascii conversion to the Terminal.gcl. What a Fun! For the C=64 keyboard I also moved the shift key bit back to D6 for a smaller conversion table/algorithm.

GigakeysC64.jpg
GigakeysC64.jpg (405.16 KiB) Viewed 6754 times

I'll start a dedicated thread about C64 keyboard @ gigatron. Because it's not compatible to ASCII and needs some mods to the Adapter and maybe the keyboard as well to better fit the gigatron. For example rewiring the Shift and Shift Lock keys. On the other side it's widely available and maybe we all have one or two laying on the attic. :lol:
marcelk wrote: 20 Jun 2018, 10:48 The only clash between game controller signals and ASCII codes is button [A] vs. [Del]: both are $7f. This is perfectly fine in my view and I don't plan on taking steps to untangle them. In the terminal-style applications (WozMon etc.), hitting [A] on a connected game controller initially does nothing because the cursor will be at the beginning of a line anyway. And [Del] is ok'ish as an alias for [A] when under keyboard control. Besides, the C64 had a similar entanglement between joystick port 1 and keyboard, so it is nice to recreate some of that retro experience :-)
;-) From time to time some keys trigger randomly the SELECT function. I haven't investigated yet if there is a way to prevent it.
marcelk wrote: 20 Jun 2018, 10:48 Two questions about you schematic:
1. Are all diodes near the connector needed? (I'm looking at the one on SER_DATA for example. It wasn't there in earlier version).
2. What kind of tool do you make these pretty sketches in? It looks like an application, not a scan of a physical paper?
1) You are right, it's optional. The diode on SER_DATA is for my breadboard experiments and I have another one on the Arduino output. I am often switching between Arduino and the keyboard on the breadboard where the DB9 is connected to. Sometimes It happens that I connect both. With the diode on both outputs nothing bad could happen. It works fine.

I am adding an external DB9 input to the circuit to chain a keyboard and a gamepad or other upcoming hardware extensions and switch between them.

2.) I am drawing on my iPad Pro 12,9" with the Apple Pencil in the App Goodnotes. Drawing those smaller schematics by hand on 5mm squared paper is exactly how I did it in the past (C64 aera :D ). But with the unbelievable comfort of an Apple Pencil in combination with Goodnotes. You can copy and paste every line of your drawing. it's simple like working in a ascii text editor. I did the A4 5mm squared paper template myself. It's a bit like what we dreamed of while we saw Star Trek back then...
tocksin
Posts: 25
Joined: 22 Jun 2018, 14:12

Re: Keyboard hookup with minimal means (dream)

Post by tocksin »

I envision an embedded keyboard in a "Gigatron 2" platform. It would have one PCB with both the DIP chips and the keyboard switches. In that design it would be very easy for the software to sample the matrix keyboard without the addition of more chips.

For example, the output bus is not used during blanking. The SYNC outputs are still needed, but the other 6 pins for RGB could be used to drive 6 rows on a matrix keyboard. Or 5 rows if you want to preserve the XOUT enable feature (probably). Diodes would be required so keypresses do not interfere with drawing the screen. Then you would need to read 8 columns back through say the input bus. Of course this could make the input bus unavailable for other devices. This could be solved with a simple 8-way 2:1 mux, but it adds two more chips to the design (74HC158).

But this accomplishes the goal of getting a keyboard interface without adding any extra chips to the design. I also think putting an embedded keyboard into the system makes it more of a retrocomputer since ALL of them had embedded keyboards back then. Of course, the cost goes up significantly when you do that. All those switches and keycaps can be expensive.
Post Reply