Go Down

Topic: N64 Controller: Done reasearch, need a pros help (Read 6 times) previous topic - next topic

dashdanw

Okay so how i understand it from this page:
http://www.mixdown.ca/n64dev/

The n64 controller is 3 cables, 1  grnd, one input (i dont know what for) and a "1 wire interface" that handles almost all of the I/O mentioned in the analysis.

Sending 00000001 (ie 0x01) to this data port returns the overall button status in a 32 bit string, the first 16 are for each of the 14 button positions (ie 0 for off 1 for on) and 2 empty spaces, and the last 16 are for controller position, 8 for L/R and 8 for U/D.

My general question is can i plug this data port into any of the digital ports on my arduino board and write 0x01 to serial and then listen for the button stats? because if so that would make this whole thing extremely easy.

OR do i need to get a little more nitty gritty? it talks at the beginning of the article about how you need to make sure the computer doesnt "up" the signal or you can blow out hardware since the controller has a signal "pullup" installed in it already, is that something i need to be weary of?

frostin

I believe you can... but im still learning and dont take my word on it. BUMPY :)

dashdanw

yeah it seems that you are able to read and write serial data quite easily except for im not quite sure how the difference between the 1wire system of the nintendo controller (1grnd, 1pwr, 1 data) translates to the tx/rx system of normal serial communication.

frostin

Should be able to just wire tx/rx respectively and serial.print the data from the pin to see what you're getting... correct? least how my gps shield works from serial data...

dashdanw

yes except for that i believe the n64 might not exactly follow normal serial baud rates, it sends about 31250 bytes per second (4us per bit, 3us down 1 up for 0, 3us up 1 down for 1), which is not consistant with any type of baud rate, also i tried a some simple code after plugging the controller in and plugging both tx/rx both into the single data wire, i set the baud rate to 38400 since that was the closest rate to the controller but it doesnt seem to work.

Code: [Select]

int incomingByte=0;
void setup(){
 Serial.begin(38400);
}
void loop(){
Serial.print(01,HEX);
if (Serial.available() > 0) {
   incomingByte = Serial.read();
   
   }
 delay(1000);
}


but i get

Code: [Select]

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Go Up