Pages: 1 2 [3] 4 5   Go Down
Author Topic: N64 Controller: Done reasearch, need a pros help  (Read 4489 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

for me the instructables code EXECUTES but i get no feedback from com7, so the processing 1.0 program returns nil

i get nothing in the serial terminal that is supposed to return the binary from the controller, what are the exact procedures you used? im going to try to run by them word for word a FINAL time
« Last Edit: January 06, 2010, 01:26:51 am by dashdanw » Logged

Canberra, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I poked wires into the controller plug and then plugged it into my breadboard. I didn't cut the connector off like you did. But it's been working fine.

I didn't try the Processing sketch, but I did see the output in my serial terminal of all the buttons and the analog stick.

If you aren't getting anything in the serial terminal then maybe you have it (the serial terminal/com port) setup wrong. You should get something even if the N64 controller isn't connected at all. Did you set the baud rate right? The skech uses 115200 baud.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its strange because it wont show anything in the serial terminal after i upload the code but if i unplug it it starts giving me a bunch of errors:

Code:
Error inside Serial.serialEvent()
java.io.IOException: Bad file descriptor in nativeavailable
      at gnu.io.RXTXPort.nativeavailable(Native Method)
      at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532)
      at processing.app.Serial.serialEvent(Serial.java:215)
      at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
      at gnu.io.RXTXPort.eventLoop(Native Method)
      at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)
Error inside Serial.serialEvent()
java.io.IOException: Bad file descriptor in nativeavailable
      at gnu.io.RXTXPort.nativeavailable(Native Method)
      at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532)
      at processing.app.Serial.serialEvent(Serial.java:215)
      at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
      at gnu.io.RXTXPort.eventLoop(Native Method)
      at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)
Error inside Serial.serialEvent()
java.io.IOException: Bad file descriptor in nativeavailable
      at gnu.io.RXTXPort.nativeavailable(Native Method)
      at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532)
      at processing.app.Serial.serialEvent(Serial.java:215)
      at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
      at gnu.io.RXTXPort.eventLoop(Native Method)
      at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)

i AM using the arduino mega if that makes any difference, the ports seem the same though and i tried running through one of the communication ports (one that was not rx0 and tx1 obviously, and even another pwm port but to no avail.

NOTE: i mentioned the arduino mega because maybe it effects the assembly code used?
« Last Edit: January 06, 2010, 04:18:09 pm by dashdanw » Logged

Canberra, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok it appears I was wrong, if you don't have the controller connected the code won't output anything.

I'm using the Arduino Diecimila, but it should work with your Mega. The assembly code is mainly just a bunch of NOPs (no operations) to get the timing right, so it should be ok.

This suggests the wiring from the controller to the Arduino is wrong. Are you sure you have the +3.3 V and ground wires right? (seeing as you cut off the connector you'll have to go by the colour of the wires, I don't know what they are). Some diagrams that show the N64 connector show it looking at the controller's plug, some show it looking at the port on the console. This would cause the +3.3 and ground lines to be swapped if you mixed the diagrams up.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i tried switching around the cables and got nothing, in fact the arduino wouldnt even connect to the computer that way, i tried it with another controller and the whole setup behaves the same way.

Also ive been assuming that to change which pin all the information is sent to all i need to do is change

Code:
#define N64_PIN
to whichever pin im using, correct? i tested the resistance im putting between the 3.3v line and the data line its about 970ohm....he doesnt seem to be doing that in the instructables demonstration, or at least hes not showing it in the diagrams
« Last Edit: January 07, 2010, 02:37:53 am by dashdanw » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

strange and bizzare development!!!

if i tap the restart button rapidly i begin to get

0000000000000000 0 0
0000000000000000 0 0
0000000000000000 0 0
0000000000000000 0 0
0000000000000000 0 0
0000000000000000 0 0
0000000000000000 0 0

repeating.....when i press any buttons it doesnt change anything (even when i unplug the data cable from the arduino it keeps returning the zeros)
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

tried it again and it didnt work the same, one time it displayed that twice..what is going on?



NOTE: wait now its working again...still no response, i think when i have more time im going to try to get it to do this with a different controller see if i cant get a response then...
« Last Edit: January 07, 2010, 02:58:32 am by dashdanw » Logged

Canberra, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure what's going on.

If you want to change the pin you have to change N64_PIN, N64_HIGH, N64_LOW and N64_QUERY. The port manipulation reference page would be helpful: http://arduino.cc/en/Reference/PortManipulation
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

alright im changing all of the hex values of the ddrd settings to 0x08 as opposed to 04, and changing n64_pin to 3 (since the hex 0x08 will be 00001000, and therefore set pin 3 when it makes changes).....wish me luck, im also changing the n64 controller...again...why do i need to put in pullup resistors when they do not do so on the instructables instructions?
Logged

Canberra, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have no idea why it doesn't use any pullups.
The code it provides has this comment:
Code:
// these two macros set arduino pin 2 to input or output, which with an
// external 1K pull-up resistor to the 3.3V rail, is like pulling it high or
// low.
Also every other reference I can find on connecting an N64/GC controller to a 5V microcontroller uses the pullup resistor.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how did you wire it when you got it to work? i can NOT understand how this is so difficult for me to get to work...ill breakout my camera and post some screens pretty soon
Logged

Canberra, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wired it with the pullup resistor.

http://img704.imageshack.us/img704/9200/arduinon64.png


From:To:
Controller 3.3VArduino 3.3V
Controller GroundArduino Ground
Controller DataArduino Pin 2
Arduino 3.3VArduino Pin 2 (through the 1K pullup resistor)
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ugh i am completely stumped on this one, going to try it with the new 8mhz arduino micro coming in the mail tomorrow..... hopefully things will change...

also what version of the arduino software are you using? ive got 0017
Logged

Canberra, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A 8 MHz Arduino won't work smiley-sad
The code is for 16 MHz, using 8 MHz would mean the timing would out by a factor of two. I don't think it would be easy to adapt it for 8 MHz. I'm using 0017 as well.

Are you using an official N64 controller? If you aren't maybe the third party controllers are more picky about the timing. I've just finished testing my own N64 controller code, so as soon as I package it up into a nice sketch, I'll post it here. I haven't tested the exact timing of the Instructables code, however I did test mine and it is 100% accurate. Maybe you'll have better luck with it.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh that's awesome! If you have the time id love to take a look at your code and ask you a few questions. I'm just learning assembly and I have a lot of questions about c and asm timing
Logged

Pages: 1 2 [3] 4 5   Go Up
Jump to: