SuperCIC for PIC10F322

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
lidnariq
Posts: 9796
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

SuperCIC for PIC10F322

Post by lidnariq » Wed Feb 25, 2015 4:48 pm

This is a follow-up to the thread pic12f629 CIC pin swap.

The PIC10F322 is a smaller (available in SOT23) and cheaper part (~half the price) than the 12F629 used by the SuperCIC key. In the conversation linked above, Markfrizb wanted a way to program them in-circuit, and since all six pins of the PIC now go to the cartridge edge, that's been accommodated.

I've ported ikari_01's original SuperCIC key code to use it instead. I had to give up Pair mode and the status LED, but it retains the region detection/switching code.

Hopefully this is useful to other people.
Attachments
supercic-key-for-pic10f322.zip
(12.15 KiB) Downloaded 348 times

qwertymodo
Posts: 774
Joined: Mon Jul 02, 2012 7:46 am

Re: SuperCIC for PIC10F322

Post by qwertymodo » Wed Feb 25, 2015 4:57 pm

This is beautiful. I had actually started working on the same thing as a result of that thread, but now I won't have to :D

darcoza
Posts: 7
Joined: Fri Oct 26, 2018 9:59 am

Re: SuperCIC for PIC10F322

Post by darcoza » Thu Nov 14, 2019 12:18 pm

What is the pinout for the 10F322 Super CIC? And which pad on the cart edge should they connect to to make this programmable in circuit from the cart edge?

Thanks! This is great work!

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

Re: SuperCIC for PIC10F322

Post by lidnariq » Thu Nov 14, 2019 12:20 pm

The pinout is specified in the asm file in the archive.

User avatar
poorstudenthobbyist
Posts: 134
Joined: Fri Jun 24, 2016 4:20 pm

Re: SuperCIC for PIC10F322

Post by poorstudenthobbyist » Mon Aug 24, 2020 5:34 pm

Hey lidnariq, I just got some boards made with the SMT version of the 10F322. I made a programming adapter board using a SNES cart connector, and I was able to program through-hole 10F322s with it previously on test boards I made up. But now, when I try to program these new boards with the SMT part, it doesn't seem to work. It's really strange, hopefully I can explain this well enough.

1) I program the 10F322 (on the SNES PCB) with my programming board. This programming board also has a test ROM on it without a CIC, so I can disconnect the PICkit3 and plug the programming board + SNES board into my SNES to make sure the 10F322 was programmed correctly. This checks out fine - the CIC is recognized, and the game boots from the test ROM.

2) I take the SNES board out, and put my 27C322 in with a test game. I place it into my SNES. The screen turns black for a split second, but then switches back to "No Signal" -- on my TV, if the CIC is accepted but there's a problem with something else on the board, the screen will stay black and not display the "No Signal" message; if the CIC is not recognized, the screen will display "No Signal". So it seems like the CIC worked for a second, but then stopped.

3) I take the SNES board out, and place it back in the programming board. The code on the 10F322 no longer verifies correctly, but it only reports a mismatch error at 0x0001F0 (the value here is 3F7F instead of 3FFF). Every other memory location seems identical, and no other error is reported.

4) I can reprogram the 10F322 and play the test ROM on the programmer just fine.

I know that it's the CIC that's causing the problem, because I can test the SNES board out with the 27C322 on my Retrobit console (which doesn't require the CIC) and it works perfectly. Even saves a game and everything.

I attached the schematic below, if it helps. The top CIC is the SMT 10F322, the bottom one is the through-hole 10F322 (which is not populated on the board). Left half of the image is the SNES cart PCB, the right half is the programmer board with PICkit3 connections.

I hope I'm doing something dumb and it's an easy fix... :shock:
Attachments
cicwiring.bmp
cicwiring.bmp (3.15 MiB) Viewed 2005 times

Markfrizb
Posts: 534
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: SuperCIC for PIC10F322

Post by Markfrizb » Mon Aug 24, 2020 6:08 pm

What happens if you power cycle or reset a few times?

When it detects a “wrong” region, it will switch over and you must power cycle or reset the console. Or if the pairing with the console goes awry, it’ll switch regions. Usually a reset twice will switch it back to whatever the consoles region is.

From what you described, it kinda sounds like it’s losing its pairing...

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

Re: SuperCIC for PIC10F322

Post by lidnariq » Mon Aug 24, 2020 6:20 pm

poorstudenthobbyist wrote:
Mon Aug 24, 2020 5:34 pm
3) I take the SNES board out, and place it back in the programming board. The code on the 10F322 no longer verifies correctly, but it only reports a mismatch error at 0x0001F0 (the value here is 3F7F instead of 3FFF). Every other memory location seems identical, and no other error is reported.
Markfrizb wrote:
Mon Aug 24, 2020 6:08 pm
When it detects a “wrong” region, it will switch over and you must power cycle or reset the console. Or if the pairing with the console goes awry, it’ll switch regions. Usually a reset twice will switch it back to whatever the consoles region is.
That's exactly what this shows. The 10F322 has no conventional EEPROM region, so instead I use the final 16 bytes of the internal Flash to store the region in tally marks (even count of 0 bits - NTSC. odd count 0 bits - PAL).

But even if it hadn't swapped region, the console still would have crashed at the same moment. You might need better bypassing for the 10F322.

User avatar
poorstudenthobbyist
Posts: 134
Joined: Fri Jun 24, 2016 4:20 pm

Re: SuperCIC for PIC10F322

Post by poorstudenthobbyist » Mon Aug 24, 2020 6:35 pm

Hm, if I press the reset button three or four times in succession quickly, the title screen will flash for a split second before going back. I can't get it to stick though.

What exactly do you mean by better bypassing? Bypass capacitor? I have a 100nF on there at the moment, along with the 22uF cap on the power rails.

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

Re: SuperCIC for PIC10F322

Post by lidnariq » Mon Aug 24, 2020 6:39 pm

Try adding a 10nF cap too.
How long are the traces between the CIC and the card edge?

User avatar
poorstudenthobbyist
Posts: 134
Joined: Fri Jun 24, 2016 4:20 pm

Re: SuperCIC for PIC10F322

Post by poorstudenthobbyist » Mon Aug 24, 2020 6:50 pm

I don't have any 10nF annoyingly, but I do have 6.8nF. It didn't seem to help at all, still doing the same thing.
The (shortest) distance is about an inch.
Attachments
cartedgecic.PNG

User avatar
poorstudenthobbyist
Posts: 134
Joined: Fri Jun 24, 2016 4:20 pm

Re: SuperCIC for PIC10F322

Post by poorstudenthobbyist » Mon Aug 24, 2020 7:53 pm

Ok, very annoyingly, the through-hole version does not work either after removing the SMT version.
I have a separate board for the original Mask ROM pinout, using 10F322s, that are even farther from the board edge, and those work perfectly even without bypass capacitors.
Is it the 27C322 and muxes that are interfering with the signal or something?

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

Re: SuperCIC for PIC10F322

Post by lidnariq » Mon Aug 24, 2020 8:05 pm

Maybe? I don't really know. Other experiences have had better luck putting the 10F322 as close to the card edge as possible, but maybe it has more to do with the routing of the +5V rail than anything else?

You might want thicker traces for your +5V lines?

User avatar
poorstudenthobbyist
Posts: 134
Joined: Fri Jun 24, 2016 4:20 pm

Re: SuperCIC for PIC10F322

Post by poorstudenthobbyist » Mon Aug 24, 2020 8:16 pm

In both cases (on both the board version that works and the one that doesn't), the thickness of VCC is 8 mils (at it's thinnest, it does pass through some power planes). I even tried soldering a wire from VCC (pin 27, which I disconnected from the rest of the VCC net) directly to the power pin of the PIC, to no avail.

This is super annoying! I basically can't use these boards except for clone consoles or modded consoles, and it's especially annoying because I have all the parts mounted too so they were particularly expensive to make. I suppose I could make a tiny adapter board for 10F322's to 12F629's to try to salvage their original purpose.

But thanks for the suggestions, it means a lot that someone would be willing to help me out on such an obtuse issue. Can you think of anything else to try out? I'm not totally sold on the idea that it's the traces, only because it works fine on the programming adapter with a 27C040 housing a test ROM. The programming board adds 4 inches of traces by itself.

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

Re: SuperCIC for PIC10F322

Post by lidnariq » Mon Aug 24, 2020 8:48 pm

The actual behavior on the SNES CIC communication lines is to drive things high (or fail to) for just one cycle (1µs?). Both sides know which side is going to drive the lines high or low for any given slot, and make sure the other does if they're supposed to. I haven't been able to reproduce this particular bug on my SNES, but I imagine that an oscilloscope triggering on the "lock" CIC asserting /RESET would show something arriving late on one side or the other. Maybe an RC curve, maybe crosstalk...

Markfrizb
Posts: 534
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: SuperCIC for PIC10F322

Post by Markfrizb » Mon Aug 24, 2020 8:52 pm

I had a similar issue years ago where a pcb I made worked perfectly on most consoles but there were a few consoles that it crashed on (CIC related both 10F322 and 629). I had managed to acquire most of the snes consoles revisions to test on. There were definitely consoles that were more forgiving than others for sure. Because of this lack of complete and full compatibility, I literally trash canned the entire lot (an expensive lesson). I would guess that your test rom worked fine because it didn’t use the multiplexers and the failure is because of the multiplexers. Maybe you can quiet the noise with some added caps, but I fear your may have a trash can moment like I did. If it’s not 100% compatible, you shouldn’t offer it to the public IMHO. That was my decision anyway.
I wish you luck. Maybe some variety of caps might work. I don’t know.

Post Reply