Introduction: Connect NDSL With ARDUINO
Nintendo DS has GBA bus, so I made it transmittable with ARDUINO.
What you can do with it :
transmit data between arduino and ndsl.
so, you can use your ndsl to arduino's wireless lan or arduino to your ndsl's digital IO port!
What you need:
Hardware :
NDSL GBA cart cover
nintendo Y driver (eventhough you don`t have, no problem!)
some wires (3 wires, enough! 4 wires GREAT)
cutter knife,
soldering iron,
solder,
ARDUINO
:) Nintendo DS Lite
Software:
devkitpro
libnds (for nintendo development)
arduino
How it works:
NDSL has GBA bus. It has /WR pin and External interrupt pin.
If you access gba bus, /WR will toggled, so I can use /WR to send data.
However, it lasts just 350us. It mean you cannot use this pin to digital I/O pin directly.
So I mimic NEC REMOTE CONTROLLER protocol(TV, VIDEO etc...)
External interrupt pin is used to receive data, /WR pin is used to send data.
ARDUINO works exactly same way.
these are my youtube video.
http://www.youtube.com/watch?v=CnBe5NonHLA
http://www.youtube.com/watch?v=B3aEGCiGEaA
http://www.youtube.com/watch?v=BddcjIB_sPQ
What's new? What's GOOD:
You can use your slot1 device already you have.
In addition to, If you have arduino already, making your own gba connector is cheaper than buy another transmittable slot1 or slot2 device.
DISCLAIMER
DO NOT ACROSS GND VCC WIRES!
>>If you did it already, your ndsl's fuse was blown.
>>Google it "ndsl fuse blown"
Let's start!
Step 1: Soldering
1. open GBA CART COVER, with Y driver.
(if you dont have Y driver, you can do with soldering iron. just make a circle around screw. then you can take of cover's top. )
2. soldering wires to 3 points.
/WR (3rd), EXTERNAL INTERRUPT(31st), GND (32nd, last) (VCC 1st, optional)
3. assemble your cart.
(before step3, you may need to cut some part of your gba cart cover. just make a hole to wires can pass out. )
(soldering VCC (1st) pin will make you to using ARDUINO without external(additional) power supply.
This is optional.)
CAUTION!
if you soldering wires too closely to your pin's end, it will make your cart don't fit your GBA PORT anymore. soldering wires as possible as away from pin.
Step 2: Connect NDSL With ARDUINO!
let's connect NDSL with ARDUINO.
NDSL ARDUINO
/WR(3rd) ------------------------- digitalpin 2 or 3.(in my case 2)
EXTERNAL(31st) -------------- any digitalpin (in my case 5)
GND(32nd, last) ---------------- GND
VCC (1st) --------------------- 3.3v (this is optional)
Step 3: Libraries
for send & receive data, you need both NDSL library and ARDUINO library.
this step will tell you how to use libraries.
1. download from http://code.google.com/p/ds2arduino/
2. extract it
3. you can see ARDUINO and NDSL directories.
For NDSL
-test homebrew
complie it. If you press UP key, it will send Data.
Receive data will automatically triggered by ARDUINO.
- make your own program
copy include directory and source directory to your project's main directory.
(in other words, make include directory, copy header file. then copy cpp file to your source directory.)
include ds2arduino.h file
initialize with ndslArduino.initialize();
send data with ndslArduino.sendData(DATA WHAT YOU WANT TO SEND);
get data with ndslArduino.getData();
sendData can transmit 32bit once.
getData will return uint32 value.
For ARDUINO
-test program
copy ARDUINO\libraries\ds2arduino to your library directory.
open ds2arduino.pde
uncomments commands what you want.
Let's test it!
- make your own program
include ds2arduino.h file
initialize with ndslArduino.initialize(OUTPUT PIN, INPUT PIN MUST 2 or 3);
(output pin can be anyone among digital pins. input pin must be one of 2 or 3.)
send data with ndslArduino.sendData(DATA WHAT YOU WANT TO SEND);
get data with ndslArduino.getData();
sendData can transmit 32bit once.
getData will return uint32_t value.
CAUTION
-NDSL library use timer1 interrupt.
-ARDUINO library use timer1 interrupt, External interrupt.
-If you repeat sending data too rapidly, it can be corrupt.
- DO NOT link VCC and GND directly!!!!!!! YOUR NDSL'S FUSE WILL BE BLOWN!!
(first time, it's okay. But second time, your NDSL will not power up anymore.)
MY youtube videos.
NDSL sends counter data starts from 0.
Everytime clicking + PAD, counter is incresed.
If data is even number, LED is off.
If data is odd number, LED is on.
Arduino source code is here.
NDLS source code is attached in library archive.
Code:
#include "ds2arduino.h"
uint32_t temp = 0;
void setup()
{
ndslArduino.initialize(5, 2);
pinMode(13, OUTPUT);
}
void loop()
{
temp = ndslArduino.getData();
if(temp & 1) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
}
Step 4: END.
Thank you for reading.
I tested only with my NDSL and ARDUINO, so there can be problem.
If you have any question or find problem, SEND me the mail.
hounjini at gmail.com
18 Comments
2 years ago
Hi, I'm testing this library for an experiment and when I try to build the NDS homebrew I get this error:
"arm-none-eabi-g++.exe: error: unrecognized command-line option '-mno-fpu'"
and I can't build the NDS file.
IF I remove the command-line option "-mno-fpu" in the "Makefile" file I can compile it, and I can send commands from NDS to Arduino, but no from Arduino to NDS (that's what I want to do).
Can someone please tell me how to fix this? Thanks in advance!
4 years ago
Old post I know....
Before I break out my soldering iron and destroy a cart, is this controller information passed through the GBA bus in all NDS applications, and your homebrew giving an easy way to test X/Y position, etc??
OR
Is you homebrew passing this data to through the GBA BUS?
I'd like to build something to capture controller input on my NDS and wonder if this is a good starting point.
Reply 4 years ago
Second statement is right.
My library uses gba bus like GPIO.
Without my library or trying to accessing gba bus with some code, nothing will happen on gba bus electronically. Even though your controller button is pushed.
8 years ago on Step 1
You hace said solder three wires but you have soldered all of them! are the all neccesary and what is that black thing on the end as that can't surely fit inside the GBA cart!
Thanks
Make-O-Saurus
11 years ago on Step 3
please, can you explain me how I use the ndsl library? I didn't understand this: "For NDSL
-test homebrew
complie it. If you press UP key, it will send Data.
Receive data will automatically triggered by ARDUINO.
- make your own program
copy include directory and source directory to your project's main directory.
(in other words, make include directory, copy header file. then copy cpp file to your source directory.)
include ds2arduino.h file
initialize with ndslArduino.initialize();
send data with ndslArduino.sendData(DATA WHAT YOU WANT TO SEND);
get data with ndslArduino.getData();
sendData can transmit 32bit once.
getData will return uint32 value."
13 years ago on Step 1
32th?
you mean 32nd right?
Very nice hack :)
Reply 13 years ago on Step 1
yes, That's right.
What a shame...
I'm going to study English...
:-(
Reply 11 years ago on Introduction
does this work on the original DS too?
12 years ago on Introduction
This may be a stupid question.. but do you need some kind of homebrew card to get this work? Or am I just missing something?
12 years ago on Introduction
could u do this with a regular ndsl cartredge to maby duble controle a ndsl with 2 arduinos or to use a ndsi ndsi xl or a n3ds
12 years ago on Introduction
will this work as a homebrew card like a r4 or similar and will it work with a regular gba?
Reply 12 years ago on Introduction
Notice
you can not use nds source code directly to gba
Reply 12 years ago on Introduction
1. This is communication interface. Doesn't have memory or data store function, so you cannot use this as a 4r.
2. I didn't try this with regular gba, but NDLS's gba port is exactly same with gba's one. Probably, Yes you can.
13 years ago on Introduction
So, who'll be the first to build an Arduino Pro Mini 3.3v into an old GBA cartridge? :)
Reply 13 years ago on Introduction
Hmmm... good idea lol
Reply 13 years ago on Introduction
OMG that is a GREAT idea!!!!!!!!!!!
13 years ago on Introduction
Nice, very nice, but what exactly can this accomplish?
Reply 13 years ago on Introduction
I just show how to connect DS and Arduino.
The application is up to you : )