Hi there, I want to do a custom MMC1 4 in 1 cart that switches games when you hold reset for ~2 seconds. It essentially counts upwards and switches addresses A17 & A18 of PRG & CHR.
I used the same exact chip with the same exact program on SNES carts and they work perfectly fine but of course, SNES has /RESET line so everything is much easier to implement. I tried using the same exact chip with the same program but it barely works correctly as I expected. In addition, I added a 1N4148 diode + 102 cap as most reset based constructions suggest:
M2 CART ---|<|---+---PIC PIN #04
|
---
102
---
|
GND
It works quite randomly, when I randomly press or hold reset switch or turn the console on/off, the games randomly switch after 2 seconds of waiting but at least they only switch once and the console works perfectly fine during gameplay.
Can anyone explain what exactly the M2 signal behaves before, during and after reset is pressed?? How should I write the program to trigger game switch after holding reset for around 2 seconds. Why do I even need to add a diode with cap and should the diode cathode point straight to the cart connector or rather to the PIC chip?? Please for reply for any kind of suggestions. Many thanks in advance!!
Reset cart using custom PIC12F629
Moderators: B00daW, Moderators
Re: Reset cart using custom PIC12F629
There's a brief explanation here.
Re: Reset cart using custom PIC12F629
Not really, it still doesn't explain it in full detail and it only explains how to clear the mapper. My case is somewhat different
-
krzysiobal
- Posts: 891
- Joined: Sun Jun 12, 2011 12:06 pm
- Location: Poland
Re: Reset cart using custom PIC12F629
If you want to feed up this !reset signal to digital circuit, which acts like clock, you need schmitt buffer, because this slowly-rising !reset wil cause the digital circuit to trigger more than once.
Re: Reset cart using custom PIC12F629
M2's behavior:
While NOT RESET:
A square wave somewhere between 1.66 and 1.78MHz (depending on specific CPU), with an active duty cycle somewhere between 50% and 63% (again depending on specific CPU).
While RESET:
Completely high impedance.
You can play around with this using Falstad's circuit simulator.
(Also, if you're using a PIC ... you could program the PIC to DTRT rather than needing to condition its input)
While NOT RESET:
A square wave somewhere between 1.66 and 1.78MHz (depending on specific CPU), with an active duty cycle somewhere between 50% and 63% (again depending on specific CPU).
While RESET:
Completely high impedance.
You can play around with this using Falstad's circuit simulator.
(Also, if you're using a PIC ... you could program the PIC to DTRT rather than needing to condition its input)
Re: Reset cart using custom PIC12F629
Ah OK, so the M2 pin actually goes to high impedance while the reset button is pressed. Right I can still change the PIC program, I did this right now just for testing.
So what are my best options to switch the game while reset is held for some period of time, let's just say 1 second?? Should I use some pull up or pull down resistor and check whether the input pin is either 0 or 1 for some period of time?? Or can PIC 12F629 chip detect high impedance input state as well?? I program PIC chips using MPLAB IDE in C language. Thanks for suggestions in advance!!
So what are my best options to switch the game while reset is held for some period of time, let's just say 1 second?? Should I use some pull up or pull down resistor and check whether the input pin is either 0 or 1 for some period of time?? Or can PIC 12F629 chip detect high impedance input state as well?? I program PIC chips using MPLAB IDE in C language. Thanks for suggestions in advance!!
Re: Reset cart using custom PIC12F629
I think the easiest thing to do with the PIC would be to use the weak pullup, and check for when the square wave disappears ... probably using T0CKI or T1CKI.
Re: Reset cart using custom PIC12F629
OK, I've managed to solve it myself!! I still used the same program for SNES and the same chip, although I connected the input pin with 10K pull-down resistor to GND. Here's how I did it:
M2 CON.---+---PIC PIN #04
|
10K
|
GND
With that resistor, everything seems to be working perfectly fine as I expected, when I press reset, the console resets the game but if I hold it for 2 seconds or more, the cart switches to the next game. Many thanks @lidnariq for your big and valuable help once again!!!
M2 CON.---+---PIC PIN #04
|
10K
|
GND
With that resistor, everything seems to be working perfectly fine as I expected, when I press reset, the console resets the game but if I hold it for 2 seconds or more, the cart switches to the next game. Many thanks @lidnariq for your big and valuable help once again!!!