Using a NES Controller to control a Boe-Bot
Hello, I'm Zsy and I want to use a NES controller to control my Boe-Bot, I am a pretty bad programmer so I need a lot of help.· The schematic for the controller and a site with some info are linked to below as well as a pic of the controller itself.
http://seb.riot.org/nescontr/nes-controller-schematic.png
http://www.gamesx.com/controldata/nessnes.htm
http://www.ladyada.net/make/gamegrrl/NES.jpg
http://seb.riot.org/nescontr/nes-controller-schematic.png
http://www.gamesx.com/controldata/nessnes.htm
http://www.ladyada.net/make/gamegrrl/NES.jpg
Comments
Although the following article deals with the Sony Playstation Controller, you may be able to pick up some information or techniques that will assist you with your Nintendo Controller. Take a look at this article "Playstation Controller Redux" in these Nuts and Volts Magazine articles by Jon Williams of Parallax:
http://www.parallax.com/html_pages/downloads/nvcolumns/Nuts_Volts_Downloads_V4.asp
Other than that, you might try to Google "BASIC Stamp + NES controller" and see what comes up.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
The entire article is only 363 KB long, so if I were in your position, I'd download it onto a 1.44 MB floppy diskette, and take it wherever you need to take it, to read it.
To answer your question directly, I have no facility to do what you asked- sorry.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
If I get the NES controller to connect to the Boe-Bot, where should I connect it, and how would I program it?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
If you were under the impression that this was a trivial project, or that through some quirk of hardware magic, and a few lines of code, you were going to be able to operate your BOE-Bot from any particular type of game controller, nothing could be further from the truth. In my mind, this would probably qualify as a "medium to advanced level" project, which would best be attempted by someone who has had at least the following experience (which can be gained by reading and understanding the various FREE Parallax Educational Texts):
1. Basic understanding of analog and digital circuity, along with some basics about power supplies and voltage regulation.
2. Basic understanding of how to read and interpret schematic drawings, as well as an understanding of basic data sheet parameters for various electronic and electrical parts.
3. Some, even limited, experience with interfacing custom hardware.
4. Basic programming concepts and software-to-hardware interfacing methods.
5. Ability to solder and wire circuits from a schematic drawing.
6. A fundamental understanding of the programming language to be used.
7. Basic knowledge of programming theory and concepts.
8. Basic hardware and software troubleshooting techniques.
After that you should be good to go. So, I'd suggest something more basic to begin with, if you'd like to pursue this as a hobby. The Parallax text "What's a Microcontroller" is generally suggested as the first stepping stone in this process. That text, along with all of the others, are available on the Parallax web site.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
I also found out what each wire is for and 1 wire is +5v which should go right into the Vdd which is conveniently +5v lol, the second wire is ground which I will insert into Vss, and the other 3 are data, strobe, and clock signal which I have no clue how to use...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
It is not simple to interface a BS2 to a Playstation controller. No, it's not possible to power on and off the BS2 from the controller. It would be easier to get the IR Remote Control from Parallax, and use the interfacing instructions to provide an IR control of your BS2. The IR remote would then give you a hand-holdable key-pad, and you could program the BS2 to do different things based on the button you press.
We want to help you.
Oh, and Vdd is +5 volts.· Vin can be anything from 6.5 to 20 volts -- there's an on-module regulator that drops this to +5 for the BS2.· On the BOE-Bot, the BOE board has a regulator that·can handle up to 1 amp of current, which takes in 7.5 to·20 volts DC and provides +5 to the Vdd line.· And yes, Vss is ground.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Read experiment #24 and #24b, it will teach you how to read the bit-states of the NES controller by connecting to the proper pins. The link you posted earlier explains it simliarly in layman terms using the "conveyor belt" analogy.
Hope that helps, good luck!
Let's start putting some of this information from various previously mentioned sources, into one "framework" to see if it makes some logical sense. The format I chose to use is acceptable to the PBASIC Editor, so that it can be inserted right into your program for documentation if you wish.
<code>
'====== PBASIC Program to Access NES Controller =======================
'
'···· CD4021BC Fairchild 8-Stage Shift Register
'
'*
*
*
'|··· 4021········· · ·|·· NES Function·· |
'|
|
|
|
'|Pin # Pin Name· | Controller input· |
'*
*
*
'·· 7···· P1 (Q1)········· Right
'·· 6···· P2 (Q2)········· Left
'·· 5···· P3 (Q3)········· Down
'·· 4···· P4 (Q4)········· Up
' 13···· P5 (Q5)··········Start
' 14···· P6 (Q6)········· Select
' 15···· P7 (Q7)········· "B" button
'· 1 ···· P8 (Q8)········ "A" button
'Pin # ·Pin Name··· PBASIC Shiftin Function - Sync Serial Access
'
·
····
' 10········ Clk······· Serial clock pin
'· 3········· S/O······ Serial data·output·pin
'
'· 9····· PAR/SER ·· Latch ·0 = latch parallel inputs
'························· Status·1 = permit parallel inputs
'
' PBASIC Pin Assignments (arbitrary)
'
'Stamp Pin·· 4021 Pin·· PBASIC Shiftin Function
'·· Port······· Number
'
····
···
'··· 0············· 10······· ·Serial clock pin
'··· 1·············· 3········ ·Serial data pin
'
'Ancillary pin(s) for accessing 4021 Shift Register
'
'Stamp Pin·· 4021 Pin··· Ancillary Function
'·· Port······· Number
'
···
·····
'··· 2·············· 9··········· Parallel/Serial latch
'
'======================================================================
<code/>
See if there are any question thus far.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
edit: looking at the schematic you could just cut the IC and ut all the wires going to VDD, then use the IC pads for the 8 wires going to the switch. An easy way to get a nice 9 wire cable is to buy a Serial extension cable
You may be in deeper than you realize already. There hasn't been ANY CODE offered that I can see. That which I offered above is nothing but documentation! There isn't one executable instruction in the entire lot.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (Bruce Bates) : 5/31/2006 12:35:01 PM GMT
Taking shortcuts is no fun, you'll be surprised at how much simpler and cleaner interfacing the NES controller the way it was meant to be, really is...as well as learning a thing or two.
Good luck!
So now that you know what your doing its time to connect the pins.
NES pin 2 - Brown wire - Ground - Vss
NES pin 7 - White wire - +5 volts - Vdd
NES pin 5 - Yellow wire - Clock - Stamp I/O Pin 2
NES pin 7 - Red wire - Serial Data - Stamp I/O Pin 0
NES pin 3 - Orange wire - Latch - Stamp I/O Pin 1
Now just run the program and keep the stamp connected to the commputer.
You could change ADres to a byte value because theNES contoller is 8 Bit. You can also change the mode if you want. This program should debug the the serial data from the controller and show it to you in decimal and binary form.
Also, I included a picture of the connector I used to hook everything up. Its a D-Sub connector that you can solder wires to. I think I got it from Radio Shack, but I would not recommend them their prices are outrages.
Well, if you followed the above post, then it looks like you connected +5V to the STAMP Pin 0 !!
NES pin 2 - Brown wire - Ground - Vss
NES pin 7 - White wire - +5 volts - Vdd
NES pin 5 - Yellow wire - Clock - Stamp I/O Pin 2
NES pin 7 - Red wire - Serial Data - Stamp I/O Pin 0
NES pin 3 - Orange wire - Latch - Stamp I/O Pin 1