Cart dumper / flash cart programmer

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Cart dumper / flash cart programmer
by on (#100247)
Longish post, skip to the last paragraph for the important part.
Several years ago I designed a cartridge reader called CopyCart, but as most projects it got abandoned. I did have PCB's made, but they're still sitting in the packaging - I never populated a single one with chips. I did however build a breadboard and wrote a lot of the software. It was based on a PIC processor, and used several 74160N shift registers to get lots of IO, which it used to talk to the cart via a 72 pin connector. It can dump carts, and it can also be used to reprogram many flash carts. It was abandoned for several reasons:
- I never found a source of 72 pin connectors. This has been re-hashed a lot, but it seems like there are acceptable parts now available.
- The PIC didn't have enough IO, and using the shift registers works - but it's slow and clunky
- I could only afford a 2 layer board. Try routing 72 pins around on two layers - it was crazy.
- The software involved was very low level. I doubt anyone would write plug-ins for me to help dump carts

Well, it turns out a lot of these issues are no longer an issue! The 72 pin connectors from digi-key apparently work, even if they're not quite right. Embedded programming is much more accessible to the High Level Programmer these days thanks to Arduino. And, Arduino has a board called the Mega2560 which has a lot of 5V IO. It has 54 pins, by my calculation 47 is enough to do a cart dumper - even if you use all the CIC and EXP pins.

In summary, a cart dumper/flash cart writer can be made now using nothing more than an Arduino, a digikey 72 pin connector, and some wire. It could be done as a pcb in Arduino "shield" fashion, but that would add significantly to the cost. It would be easy to program - Arduino is like the Lego of embedded software. Is anyone interested in this at all? I'm not talking about selling them, just trying to gauge if there is enough interest for me to invest the time in designing the thing. Total cost in parts for someone to build this thing should be around $70, that's $60 for the Arduino, and $10 for the 72 pin connector plus header and wire. Seems a little pricey, but since I sank several hundred dollars into the first iteration of CopyCart, I'm not worried about price.
Re: Cart dumper / flash cart programmer
by on (#100267)
I wouldn't expect there to be a large amount of support for an arduino based dumper here but you'll probably find interest with arduino nerds. If you're interested in the project I say go for it though.

Out of curiosity How do you come up with 47? The best way is to completely the the PRG and CHR address and data busses together. A0-14, D0-7, and max of 8 control signals + EXP if desired. That's 31 + Expansion. I guess if you put full expansion and need a few for PC communication and switches/indicators you can get closer to 47. Even still, an individual pin for the higher address bits is a pretty big waste of I/O.

Like you've concluded shift registers are probably the worst way to go with this. The kazzo's solution with 8x flipflops on the data bus is a pretty solid solution IMO. I use the same method to I/O extend with the NESDEV1, it's really easy to program for and is pretty fast method of I/O extending. Another thought what works well for something like this would be a counter. I tried this because I thought it'd be faster, but turns out it's not since you've got to keep an internal counter of where the external counter is at and it's just more complicated to program.

The counter idea could be easier to route on a PCB though. But if you put some effort into it you shouldn't have that much trouble. After routing several PCBs for the NES I'm convinced there isn't anything that can't be routed on two layers for the NES if the schematic is designed well. I too had the misconception that more than 2 layers was needed/desired for similar projects. The key is routing EVERYTHING by hand.... Time consuming but effective ;)

Even though the cost of an arduino is pretty steep for a cart dumper alone keep in mind you could produce them by making your own arduino being they're open source and all. Of course if you tailor it towards an arduino shield then it's be simple on your end and cheap for current arduino owners. It'd also be a more justifiable cost to buy an arduino that could be used for other personal projects.

Just make sure it's USB though, which I'm assuming you are since it's arduino. If you set up the plugins/scripts well I'd be willing to help out with writing the plugins. I can't guarantee I'll write em all for you. But if you take a stab at writing it based on the docs available I'll certainly chime in to help you fix your errors. They really aren't that difficult to understand from what you need to know for dumping purposes.
Re: Cart dumper / flash cart programmer
by on (#100291)
The 47 pin number is overly conservative. It includes connecting lots of pins that are not needed at all for dumping, but which might be useful to program a flash cart. Here's how I cam up with it:
15: CHR/PRG Address lines
10: EXP[0:10]
8: CHR/PRG Data lines
1: CLK
1: PHI2
1: /IRQ
1: PRG R/W
1: PRG /CE
1: CHR /RD
1: CHR /WR
1: CHR /A13
1: CIRAM A10

There are a lot of unecessary pins (EXP and CIC stuff are good examples), and a few might be able to be combined (PRG R/W and CHR /RD) - but I figure if the Arduino has enough IO, then why not make it overly flexible.
It looks like I'm going to be building this thing. I'll post my wiring diagram if anyone wants to build one and help out with writing the dumping plugins. I'll probably need some help because my cartridge collection isn't very extensive. I probably don't have most of the mappers, and I don't have any flash carts so I'll have to depend on someone else to either write those, or send me the algorithms.