Go Down

Topic: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges (Read 210531 times) previous topic - next topic

skaman

Thanks to nocash (Martin Korth) the Nintendo Power code is finally working smoothly.  I was having difficulty getting the reader to switch reliably from the Menu mode to Game mode.  With a few pointers (and much patience) from Martin, I was able to identify the cause of the problem.

Switching the NP cart from Menu mode to Game mode requires a specific sequence to be sent (read more in nocash's Fullsnes document here:  http://problemkaputt.de/fullsnes.txt).  The final command is the game selection (Slot # + 0x80) sent to 0x2400.  When the game selection is sent, then the cart immediately becomes the game selected. 

The problem with the switching code was the 21.477272MHz Master Clock running the NP cart too fast for the Arduino.  In order to ensure that the NP commands work properly on the reader, the Master Clock needs to be slowed down before the NP sequence is sent.  After the sequence is sent to the cart, then the Master Clock is restored back to 21.477272MHz.  My initial test of 2.68MHz (21.477272/8) for the slowdown works and the cart now switches back and forth between game and menu without a problem. 

For optimal results, the Nintendo Power cart requires the clock generator and the snesCIC/SuperCIC.

I'll clean up my code and post it sometime soon.

Good Luck!

zzattack

I got the oshpark boards in the mail today :)
Hopefully I have all the parts now so I can build the adapter tonight. When it's working I want to add another way of navigating the menu using something like this:


sanni

According to this topic there are some nice cart slots available somewhere in china


http://forums.nesdev.com/viewtopic.php?f=9&t=12192&p=138433#p138433

I wonder how good they fit?

zzattack

http://world.taobao.com/item/521246288114.htm?fromSite=main&spm=a312a.7700824.w4004-10497653512.8.LeJ1No

let's see if they ship to Europe :)

it mentions 2.54mm though :(


zzattack

I put the thing together and it seems to work pretty well! I've tried some SFX, CX4 and GSU carts and they all work. SA-1 doesn't work though, but I'm guessing my frequency generator may be off still or my improvised extra pins may not work as well as I had hoped.

skaman

One thing you could test that might improve the SA-1 detection is to slow the Master Clock:

Code: [Select]

void setup() {
  ...
  // Set Clock Generator CLK0 to 21.477272MHz
  //TESTING 10.738636MHz for SA-1 Carts (21.47727MHz/2)
  clockgen.set_freq(1073863600ULL, SI5351_PLL_FIXED, SI5351_CLK0);
  //  clockgen.set_freq(2147727200ULL, SI5351_PLL_FIXED, SI5351_CLK0);
  ...
}

The slower Master Clock appears to work with all of the carts that I have on hand including the SPC7110 carts.  I've also written code to set the clock correction without an external frequency counter but it needs more testing.

Make sure you have a solid, stable power supply to the reader.  The SA-1 cart is one of the enhanced carts that won't work off a flaky power supply.

Good Luck!

zzattack

Thanks for the tips. If it remains quirky, I have some 21.4772 and 3.072 crystals so I'll swap out the clockgen for those.

skaman

According to sanni, the cheap Chinese Arduino clones have suspect power regulation that could affect SA-1 cart detection.  He had problems with a CH340 based Arduino clone that required changing the onboard voltage regulator in order to get SA-1 detection working.  By contrast, a different Arduino (official design) that he had always worked with the SA-1 carts.

My original reader uses a CH340 based Arduino which might explain some of the power issues that I've encountered.  I recently picked up an Arduino that follows the official design with the ATmega 16U2.  I'll have to do more testing with the new Arduino to see if it eliminates the need for some of my Master Clock code adjustments.

Good Luck!

sanni

It must be a noise problem, most likely my other Arduino has better caps or an overall better design.
Replacing the voltage regulator probably helped because some regulators can cope with noise better than others and so does powering the Arduino with a 9V battery. Soldering a wire directly from the voltage regulator's output tab to the cartslot also seems to help if powered from a battery.
I haven't fully understood it yet and also don't have the equipment to do better testing.

zzattack

I've made a pulse counter (useful experience) and found that I needed quite some calibration (-581000), now the frequency seems to be spot on. Slowing the master clock doesn't help me get SA-1 carts recognized either, so I think I'll replace the voltage regulator and add necessary caps on the arduino now.

sanni

Still need to get something myself that can count clock pulses.

flagoss

That would be great to control the menu instead of using only one button.

http://www.ebay.ca/itm/Infrared-Wireless-Remote-Control-Kits-for-Arduino-AVR-PIC-/191674550175?hash=item2ca0b1879f:g:pRoAAMXQDnpTa4qW

zzattack

I finally got a SA-1 cart recognized. The cartridge in question had its maskrom replaced by a 27C322. None of my SA-1 carts with original MX maskrom ever worked though. I've already exchanged my chinese voltage regulator for a trusty 7805 but I still suspect the power circuit to be suboptimal.
How did you improve the power circuit no your chinese boards sanni?

sanni

I did replace the output capacitor to see if anything changes, but nothing happend. Replacing the voltage regulator(AMS1117 1A) at least gave varying results from worse(78M05 0.5A) to better(AX1117 1A) but still far away from fixing the issue 100%.

Go Up