Looks like you are on your way to getting it working. I'd just like to say, if you do get it working, it would be nice if you could create a post in the projects section explaining how to wire up everything and sample code. There's already one for ps2 controllers.
You could power your boe-bot on and off from your controller IF you added a separate switch leading the power wires out to your controller. Since all NES controllers are wired (correct me if I am wrong) adding an extra 2 wires going to the controller shouldn't get in the way too much.
I'm sorry about that, I was using the gamesx info and thats for the SNES controller. The gamesx site also says that the NES is the same as the SNES controller in the color of the wire and it's function.So just match the color of the wires and it should work.
Brown wire - Ground - Vss
White wire - +5 volts - Vdd
Yellow wire - Clock - Stamp I/O Pin 2
Red wire - Serial Data - Stamp I/O Pin 0
Orange wire - Latch - Stamp I/O Pin 1
I have everything wired right, but I don't think thats the problem, the BS2 doesnt seem to be working at all the light wont go on, and when I turn it on to number 2, activating the servos, the transistor next to the servo inputs heats up ery quickly, what should I do?
It seems that unplugging the NES controller's Vdd pin fixes this problem but since I want this thing to work WITH the NES controller plugged in I need to find some sort of solution to this problem I may make a 5 volt battery pack for the controller with an extra battery pack and a few resistors, but if there is an easier way please tell me.
The wire that is causing this to happen is the +5v wire that powers the controller's encoder chip, it's hooked up to Vdd, and I dont understand y it doesnt work.....
· Maybe the revised interconnect provided by dbc1218 isn't quite right either.
· If I had one of these dudes, then I'd plug it into the (S)NES itself and make sure about the +5V & GND lines (no LED on the BoE, heat, short-circuit?; not good.)· Does it make a difference, NES/SNES?
· Found a site with a pin-out of/for an NES controller, but didn't include the colors:
· On your very first post, there are 3 links and they each present inconsistent "data." · Guess what I'd do, presuming that the White wire is +5 and the Brown wire is Ground is, with nothing else connected:
connect·White to VDD
and Brown to VSS,····
· So, let us see if the BoE (you are using a BoE, I read) can support those two wires with nothing else connected, and take it from there.·
· I'd also like to know if you're using a battery or an external power supply.
Post Edited (PJ Allen) : 7/14/2006 11:04:00 PM GMT
That sounds like a great idea, I'll try it and get back to you.· I'm using the battery pack that came with the robot, however one of the wires on the battery pack came off so I soldered it back on, that shouldnt be a problem right?
· Then something about the NES·controller is bad -- because by connecting power alone it is knocking out your STAMP power (extinguishing the LED), presuming the battery pack (?) is good.
· The controller schematics show only a couple of 4000-series ICs, nothing really power hungry.· On the BoE, VDD (+5V) is derived from the LM2940 (it is not the same as the STAMP's "VCC".)
· I'm just trying to establish a base-line here and at this point the BoE doesn't like having the NES controller connected to its +5V (VDD) -- not good.· You might want to try totally new batteries.· Make sure that VDD = +5V with nothing connected, first.
· You mentioned that you repaired your battery lead/s (there are only two wires, so how anyone could mess that much up, I dunno.)
Just a side note to anyone following this thread in search of answers, i'm pretty sure young Zsy here unfortunately accidentally got the power wires reversed on the NES controller and more than likely fried the 4041 (or whatever website you find this pinnout on) chips in the controller, tried hooking it up again, and possibly fried the 5V regulator on the BOT too.
In my EE training as well as the hobby side, ship happens, wires get backward, it happens when you got a square foot of breadboards going. But the sad fact is, when a chip fries, it only has to get hot enough to burn your finger to be shot!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Definetly a E3 (Electronics Engineer Extrodinare!)
"I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
Zsy... what you want to do is kinda high up there on the difficulty list. The "only" way you're gonna be able to get it done is by working on smaller projects first and slowly making your way up to where you want to go. This not only applies to school projects, but life in general.
What you want to accomplish has already been done with a Mad Katz/Sony PS2 wireless controller and the BS2/Atom 28 and the MCU code is freely available. You might want to use the previously mentioned wireless system as an example of how to accomplish what you want. The hardware/software utilization is well documented.
I got my Mad Katz wireless controller and adapter cable from Lynxmotion for $25 which is pretty cheap.
Being a systems engineering I like to build on what has gone before.
If you have to reinvent the wheel due to certain limitations, I guess you just have to bite the bullet and do so.
Just a thought.
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
I'm a new the the forms here, and new to micro controllers as well. However I must disagree with what everyone keeps saying here. Interfacing with a NES controller is not and advanced project. On the contrary I feel communication is a fundamental part of the micro controller world. And I'm a little concerned no one has posted code for this yet.
That being said, I sat down and looked at the online information for the NES controller. It is very simple and just uses a shift register. All you need to do is cram some wires in the holes on the controller plug (i've included the correct possition in the code) and sit down and write the 2 lines of code needed to get data from the controller. Pulsout on the latch line and shiftin the data.
Here is the code with limited explanation. Its very simple and you should be able to program your bots reaction with the information included. This test code only displays the controller stats in the debug window.
After posting this I·realized I should remind you I pluged this into pins 13-15 because it was convinent.·· Be sure not to use these if you are progaming a boe bot to move because 12-15 are the servo connectors.··
' {$STAMP BS2}
' {$PBASIC 2.5}
' NES Controler connection test code
'
' Hardware Configuration
'
'
' O Ground to VSS
' +5 to vdd O O Clock to Pin 15
' NC O O Latch to Pin 14
' NC O O Dataout to Pin 13
' Define I/O Lines
latch PIN 14 'Pin to lock data and prepair for data transmition
clock PIN 15 'Clock Pulse to drive info from the controler
dpin PIN 13 'Pin where data comes in aka data pin
nes VAR Byte 'just somewhere to store the data
'for clarity I'll define the joystic inputs here
joyUp VAR nes.BIT4 'These are just variables that point to the bits stored in the varibale called nes
joyDown VAR nes.BIT5
joyLeft VAR nes.BIT6
joyRight VAR nes.BIT7
joySelect VAR nes.BIT2
joyStart VAR nes.BIT3
joyA VAR nes.BIT0
joyB VAR nes.BIT1
' Initial setup
OUTPUT latch
OUTPUT clock
latch = 0
clock = 0
INPUT dpin
DO 'main program loop
GOSUB getdata
GOSUB displaydata
LOOP
getdata:
PULSOUT latch, 1 'store data in shift register This lodes the first bit into dpin
SHIFTIN dpin, clock, LSBPRE, [noparse][[/noparse]nes] 'pull data from the shift register lsbpre tells it lest significat bit first and that the first bit
'is alread there so get it before sending a clock pulse
nes = ~ nes 'inverse the logig state so 1 press and 0 is no press
RETURN
displaydata:
DEBUG HOME, BIN8 ? nes 'dislay raw data stored in home
DEBUG CR, BIN1 ? joyUp,
CR, BIN1 ? joyDown,
CR, BIN1 ? joyLeft,
CR, BIN1 ? joyRight,
CR, BIN1 ? joySelect,
CR, BIN1 ? joyStart,
CR, BIN1 ? joyA,
CR, BIN1 ? joyB
'show itemized inputs
RETURN
Comments
You could power your boe-bot on and off from your controller IF you added a separate switch leading the power wires out to your controller. Since all NES controllers are wired (correct me if I am wrong) adding an extra 2 wires going to the controller shouldn't get in the way too much.
Brown wire - Ground - Vss
White wire - +5 volts - Vdd
Yellow wire - Clock - Stamp I/O Pin 2
Red wire - Serial Data - Stamp I/O Pin 0
Orange wire - Latch - Stamp I/O Pin 1
· Which wire from the NES-thing is it that results in this heating up?· That'll be a clue.
· [noparse][[/noparse] Regarding the 'serial, 'clock', and 'latch' wires -- perhaps a 220ohm resistor in series between them and the STAMP Pin/s. ]
· If I had one of these dudes, then I'd plug it into the (S)NES itself and make sure about the +5V & GND lines (no LED on the BoE, heat, short-circuit?; not good.)· Does it make a difference, NES/SNES?
· Found a site with a pin-out of/for an NES controller, but didn't include the colors:
· 1) Ground,· 2) Clock,· 3) Latch,· 4) Strobe,· 5) +5V
· http://devcast.dcemulation.com/mods/unicont/nes.php
Post Edited (PJ Allen) : 7/14/2006 2:52:18 AM GMT
· Guess what I'd do, presuming that the White wire is +5 and the Brown wire is Ground is, with nothing else connected:
· So, let us see if the BoE (you are using a BoE, I read) can support those two wires with nothing else connected, and take it from there.·
· I'd also like to know if you're using a battery or an external power supply.
Post Edited (PJ Allen) : 7/14/2006 11:04:00 PM GMT
· The controller schematics show only a couple of 4000-series ICs, nothing really power hungry.· On the BoE, VDD (+5V) is derived from the LM2940 (it is not the same as the STAMP's "VCC".)
· I'm just trying to establish a base-line here and at this point the BoE doesn't like having the NES controller connected to its +5V (VDD) -- not good.· You might want to try totally new batteries.· Make sure that VDD = +5V with nothing connected, first.
· You mentioned that you repaired your battery lead/s (there are only two wires, so how anyone could mess that much up, I dunno.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
In my EE training as well as the hobby side, ship happens, wires get backward, it happens when you got a square foot of breadboards going. But the sad fact is, when a chip fries, it only has to get hot enough to burn your finger to be shot!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Definetly a E3 (Electronics Engineer Extrodinare!)
"I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
What you want to accomplish has already been done with a Mad Katz/Sony PS2 wireless controller and the BS2/Atom 28 and the MCU code is freely available. You might want to use the previously mentioned wireless system as an example of how to accomplish what you want. The hardware/software utilization is well documented.
I got my Mad Katz wireless controller and adapter cable from Lynxmotion for $25 which is pretty cheap.
Being a systems engineering I like to build on what has gone before.
If you have to reinvent the wheel due to certain limitations, I guess you just have to bite the bullet and do so.
Just a thought.
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
Post Edited (Tom C) : 7/7/2007 10:18:30 PM GMT
That being said, I sat down and looked at the online information for the NES controller. It is very simple and just uses a shift register. All you need to do is cram some wires in the holes on the controller plug (i've included the correct possition in the code) and sit down and write the 2 lines of code needed to get data from the controller. Pulsout on the latch line and shiftin the data.
Here is the code with limited explanation. Its very simple and you should be able to program your bots reaction with the information included. This test code only displays the controller stats in the debug window.
After posting this I·realized I should remind you I pluged this into pins 13-15 because it was convinent.·· Be sure not to use these if you are progaming a boe bot to move because 12-15 are the servo connectors.··
Post Edited (natpie) : 7/17/2007 4:05:21 PM GMT