Offline
Brooklyn, NY

http://www.batslyadams.com
https://code.google.com/p/nesserial/

I've been working at a serial connection to the NES for a few months now. At first I came up with a board to try and establish a serial line to the NES through the controller port  - I only made 2. They worked - but I figured that it was possible to do it without the board if I did some tricky stuff with the ATMega interrupts on the Arduino. After a few days of debugging (and cycle counting) it’s working flawlessly. The advantage of this over a software serial based approach is that the Arduino acts as a buffer that’ll hold incoming messages (up to 128 bytes) until the NES is ready to get the next one. This means that the NES is free to do other things and doesn’t need to spend time polling the controller port! The latency is extremely low - about as fast as the NES could handle - faster than the MIDI standard. The serial code is compact and easily relocatable - it works great as a replacement to any controller code. Working on a new name for this since it really just acts like a bridge between your PC and the NES. Both the ROMs and the Arduino stuff will be open source so if you have the hardware you're ready to go!

PC->NES Transfer Tool features:

PRG Upload (2K max ($6000-$7FFF) - great for quickly debugging small programs)
CHR-RAM Uploader - CHR banks / nametable data
Full PPU control (palette / scroll registers / mirroring etc..)
Full sound register control

Demo video of PRG/PPU uploading. First the transfer tool is loaded from the powerpak - then glitchNES is uploaded over serial- then from there a couple of new CHR banks are loaded while glitchNES is running.

Example software: (I'll upload videos as I record them)
PRG Upload for fast development cycle on real hardware
Bridge PC data through serial - (ex. network data sent over serial to Twitter client)
MIDI CC control of glitchNES
Hardware NSF player
Analog sensor input for alternate controls
Atari punk type console using the APU

What you need:

An NES
Arduino Duemilanove or equivalent (testing RBBB this weekend - should be no problems)
Desoldered NES controller cord (I have about 40 of these that I intended to use for the boards)
Powerpak or other devcart (All software is currently using NROM (PRG-ROM + CHR-RAM) to make things simpler)
Optional: MIDI-in circuit for Arduino for FaMI

- That’s it! No internal modification / extra components needed. It took a while to get the Arduino to handle everything but it was worth it to eliminate any external components. Just hook up the wires to the Arduino / run the software and pop that badboy into 2nd NES controller port.

And presenting...


FaMI (Family MIDI) - Open source NES MIDI software + live visualization by NO CARRIER



Right now channels 1-4 are working with no issues - MIDI files play perfectly (i just need to find the right song for a good demo)! There aren't any effects yet - but it’s completely stable / performance worthy in the state that it’s in. I'll be working on pitch bends / cc control in the next couple of weeks - but it's open source so hopefully people will develop beyond that! The samples work but they are fixed- I’m working on a mapper for powerpak right now that may allow sample uploading.

What’s great about using this Arduino setup is that you can use VBlanks MIDI->serial processing app so you don’t even need to build a MIDI circuit - just use the USB cable!

I’ll be releasing the source code for the Arduino/ROMs within the next week after I clean up the code/comment. I'm hoping to have a suite of audio/VJ tools that are ready to run so I’m looking for inspiration as to what else to use this stuff for! So please let me know if you have any ideas!

Thanks to
+ NO CARRIER for FaMI name / logo / layout
+ bucky for the encouragement / pitch tables
+ Animal Style / enso / entire Philly crew for being awesome dudes
+ neilbaldwin and blargg for inspiration to finish this NES stuff

Oh yeah I've got a bunch of desoldered controller cables (40+) - if you're going to pulsewave this weekend and have the hardware to try this out, let me know! I'll bring you one so you don't have to destroy a controller - free of charge - just help me test this stuff! smile

Last edited by Batsly Adams (Jan 12, 2011 10:25 pm)

Offline
GNV / FL / USA

Glad this is finally public! You've been working so hard on it, man. smile smile smile

Lemme get in on this thread early and say this:

In a few weeks glitchNES 2 will be out, and will take full advantage of the Arduino->NES Transfer Tool. It will feature a control panel that runs on your PC (Windows or OSX) and controls speed, palettes, CHR data (both RAM and ROM), and even the loading of custom screens. It will also be audio reactive, receiving input from the PC to the Arduino and back to the NES, to have it sync up with a line in or from the microphone.

EDIT:

Last edited by NO CARRIER (Jul 30, 2010 5:58 am)

Offline
WOW MAN!

A bona fide game-changer. Absolutely superb! big_smile

Wow, what is it with the NES lately - some seriously good stuff going on!

Offline
Tucson, AZ

sick. shit.

Offline
))<>((
neilbaldwin wrote:

Wow, what is it with the NES lately - some seriously good stuff going on!

seriously.

I'ma have to buy me a NES real soon.

Offline
Philly/NY

Y E S

Offline

Damn Bastly!!!

You sexy sexy son a bitch!

Offline
Chicago IL

omg omg

Offline
Psydney, Australia

Hats off

Offline

What's the maximum transfer speed a NES program could receive at, assuming it just threw away every byte received? We'll definitely have to support this in the bootloader of our devcart.

Offline
thieveland ohio

jaw on floor...

Offline
San Francisco

o yeah.

Offline
rochester, ny
Batsly Adams wrote:

Hardware NSF player

can you talk more about this?

this is amazing by the way.

Offline
BK

totally amazing. once FaMi drops, I predict a HUGE boom in artists switching to NES. This is also a visualist's wet dream. That arduinoboy I failed to get working properly is going to be sacrificed to build this beast.

Offline
Brooklyn, NY
blargg wrote:

What's the maximum transfer speed a NES program could receive at

Right now I have it running at about 1/3 of the speed for stability (I have a subroutine with a bunch of NOPs in it - I'll probably reduce them one by one until I find the magic number as the Arduino is a little unstable). The blue line is STA $4016 latching and the yellow line is LDA $4017 clocking the next pulse. So right now it's around 25Kbps - but I've gotten it near 100Kbps without any glitches.

















nickmaynard wrote:

(NSF player) - can you talk more about this?

Sure! I modified an NSF player to dump the $40xx registers over the serial line everytime they are written to in the software. The NES software is simple, it just takes the value and writes passes it to the proper sound register. Samples didn't work of course but everything else sounded perfect.

Last edited by Batsly Adams (Jul 30, 2010 1:25 pm)

Offline
Minneapolis

Cool beans! Our devcart really needs to be able to support this new hardware. Our current read/write mode is done with a passive cable or at best a MAX232. smile A bit slow. However, with the Munchausen cart, having too high a serial transfer speed actually makes writing to Flash a pain in the butt, but for other thing this looks like it would be pretty cool. (edit, not true, a misunderstanding on my part from something Blargg said to me earlier. This thing could make flashing the Munchausen 10x faster.)

Now if only it was plain microcontroller code instead of Arduino it'd be less expensive.

Last edited by arfink (Jul 30, 2010 2:30 pm)