FamiiDI: MIDI Input & Wii Nunchuk arduino shield for the NES

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

Post Reply
User avatar
uXe
Posts: 27
Joined: Sun Nov 25, 2012 5:28 am
Location: Adelaide, Australia

FamiiDI: MIDI Input & Wii Nunchuk arduino shield for the NES

Post by uXe » Wed Dec 18, 2013 10:52 pm

FamiiDI: MIDI Input & Wii Nunchuk arduino shield for the NES / Famicom

http://www.youtube.com/watch?v=6SIU_qhdpek

FamiiDI (Famicom, Wii Nunchuk, MIDI) is an Arduino shield that reads in data from a MIDI (Musical Instrument Digital Interface) serial connection, or a Wii Nunchuk controller, and translates that data to the 15-pin 'Famicom Expansion Port' standard.

So these devices that would be other otherwise incompatible: a NES / Famicom, a Nunchuk, and a MIDI keyboard or sequencer - can now talk to each other!

All of the 15-pin Famicom Expansion Port signals are also present on the 48-pin NES Expansion Port that lurks hidden on the console's underside - and there is a great little device called the 'ENIO EXP Board' that acts as a 48-pin to 15-pin converter if you don't like the idea of soldering directly to the NES motherboard (or cutting the cable off a joypad to build your own 15-pin to 7-pin cable to connect directly to the NES Controller Port).

The FamiiDI shield appears to the NES as a joypad connected to Controller Port 2, so you can still have a regular joypad connected to Controller Port 1 without any conflicts. Demonstration # 1 in the video shows a MIDI sequence being played from a laptop into the FamiiDI board. The Arduino then maps the MIDI Note On / Off data received (note numbers 59-66, or B3-F#4) to each of the eight joypad buttons (A, B, Select, Start, Up, Down, Left, Right) the NES is running a Controller Test ROM which plays a different musical pitch for each button pressed.

The video also demonstrates sending a proportional analog input (rather than just digital on / off button presses) to emulate an Arkanoid Paddle by taking an 8-bit value (0-255) and mapping each of the 8 bits to the eight button presses read in by the NES input register at $4017.0 (a separate on / off value for the Paddle Button is sent to input register $4016.1).

PS. The 15-pin Expansion Port standard also means there is the potential to map another four Note On / Off signals, so rather than just eight notes (only the white piano keys) you could send a full twelve notes (both the black and white keys). The four additional pins present on the FamiiDI shield are:

$4016.1 (traditionally used for the Arkanoid Paddle Button)
$4017.1
$4017.3 (traditionally used for the Zapper Gun Light Sensor)
$4017.4 (traditionally used for the Zapper Gun Trigger)

PPS. Because of the potential for so many 'modes' I've also put 3 dip switches on board to allow for code that reads the state of the switches and changes mode accordingly, and there is also an RGB LED on board wired directly to the dip switches for quick and easy representation of the selected mode by color:

(0. 000, Off)
1. 001, Green
2. 010, Blue
3. 011, Blue + Green = Cyan
4. 100, Red
5. 101, Red + Green = Yellow
6. 110, Red + Blue = Pink
7. 111, Red + Blue + Green = White
Last edited by uXe on Thu Dec 19, 2013 5:20 pm, edited 1 time in total.

lidnariq
Posts: 8703
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: FamiiDI: MIDI Input & Wii Nunchuk arduino shield for the

Post by lidnariq » Thu Dec 19, 2013 2:27 am

At first, I didn't quite get what you were doing, and wondered why, since you've got the full FC expansion port, don't you just implement everything in NES itself? (After all, the Wii nunchuck is I²C and MIDI is optoisolated current-loop: these could be easily implemented using diodes or open-collector buffers and just simply connecting everything to the available pins).

But then I actually watched the video, and I have to admit that the idea of using a MIDI keyboard's pitch wheel as an Arkanoid controller is pretty cool. The point is a translating and arbitrary controller emulator, not merely hooking up interesting peripherals to the NES.

User avatar
uXe
Posts: 27
Joined: Sun Nov 25, 2012 5:28 am
Location: Adelaide, Australia

Re: FamiiDI: MIDI Input & Wii Nunchuk arduino shield for the

Post by uXe » Thu Dec 19, 2013 10:38 pm

Thanks for the feedback! :D

I've got a quick question to ask - I am using a PowerPak for testing, and am finding that if I connect the DB15 cable once the game is loaded everything works perfectly, but if I have it connected before turning the NES on, or while loading ROMs, then it can sometimes cause the system to hang... are there any particular pins on the Famicom Expansion Port (http://wiki.nesdev.com/w/index.php/Fami ... ort_pinout) that I should be careful about the state of (high / low / floating) under those circumstances? :?

lidnariq
Posts: 8703
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: FamiiDI: MIDI Input & Wii Nunchuk arduino shield for the

Post by lidnariq » Thu Dec 19, 2013 11:04 pm

Maybe /IRQ?? The rest really shouldn't matter.

Post Reply