This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

the family basic keyboard

the family basic keyboard
by on (#86251)
before i buy one of these things, i wanted to ask the community here if it would be possible to connect the family basic keyboard for the famicom to a nintendo entertainment system, either by connecting it through the first and second player controller ports or by modifying the expansion port on the bottom.

i've checked out the nesdev wiki page (along with a few other resources about the keyboard) and i feel like i understand how to write the code to read the button presses of the keyboard. i just wanted verification from someone smarter than me that this was a possibility before i dropped a bunch of cash on one of these keyboards.

if this ends up working out, i will post a full picture/video tutorial on how to mod the keyboard and nintendo to work together along with some example code for reading the button presses.

thanks!

by on (#86255)
some relevant forum thread here:
http://www.famicomworld.com/forum/index ... pic=6846.0

by on (#86271)
As a side the PLAYPOWER people are figuring out how to code for the NOAC clones with keyboard
http://code.google.com/p/playpower/sour ... ame%2Fcode

I wonder how much modding Family BASIC would need to work on a clone.

My thinking here is instead of hacking hardware you could go the NOAC-as-Keyboard route.

by on (#86272)
slobu wrote:
As a side the PLAYPOWER people are figuring out how to code for the NOAC clones with keyboard

What rewritable cartridge do they recommend for testing one's software on the clones? That's been the one reason I haven't got into the Playpower project: PowerPak incompatibility.

by on (#86273)
tepples wrote:
slobu wrote:
As a side the PLAYPOWER people are figuring out how to code for the NOAC clones with keyboard

What rewritable cartridge do they recommend for testing one's software on the clones? That's been the one reason I haven't got into the Playpower project: PowerPak incompatibility.


I guess that does spoil my only software hacking needed plan. From what I've heard they've been making their own UNROM boards.

I'm already going a bit off topic but what are the options besides a PowerPak or self-made UNROM board? I've got a NOAC-as-Keyboard to test on.

by on (#86891)
so, my family basic keyboard just arrived in the mail. it's in really great condition and i'm ready to get started.

first thing i did was open it up and pry open the controller jack itself. here's what i've found -

pin 1 - light brown wire - ground
pin 4 - red wire - port 1 d4
pin 5 - orange wire - port 1 d3
pin 6 - yellow wire - port 1 d2
pin 7 - green wire - port 1 d1
pin 10 - blue wire - out 2
pin 11 - light purple - out 1
pin 12 - grey wire - out 0
pin 13 - white wire - port 0 d1
pin 15 - dark purple - 5v

my initial plan was to install 25 pin connector jacks to both the NES and the keyboard and remove the controller cord from the keyboard completely. the 25 pin connector jack on the NES would be connected directly to the expansion slot via soldered wires. this way, i could plug the keyboard directly in to the expansion slot.

but here's my question. i'm still very new to all this and so there's a lot that is still unclear to me. some of these points are present in the pre-existing regular nintendo controller ports, correct? could i possibly use those with only slight modification?

by on (#86893)
NES controller ports have only D0, D3, and D4. You'll have to use the front-loader's bottom expansion port.

by on (#86908)
Thanks tepples!

FYI, I'm posting blog entries about this at - http://nickmaynard.tumblr.com/tagged/ni ... rd+project

by on (#86914)
Have you checked the famicomworld link I posted? Xious posted a pin-to-pin diagram of connecting FC keyboard to Frontloader's Exp connector...

by on (#86915)
jpx72 wrote:
Have you checked the famicomworld link I posted? Xious posted a pin-to-pin diagram of connecting FC keyboard to Frontloader's Exp connector...


i did, yeah! it was exactly what i was looking for. thanks a lot!

by on (#87228)
another entry in the series.

http://nickmaynard.tumblr.com/post/1386 ... -modifying

i'm posting these here with the hopes that someone will point out to me when i'm doing something wrong.

by on (#87230)
Very nice and clean soldering job you did there, with all the protecting tubes on contacts and everything! A pair of screw washers should make the connector less inclinable to breaking off the plastic. Looking forward to the cable's other end!

by on (#87911)
Nick asked me for some help with writing code to read the keyboard. I tried to have a go based on info from the wiki etc. but I cannot test it myself as I don't have the ability to hook my keyboard up to my NES (yet). Thought I'd post it here as someone might be able to check the code so we can get Nick being able to test his hardware.

Code:
;----------------------------------------

keyboardInput = $4016
keyboardOutput = $4017

keyboardMatrix:   .RES 9   ;nine bytes of RAM to store keyboard bit matrix

;----------------------------------------

resetKeyboardMatrix:
   ldx #$08
   lda #$FF      ;for the keyboard, bits are set when the key is NOT held
@a:   sta keyboardMatrix,x
   dex
   bpl @a:
   rts

;
;Scan keyboard port and store any held keys in bit matrix
;
;IMPORTANT: the keyboard actually reads a '0' for a key that is held and
; a '1' for a key that is not held - opposite to the controller pads etc.
;
readKeyboard:
   lda #$05      ;reset port
   sta keyboardInput
   
   ldx #$00
@a:   lda #$04      ;select column 0
   sta keyboardInput
   lda keyboardOutput   ;read port
   lsr a
   and #$0F      ;put in LSB
   sta keyboardMatrix,x
   lda #$06      ;select column 1
   sta keyboardInput
   lda keyboardOutput   ;read port
   asl a
   asl a
   asl a
   and #$F0      ;put into MSB
   ora keyboardMatrix,x   ;'add' to LSB
   sta keyboardMatrix,x   ;store in matrix
   inx
   cpx #$09      ;there are nine rows to read
   bne @a
   rts

BIT_MASK:   .BYTE $01,$02,$04,$08,$10,$20,$40,$80

;
;Input: Y = row, X = column
;Output: A=0, key pressed, A=anything other than 0, key not pressed
;
;Example, Y=6, X=03 will check the 'A' key and return a 0 if the
; 'A' key is held down
;   
readKey:
   lda keyboardMatrix,y
   and BIT_MASK,x
   rts
   
      
; Row   Bit0   Bit1   Bit2   Bit3   Bit4   Bit5   Bit6   Bit7
;  0     F8     RETURN [      ]      KANA   R-SHFT \(Yen) STOP
;  1     F7     @      :      ;      _      /      -      ^
;  2     F6     O      L      K      .      ,      P      0
;  3     F5     I      U      J      M      N      9      8
;  4     F4     Y      G      H      B      V      7      6
;  5     F3     T      R      D      F      C      5      4
;  6     F2     W      S      A      X      Z      E      3
;  7     F1     ESC    Q      CTRL   L-SHFT GRPH   1      2
;  8     CLR    UP     RIGHT  LEFT   DOWN   SPACE  DEL    INS