gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > NDS cartridge irq

#104089 - Gneisbaard - Tue Sep 26, 2006 2:49 pm

I'm trying to get the cartridge irq to work, but i can't get it to.
In the cartridge pinout by darkfader it says the irq pin is grounded in the cartridge to detect removal, so i figure that it should generate an IRQ when the line is unconnected, but i can't seem to get one when i try without a cartridge in it. I'm pretty sure i've got the flags right..
Did anyone get this to work?

#104098 - masscat - Tue Sep 26, 2006 4:15 pm

The DS cart slot (slot 1) interrupt signal is pulled high inside the DS. I believe the interrupt is generated on an edge (I cannot remember if it is the falling edge or rising edge). Therefore without a cartridge plugged in you will not get an interrupt as the signal just sits at ~3.3V.
To produce an interrupt you need some method for changing the signal level on the pin. You can do this by shorting the pin to ground. At the point when you make/release (depending on which edge is needed) the short you will get an interrupt. Doing this mechanically, eg a switch, is likely to produce an interrupt when making and releasing the short and produce more than one interrupt because of the switch boucing.

On the software side the libnds name for the interrupt is IRQ_CARD_LINE.

My SPI/UART bridge uses the signal if you want to see an example of software or hardware.

#104863 - Gneisbaard - Tue Oct 03, 2006 3:43 pm

When i look at your code i see you put either 1 or 0 on the irq line, but when the cartridge gets pulled out, the line goes high-z, right? so it should still work when i pull the line from high to high-z?