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 homebrew announcements > DS pico-project: slot-2 DEBUG LED

#138596 - truedream - Sun Aug 26, 2007 10:11 am

Hi

this is very simple very small project, it allows a debug LED to be controlled in slot-2, just connect a LED (without resistor is ok) between pins 2 (clk) and 32 (gnd) in the GBA slot-2 and use following code to test it:

iprintf("\n\n\tDS Debug LED Test\n");
iprintf("\n\n\tLED: Slot-2 pin 2 > GND\n");
while (1) {
REG_EXMEMCNT = (i & 1) << 5;
i++;
swiDelay(10000000);
}

this loop will toggle the LED with about once a second.
can be handy debugging hard to debug things, as single memory write can turn the LED on or off

#138802 - Creebo - Wed Aug 29, 2007 7:18 am

is there anyway to toggle it on and off? I would enjoy making a very simple rumble pack :D

#138831 - knight0fdragon - Wed Aug 29, 2007 3:50 pm

that looks like all the rumble pack is connected to any way from the blurry pictures given on another topic

and of course you can turn it on and off, what would be the point if you couldnt
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#138832 - truedream - Wed Aug 29, 2007 4:13 pm

knight0fdragon wrote:
that looks like all the rumble pack is connected to any way from the blurry pictures given on another topic

and of course you can turn it on and off, what would be the point if you couldnt


hi

well, yes the pin 2 can be turned off (output steady LOW) or on (output CLK !!), the Clock will make LED lit as the LED doesnt care if its high level or pulse stream.

if this type of control is sufficent for what you want todo, then you can use this trick, if not them very small hardware may be needed to detect the rumble access, and yes this can be done with NE555 or MCU


http://code.google.com/p/nds-homebrew/w/list

I am putting there some small docu about the slot-2 LED mod ;)

#138860 - Dan2552 - Wed Aug 29, 2007 10:58 pm

Creebo wrote:
is there anyway to toggle it on and off? I would enjoy making a very simple rumble pack :D


check hackaday, I believe I saw a tutorial on how to create a DS rumble pack with a nokia phone rumble motor.

#138881 - mastertop101 - Thu Aug 30, 2007 3:55 am

That's pretty interesting... what if you used

REG_EXMEMCNT = 2 << 5; or
REG_EXMEMCNT = 3 << 5;

?

#138885 - truedream - Thu Aug 30, 2007 5:45 am

mastertop101 wrote:
That's pretty interesting... what if you used

REG_EXMEMCNT = 2 << 5; or
REG_EXMEMCNT = 3 << 5;

?


i doesnt matter for the LED :)
if bits 5,6 are 0 it off, if they are non-zero its on

#139013 - wintermute - Fri Aug 31, 2007 6:59 pm

truedream wrote:
mastertop101 wrote:
That's pretty interesting... what if you used

REG_EXMEMCNT = 2 << 5; or
REG_EXMEMCNT = 3 << 5;

?


i doesnt matter for the LED :)
if bits 5,6 are 0 it off, if they are non-zero its on


Well, I haven't tried this so I don't know how it actually looks but, in theory at least, there should be a slight difference in brightness for each setting. It's probably unlikely that many people would see it though since the ratio of on to off is identical.

Also, a word of warning. You should not set the value of this register directly like this since it will destroy the state of other, quite important bits.

Code:

REG_EXMEMCNT = (REG_EXMEMCNT & ~(3<<5)) | (1<<5);

_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#139024 - truedream - Fri Aug 31, 2007 8:29 pm

wintermute wrote:
truedream wrote:
mastertop101 wrote:
That's pretty interesting... what if you used

REG_EXMEMCNT = 2 << 5; or
REG_EXMEMCNT = 3 << 5;

?


i doesnt matter for the LED :)
if bits 5,6 are 0 it off, if they are non-zero its on


Well, I haven't tried this so I don't know how it actually looks but, in theory at least, there should be a slight difference in brightness for each setting. It's probably unlikely that many people would see it though since the ratio of on to off is identical.

Also, a word of warning. You should not set the value of this register directly like this since it will destroy the state of other, quite important bits.

Code:

REG_EXMEMCNT = (REG_EXMEMCNT & ~(3<<5)) | (1<<5);


tere talv (hello winter) -

the "led demo" test was just example, and well if executed it would blink forever, so it would not much matter the other bits ;), but I just made the LED blinker DSO executable, what does return to DSO and yes I keep the bit settings there

but as long as the LED tester is in slot-2, the slot is otherwise unuseable, eh i take that back! the LED could be used as add on to existing cart that doesnt use PHI and then the remaining bits come important sure!

BTW I just made a "slot-2 geek port" PCB all done assembled this one has a small flash MCU and can do much more then blink a LED, but too tired today to test it, so cant yet report success

will post when it works..