Game Boy Cart Detection Switch

Thread Starter

skimzor

Joined May 17, 2023
7
Afternoon all.

I'm working on designing a different form-factor Game Boy Advance as a hobby and I'm a loss on how to recreate the cart selection switch of the GBA using a single SPST switch and some FETs. In the GBA, there is a DPST actuation switch that tells whether a GBA game or original Game Boy/Game Boy Color is inserted:

These are the characteristics for the detection switch:

If a Game Boy Advance game is inserted:
  1. Switch is not actuated
  2. VDD35 is connected to VDD3 (sends 3.3V to the cartridge slot and link port)
  3. IN35 CPU pin is pulled low

If a Game Boy / Game Boy Color game is inserted:
  1. Switch is actuated
  2. VDD35 is connected to VDD5 (sends 5V to the cartridge slot and link port)
  3. 3.3V is sent to IN35 CPU pin

1706554520003.png

I have created this circuit to try and replicate the characteristics of the original detection switch (I would have used the original detection switch but it is too large for my application):

1706561833796.png

I did simulate the 2N7002T NMOS part of the circuit in LTSpice and it is "working" where IN35 is low when 5V is applied to the gate and IN35 is 3.3V when the gate is pulled to 0V.

The other portion of the circuit is giving me issues. I'm not sure if I have the NMOS/PMOS set-up correctly or if I'm using the right FET specs. Should I take a different approach or am I on the right track? Any help would be appreciated! Thank you!
 

Thread Starter

skimzor

Joined May 17, 2023
7
Sorry, but this is not clear:
What is the cartridge slot and link port?
What is VDD35, VDD5, and VDD3?
Hi, thanks for the response. VDD35, VDD5, and VDD3 are Nintendo's naming schemes for the power rails:
  1. VDD35 is either 3.3V or 5V depending on whether a GBA cartridge or GB/GBC cartridge is inserted.
  2. VDD3 is the 3.3V line
  3. VDD5 is the 5V line.

GBA games use 3.3V logic while GB/GBC use 5V logic. So when a GBA game is inserted, 3.3V needs to be sent to the 1st pin of the cartridge slot (via the VDD35 rail); however, when a GB/GBC game is inserted, 5V needs to to the 1st pin of the cartridge slot (also via the VDD35 rail). So essentially, the VDD35 is either 3.3V or 5V. Hope I'm explaining this clearly?
 

crutschow

Joined Mar 14, 2008
38,503
Clear enough.

Using MOSFETs to control different high-side voltages to an output can be a little tricky.
Below is the LTspice sim of a circuit to do that for the VDD35 line:

To control two high side voltages you need two P-MOSFETs
N-MOSFETs won't work, as they would act as source followers with a significant on-voltage drop, slightly larger than the MOSFET Vgs(th) voltage.
The BJT (transistor) inverts the signal to one of the gates.

Note the opposite drain-source connection for the two MOSFETS.
If you don't correct that that way, the circuit won't work.
Those connection directions are to avoid any positive drain-to-source voltage that would cause conduction through the P-MOSFET substrate diode.
This works because MOSFETs conduct equally well in either direction when ON, but can only block in one direction when OFF, due to the parasitic substrate diode.

As you can see, when the switch is off (green trace) the VDD35 output is 3.3V (yellow trace), and when on, it's 5V.

The P-MOSFETs can be just about any logic-level type (max Vgs(th)≥2V).

1706589545250.png
 
Last edited:

Thread Starter

skimzor

Joined May 17, 2023
7
Thank you so so much! I appreciate the time you've taken to model this for me. I'll take a deeper dive into this tomorrow, but it looks like it'll do what I need it to do.

Thank you again!
 

MisterBill2

Joined Jan 23, 2018
27,508
What is so very difficult about utilizing the original concept of an actual mechanical switch? There are quite a few very small mechanical limit switches available.
 

Thread Starter

skimzor

Joined May 17, 2023
7
What is so very difficult about utilizing the original concept of an actual mechanical switch? There are quite a few very small mechanical limit switches available.
Dimensions of the available DPST switches. I spent a couple of hours looking through Mouser and digikey and couldn’t find any that fit the characteristics of my application.
 

MisterBill2

Joined Jan 23, 2018
27,508
I was thinking the quite small SPDT switches, two of them, because I have not seen a double pole switch nearly that small. Sorry I did not suggest using two small switches initially. And maybe the DigiKey catalog will have more choices.
 

crutschow

Joined Mar 14, 2008
38,503
If the system can tolerate a small voltage drop for the 3.3V signal (about 0.3V in the simulation) which it likely can, then the 3.3V circuit can be replaced by a Schottky diode (sim below):

1706656180066.png
 
Last edited:
Top