Author Topic: SNES Enhanced Cart Support (FW v0.22)  (Read 2261 times)

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #15 on: 23/Jun/2017 07:14:54 PM »
Yes, the adapter files will be released.  I'm waiting for the PCBs for the last revision.  Once I've confirmed the operation then I'll post the details.  I've already shared the schematics and prototype board layout with the other devs.

The adapter is constructed as a passthru device that sits in the slot between the Retrode and cart.  It connects some of the pins missing from the Retrode.  The circuit is relatively simple consisting of 3 chips.  The main chip is the PIC 12F629 running ikari's snesCIC (snes-lock-resync) code.  The other two chips are VCXOs that supply the CIC CLK and Master CLK.  The clock chips are 3.072MHz for the CIC and 21.47727MHz for the Master CLK.  Since the 21.47727MHz is not readily available, I've substituted the common 20MHz version without a problem.  Aside from the chips, there's a pulldown resistor and decoupling caps.

I'm not sure if the adapter will go into production.  If it does go into production, then there might be design changes like replacing the VCXOs.  I built my circuit around the VCXOs after I found a supply of the 3.072MHz part.  I'm not an engineer so the VCXOs made things simpler for me.
« Last Edit: 24/Jun/2017 06:58:08 AM by skaman »

Offline ssokolow

  • Baby Retrode
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #16 on: 26/Jun/2017 01:10:37 AM »
I'm not sure if the adapter will go into production.  If it does go into production, then there might be design changes like replacing the VCXOs.  I built my circuit around the VCXOs after I found a supply of the 3.072MHz part.  I'm not an engineer so the VCXOs made things simpler for me.

I hope it goes into production. I'd certainly buy one.

(I never had time to build soldering skills I'd trust beyond "If I'd otherwise have to throw it out..." and, as mentioned, I'd really like to be able to stick a copy of Super Mario RPG into my retrode.)

Offline Matthias_H

  • Retrode Forum Techie
  • A Retrode Hero
  • *****
  • Posts: 544
  • Karma: +21/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #17 on: 26/Jun/2017 10:22:20 AM »
The other two chips are VCXOs that supply the CIC CLK and Master CLK.  The clock chips are 3.072MHz for the CIC and 21.47727MHz for the Master CLK.  Since the 21.47727MHz is not readily available, I've substituted the common 20MHz version without a problem. 
Have you considered using non-voltage-controlled XO's? You should be able to find hundreds of thousands of different types on Digi-Key. It appears the system is quite tolerant with respect to these clocks, so if there is no need for precise tuning you might as well grab anything within 1-5% (or so) of the target frequency.
http://www.retrode.org

I no longer sell the Retrode. For sales inquiries, please contact our friends at DragonBox.

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #18 on: 26/Jun/2017 06:42:43 PM »
I'll run some tests with my Adafruit Clock Generator setup to see what clocks work.  I know the Master CLK is pretty lenient.  I've run it at 16MHz, 20MHz, and 21.47727MHz.  I think the CIC CLK frequency is the key.  I'll try to test the limits of the range where it works.  With the Adafruit, there's a frequency fine tuning correction range where the CIC works but I didn't test the actual frequency limits.

As far as redesigning the circuit, I'll leave that up to the experts.  If people want to build my version of the adapter, then I can supply them with the 3.072MHz part.  I should have enough of the part to supply the early adopters.

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #19 on: 01/Jul/2017 02:30:50 AM »
Interesting preliminary results. 

The CIC CLK is the key for cart recognition and proper reads.  I tested the frequencies around the reference 3.072MHz and both 2MHz and 4MHz appear to work.  Outside this range, the data becomes invalid.

The Master CLK appears to be valid within a wide frequency range. The Master CLK must be present for the SA-1 and Nintendo Power carts to work.  The lower limit seems to be around 4MHz.  I didn't bother to test the upper limit.

There's a possibility that a single frequency could be used for both clocks.  I ran the CIC CLK and Master CLK at 4MHz and the SA-1 and NP carts appeared to work on my Arduino reader, however, using a single 4MHz VCXO on one of my Enhanced cart adapters produced inconsistent results.  A slightly higher clock might work but you're operating at the edges for the two frequency ranges. I definitely wouldn't use a single clock for something that goes into production.

At least we now have an idea of the frequency options if the 3.072MHz is unavailable.  Like I mentioned previously, I have a decent quantity of the 3.072MHz VCXOs if any early adopters need one.  For the Master CLK, use the easy to find 20MHz VCXO as a substitute.

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #20 on: 10/Jul/2017 04:05:37 AM »
Finally got my small batch of the latest PCB version for the Enhanced Cart Adapter.  Using a handcut shell from a SNES Super Gameboy.

Parts mounted are simple:
Epson SG-615P in 3.072MHz
Epson SG-615P in 20MHz
PIC12F629 programmed with ikari's snescic-lock-resync.hex
3 100nF decoupling caps
1 10Kohm resistor
SNES cart connector from Aliexpress








Offline Matthias_H

  • Retrode Forum Techie
  • A Retrode Hero
  • *****
  • Posts: 544
  • Karma: +21/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #21 on: 11/Jul/2017 07:50:31 AM »
Looks really nice and tidy, congratulations! Kind of makes my visit obsolete, but if you want we can still hang out and I can bring you some Retrode goodies :)

Regarding the design: You may consider moving all SMD parts to the same side, since it will greatly reduce the cost of industrial manufacturing. Also, of course the edge-mounted female connector does not go well with the most common industrial soldering processes (wave, reflow). I used through-hole, 90° components for the "official" plug-in adapters, at the expense of a clumsier overall outcome...
http://www.retrode.org

I no longer sell the Retrode. For sales inquiries, please contact our friends at DragonBox.

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #22 on: 11/Jul/2017 07:41:12 PM »
Thanks for the tips.  I'm sure there's a lot of room for improvement in the layout.  I'm a novice at this stuff so I tried to keep things simple for me to build.  I gave no consideration to what it would take to put the adapter into production (it never even crossed my mind!).

Assembling the cart connector is a hassle.  The Aliexpress connector has a slot on the bottom that allows the PCB to sit in.   Unfortunately, the pins are too long so each one has to be trimmed and then bent to mate to the board.  I have a few samples of the MoreThanAll full length connector but I haven't built any adapters with them.  The MoreThanAll connector lacks the slot on the bottom so it butts against the PCB.  The pins are shorter and don't need to be trimmed.

The casing for the adapter could be the biggest obstacle to production.  I was initially going to use a cutdown aftermarket universal case but when I shortened the PCB in this latest version, I made it too short and omitted a notch needed to secure the PCB in the universal shell.  I ended up going through some of my spare cases and the Super Gameboy cases work with slight modifications.  The current PCB outline isn't a perfect match for the Super Gameboy shell as it needs a notch on the left and should have a small extension on the right.  A little filing makes things fit.  An original enhanced cart shell should work with the current board but I didn't have any spare ones to cut up.

I'm hoping that a version of the adapter can be developed and put into production.  At least, I've confirmed that this latest version works properly.

BTW, there might be a future revision to the circuit.  I'm still working to come up with a solution for the SA-1 SRAM writes.  The CPU CLK needs to be active to set the SA-1 registers to write the SRAM(BW-RAM).  The problem is that the CPU CLK can't be on all the time as it messes up the reads.  I think the CIC CLK will work as a substitute for the proper CPU CLK so we won't need another clock source.  I'm trying to think of a way to control the CPU clock using some gates and a switch.  Not sure if it is possible but I'm working on it.

Offline ssokolow

  • Baby Retrode
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #23 on: 17/Jul/2017 01:13:58 AM »
I just realized a potential problem after looking at those photos.

My Retrode is from a batch manufactured based on the principle of "We've given up on supporting the SA-1, so we'll cut costs and only populate a connector for the central span of pins" and it doesn't have the two wings populated.

I'd been assuming that, given how long it's been since the original batches with the full connector ran out, you'd be ensuring that everything could be done without the wings. However, seeing them passed through on that photo, when I don't remember the adapter being compatible with anything but the Retrode, makes me worried.

Do those pins have to be connected for a successful dump or is passing them through just playing it safe? Can an SA-1 be coaxed into allowing ROM access with those pins left floating as long as there's a successful CIC sync?

If they have to be connected, I don't know what I'll wind up doing. I really don't trust myself to take a soldering iron to something I paid so much money for. (I've only ever soldered one device... a $3 PS2-USB adapter where one of the USB lines broke free of the PCB's solder pads.)
« Last Edit: 17/Jul/2017 01:29:31 AM by ssokolow »

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #24 on: 17/Jul/2017 07:16:54 PM »
No worries.  There's no modifications needed on the Retrode.  I'm using the adapter on a Dragonbox Retrode with only the center 46 pin connector.  I sent a prototype adapter to one of the beta testers and hope to confirm compatibility with the other Retrode hardware versions.

The Enhanced Cart Adapter PCB could be modified to remove the extra pins on the lower half.  I left the full length connector on the bottom because the cart adapter can also be used with the Arduino based cart reader and potentially other devices.  Most of my code development was done on the Arduino based cart reader.

For the extra pins, there's only 2 pins that we need to connect:  Pin 1 Master CLK and Pin 33 REFRESH.  Master CLK is connected to the 21.47727MHz clock (or substitute 20MHz).  REFRESH is connected to GND to enable proper SA-1 reads.

One other extra pin is notable, Pin 2 EXPAND is used for the BS-X cart.  The cart adapter doesn't do anything with Pin 2 since I had no way to control it.  Without Pin 2 we don't have proper Memory Pak control using the BS-X cart but the beta firmware works around this to allow Memory Pak reading on the BS-X cart.  The lack of EXPAND would only be significant if I decided to add the Memory Pak write code to the firmware.

Offline Sfm15

  • Baby Retrode
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #25 on: 19/Jul/2017 12:19:45 AM »
How do I sign up to be a beta tester?

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #26 on: 19/Jul/2017 08:02:46 AM »
I've sent you a PM with the link to the current BETA.  Anyone that is interested in BETA testing should send me a PM.

The current BETA firmware has been tested on both Retrode versions 1 and 2.  All of the features that I set out to implement have been added to the firmware.  The last few BETA versions were strictly bugfixes.  I haven't made any changes to the firmware for a couple of weeks.

I debated releasing the current BETA but I held off while I explored the SA-1 SRAM writes.  Another minor reason that I held off on releasing the firmware is that I recently acquired a JRA PAT cart with its unique Flash save mapping.  I should be receiving some of the other JRA PAT variants along with a SPAT4 cart so I'm contemplating adding support to read the flash data.  I'm not sure if it's worth the effort as the JRA PAT carts are pretty useless.

Offline ssokolow

  • Baby Retrode
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #27 on: 19/Jul/2017 08:36:07 PM »
No worries.  There's no modifications needed on the Retrode.  I'm using the adapter on a Dragonbox Retrode with only the center 46 pin connector.  I sent a prototype adapter to one of the beta testers and hope to confirm compatibility with the other Retrode hardware versions.

...

Thanks. That's a huge relief for me.

If these go into production, I'll definitely be getting one. If not, I'll find the cheapest possible way to hack one together that I feel I can trust and then hope they do go into production eventually so I can buy a proper one.

(I'd glady offer to beta-test if I had the means, but all of my childhood SNES stuff except a Spindizzy Worlds manual, Mario Paint manual, and Super Mario RPG strategy guide got thrown out after a basement flood and I've been putting off buying any carts which I can't dump and verify before the "not as described" return period is over.)
« Last Edit: 24/Jul/2017 12:42:23 AM by ssokolow »

Offline skaman

  • Junior Retrode
  • **
  • Posts: 41
  • Karma: +11/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #28 on: 22/Jul/2017 07:28:25 AM »
I knew when I posted that I haven't made any changes to the BETA firmware that something would come up and force changes.

I'm working on a couple bugfixes. 

I forgot about shifting the mapping for large LoROMs > 24Mbits so I've had to work on that.  If you use the normal LoROM mapping starting in Bank 0x00, then you lose data at the end of the ROM due to running into the WRAM space.  For these large ROMs, you start reading the ROM from Bank 0x80.  This should fix FE Thracia 776.

I'm working to add support for the 1024Kb SRAM.  I picked up a couple of SA-1 carts with 1024Kb SRAM (Daisenryaku Expert WW2 and Kakinoki Shougi).  The SRAM read code changes that I had previously implemented only worked up to 512Kb.  The variables used by the base SRAM code lose the higher bits so I have to work around the problem.

Since I was back writing code, I went ahead and added the JRA PAT/SPAT4 Flash save reads.  The Flash saves are 1024Kb so a similar fix as the 1024Kb SRAM except that the mapping is different.  The save data is pretty much useless like the carts themselves but I added it for completeness.

Offline newbie2

  • Baby Retrode
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: SNES Enhanced Cart Support (BETA)
« Reply #29 on: 23/Jul/2017 11:00:46 PM »
Would love to buy one of the Enhanced Cart Adapters should you ever decide to sell them!