Using PS/2 / USB keyboard with Family Baisc

Started by boye, March 25, 2021, 08:37:56 am

Previous topic - Next topic

boye

Exactly as the title says. What pins does the keyboard use on the expansion port, and is it possible to use a modern PS/2 or USB keyboard with Family Basic?
Can't find the FDSLoadr PC program? Get it here. It took me way too long to find.

emerson


P

March 25, 2021, 10:37:27 am #2 Last Edit: March 26, 2021, 08:30:49 am by P
That's a shame, I would have hoped that it would work with Family BASIC.


Keyboard info is found here and tape driver here.


  Famicom Expansion Port
  1___________________8
   \ o o o o o o o o /
  9 \ o o o o o o o / 15
     ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Keyboard schematics can be found here ("ファミリーBASICキーボードの回路図").
It looks like it uses pins 1, 4, 5, 6, 7, 10, 11, 12, 13 and 15.
The data pins are used in a similar way to read the controllers, but has a system for selecting which row in the key-matrix to read from. The PS/2 keyboard on the other hand, handles reading the keys itself and sends an interrupt request when a key is pressed so the computer doesn't have to poll it all the time. It then returns the state of all keys upon request I think.


Since the Family BASIC keyboard seems to only use off-the-shelf parts (much like the controllers), it should be possible to build one by using a PS/2 keyboard and throwing out the circuit and use the key-matrix the same way the Family Keyboard does, maybe.
You need a 4019 (logic chip), a 4017, four 4069, some resistors and other discrete components, two 3.5 mm mono phone connectors (for READ and WRITE ports), a Famicom Expansion port connector (you can use Neo-Geo extension cable from Tototek) and some kind of key-matrix with 8x9 (72 total) keys.

emerson

Yeah I was disappointed it didn't work with Family Basic because that was the main objective. Mode 1 converts all three PS/2 scancode types to a Family Basic keyboard report and Mode 2 converts everything to scancode 3 as to not deal with extended codes. It's some type of timing issue. One of the many projects I need to revisit...

For what it's worth, before I bought my Family Basic keyboard I built one based on Enri's schematic and it worked flawlessly.

P

Oh that is exciting to hear! Now I feel like building one (although I already have the original). It uses very few parts.

What did you use as the key-matrix? That seems to be the hardest part.

emerson

Just a large matrix of SPST switches. It was built on a breadboard and intended as a temporary setup until I found an actual Family Basic keyboard.

Using an existing keyboard's matrix will prove difficult because the row/column layout will almost certainly not match the Family Basic keyboard layout. This will result in improper key mapping. If you are considering building a diy keyboard, you are better off building the matrix from scratch. One could easily design a small key-matrix pcb where the multiple small pcbs could be strung in series to create the full key-matrix. With the several prototype pcb manufacturers available you could have 5-10 pcbs made quite affordably and have enough for more than one keyboard.

P

Oh I see. I thought of maybe just using a cheap keyboard's matrix and not use all lines, but I didn't really think about it very thoroughly. The problem with building a matrix is a source for good and affordable buttons suitable for typing with. Arcade buttons are very nice, but very expensive to have 72 of.

emerson

Exactly. I did not much care for the tactile switches I used but it's what I had in the bin. You spend more time looking and pecking then anything else. A good option would be to repurpose an electronic typewriter keyboard. At least then you could cut pcb traces and rewire accordingly.