It is currently Mon Mar 27, 2017 1:40 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Feb 03, 2017 8:04 am 
Offline

Joined: Wed Jul 22, 2009 8:53 am
Posts: 118
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!!


Top
 Profile  
 
PostPosted: Fri Feb 03, 2017 9:01 am 
Offline
User avatar

Joined: Sat Jul 04, 2015 9:58 am
Posts: 341
Location: -29.794229 -55.795374
There's a brief explanation here.


Top
 Profile  
 
PostPosted: Fri Feb 03, 2017 9:38 am 
Offline

Joined: Wed Jul 22, 2009 8:53 am
Posts: 118
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


Top
 Profile  
 
PostPosted: Fri Feb 03, 2017 10:43 am 
Offline

Joined: Sun Jun 12, 2011 12:06 pm
Posts: 104
Location: Poland
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.


Top
 Profile  
 
PostPosted: Fri Feb 03, 2017 11:00 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 5419
Location: Seattle
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)


Top
 Profile  
 
PostPosted: Fri Feb 03, 2017 11:10 am 
Offline

Joined: Wed Jul 22, 2009 8:53 am
Posts: 118
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!!


Top
 Profile  
 
PostPosted: Fri Feb 03, 2017 12:12 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 5419
Location: Seattle
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.


Top
 Profile  
 
PostPosted: Fri Feb 03, 2017 12:46 pm 
Offline

Joined: Wed Jul 22, 2009 8:53 am
Posts: 118
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!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group