Shop OBEX P1 Docs P2 Docs Learn Events
XBox Guitar Button Interface - Page 2 — Parallax Forums

XBox Guitar Button Interface

2»

Comments

  • NosePickerNosePicker Posts: 54
    edited 2008-07-17 12:01
    Well it almost works. For some reason its like the voltage is dropping below some threshold that the basic stamp can't detect. Keep in mind the pin will be = 1 when the button is NOT pressed and when the button is pressed it will drop to 0.·Using the following code, if I press Red it works perfect most of the time when I press blue it works perfect, but if I press Green, it usually reports that I pressed green and yellow. If I press yellow, it thinks I press green yellow and sometimes orange.
    While at the same time the basic stamp is reporting extra buttons being pressed the actual xbox game is working perfectly. It knows which buttons I am really pressing.


    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    INPUT 1
    INPUT 2
    INPUT 3
    INPUT 4
    INPUT 5

    MainLoop:
    IF IN1 = 0 THEN DEBUG "GREEN, ", CR
    IF IN2 = 0 THEN DEBUG "RED, ", CR
    IF IN3 = 0 THEN DEBUG "YELLOW, ", CR
    IF IN4 = 0 THEN DEBUG "BLUE, ", CR
    IF IN5 = 0 THEN DEBUG "ORANGE ", CR

    GOTO MainLoop

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks

    NosePicker
  • computer guycomputer guy Posts: 1,113
    edited 2008-07-17 12:22
    All I can suggest is trying my second circuit.
    The 10k resistor pulls the line to GND unless there is voltage on the line then the voltage overrides the pull-down resistor.
    Perhaps the drop in voltage on one pin is causing interference on the others.

    Try the second circuit and see how it goes.


    edit: I had the DEBUG CR on the last line so that each line represented what buttons are pushed. It was easier for me to read.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.

    Guitar Hero controller using the prop (WIP) --> HERE

    Post Edited (computer guy) : 7/17/2008 12:27:21 PM GMT
  • NosePickerNosePicker Posts: 54
    edited 2008-07-17 16:16
    Is the voltage threshold for the basic stamp 1.4v?
    Would it matter if I changed the 220ohm res. to a 100ohm res?
    I will try your other circuit and a couple of different things when I get home and let you know.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks

    NosePicker
  • agfaagfa Posts: 295
    edited 2008-07-17 23:14
    looks like you have posted pictures of two different controller boards.· Are you gathering your information from two different controllers?· Looking at the·pic of the switch board the red button's contacts·trace back to two adjacent wires on the cable such as 1&2, 3&4, 5&6, or 7&8 but your measurements seem to indicate a closure on pins 7&3.· try visually tracing the switch contacts back to the cable and post that information.· example red-1&2.

    If it is a matrix, because the way it is scanned, you would have to monitor both the rows and the columns to detect the specific switch closure assuming the scans are slow enough for the stamp to read.

    according to the Robotics with the Boe-Bot manual page 208 the threshold is 1.4 v.· I believe the manual is available online.

    edited:·
    If it is a matrix, because the way it is scanned, you·MAY have to monitor both the rows and the columns to detect the specific switch closure assuming the scans are slow enough for the stamp to read.· If the matrix is what computer guy posted then i would think that a single resistor per switch would work.· If it is being scanned you might·not see a continuous high (or low)·on the stamps input.· when you wrote that the program was'nt detecting the switches properly, my first thought was, that the matrix layout (if it is one) is different.

    good luck.


    Post Edited (agfa) : 7/18/2008 2:31:15 AM GMT
  • computer guycomputer guy Posts: 1,113
    edited 2008-07-18 00:46
    The 220ohm resistor is mainly there for protection against the BS2 pin becoming an output.
    If you are sure your code will never do this then a 100ohm resistor should be fine or you might even be safe to remove it completely.

    If my calculations are correct you should be home as of 45mins ago. I live in NSW Australia (GMT+10)
    Look forward to hearing how it goes. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.

    Guitar Hero controller using the prop (WIP) --> HERE

    Post Edited (computer guy) : 7/18/2008 2:34:52 AM GMT
  • NosePickerNosePicker Posts: 54
    edited 2008-07-18 02:38
    Very close now!!!!

    OK I removed the 220ohm resistors and it works better now but still not perfect. Here is the problem as you press more and more buttons then the controller seems to drop the voltage over all. What ever chip is built into the controller must be able to detect voltage below 1.4v because the controller is playing properly in the game so the Xbox knows exactly which buttons I am pressing. Computer guy, when I tried your second diagram it caused the xbox to lock up. After a reboot all was well but it gave me a scare. I am thinking connecting the pin (which is normally high) to the ground would falsely bring the pin down. But then again I know so little about this electric stuff its embarassing. I am mostly a software developer and I am looking forward to developing the software side of this project.

    For agfa, we are not dealing with a switch matrix with this controller. There is simply a board with built in traces that has anywhere from 3.5v to 1.2v on one side of the switch and the other side leads to a ground or something. There are 5 buttons and 5 separate traces with + voltage. They (for whatever reason) only have 3 traces which are (grounded or something). One button has its own - trace and of the other 4 buttons, 2 go to one - trace and the other 2 go to the other - trace. Because the buttons are located in the neck of a guitar shaped controller, the traces lead to a cable with 8 wires ( one for each trace ) which are then connected to a controller board with all the chips and what not on it. On any given button when the button is NOT pressed, (open switch) the + side will have 3.5v - 1.2v, when the button is pressed or the circuit is closed, then the voltage will drop to 0v. So the problem here is not detecting when it is pressed but instead detecting the marginal voltage to know when it is "not" pressed.

    Computer Guy
    My theory is this and I feel like this is the final hurddle to overcome. I beleive, under normal operation certain pins will have 1.4 volts or slightly less when the button is not pressed. The reason I think this is normal ( the way the controller was designed ) is because when I first started this project and was measuring the voltage this was common to measure around 1.4 volts. I tested 2 different controllers and get the same results with both controllers. Most of the time they will carry around 2.2v so that is why this appears to "mostly" work. With the stamp connected I measured the voltage on the pins while pressing buttons and some pins were in fact dropping to around 1.4v - 1.2v. So I belive the chips used in the controller can detect smaller amounts of voltage than the stamp. So I am thinking do any of you know of another chip I can use that has the same basic functionality but can detect voltages around 1.0v to be safe. Or is there a componet that can raise the voltage for the stamp to be able to detect.



    P.S. I am going to the Aqurium in Atlanta tomorrow then we are going to the Water park on Saturday so I will not be home till Sat night.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks

    NosePicker

    Post Edited (NosePicker) : 7/18/2008 3:21:50 AM GMT
  • computer guycomputer guy Posts: 1,113
    edited 2008-07-18 04:05
    You could use a transistor to take the voltage from the switch and pull it up to around 5v. Ideal for the prop.
    I have started another thread to ask for specifics on what value components to use.

    Have fun on your trip. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.

    Guitar Hero controller using the prop (WIP) --> HERE
  • computer guycomputer guy Posts: 1,113
    edited 2008-07-18 07:29
    Beau Schwabe suggested that a voltage divider might work.

    attachment.php?attachmentid=54616
    Beau Schwabe said...

    Since the I/O pin has a threshold of 1.4 Volts .. When the input voltage is 0V, the voltage divider produces about 0.9 Volts at the input to the I/O Pin. When the input voltage is 1.2V, the voltage divider produces about 1.88 Volts at the input to the I/O Pin.


    If that doesn't work then you could try a transistor.

    attachment.php?attachmentid=54617


    Hope it helps. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.

    Guitar Hero controller using the prop (WIP) --> HERE

    Post Edited (computer guy) : 7/18/2008 7:38:47 AM GMT
    828 x 440 - 9K
    843 x 470 - 9K
  • NosePickerNosePicker Posts: 54
    edited 2008-07-18 11:15
    OK so I don't get confused, which is easy for me to do, it looks like you are giving me 2 different things to try.
    Method 1. diagram 1 above
    Method 2. diagram 2 above

    Question 1 - Is diagram 2 what you are referring to when you say "use a transistor" because I see a transistor in the diagram?
    Question 2 - If question 1 is yes, then it appears the ground connects to the emitter, the BS pin connects to the collector and the switch connects to the base, is that correct?
    Question 3 - on diagram 1, R1 goes to VDD and on diagram 2, R4 goes to VDD, when you say VDD are you referring to pin 21 on the stamp?
    Question 4 - With the transistor, do I need the exact part 2N2222 or can I use either of 2N3904, 2N4401, KSP2222A, ·which I already have?

    P.S. I noticed on that other thread you said you had 1.2v when the button is pressed and 0v when released. I know it doesn't matter and you probably were just making your point but I thought just in case I would mention that the controller is the opposite. It is 0v when pressed and 1.2v when released. You probably already knew that but I thought I would throw that out there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks

    NosePicker

    Post Edited (NosePicker) : 7/18/2008 11:58:30 AM GMT
  • StraticusStraticus Posts: 4
    edited 2008-07-20 23:07
    Im also working on something similar to what you're doing Nose. Except I'm using a Stamp 1 Project board and a couple of SSR's. Let me know how its going [noparse]:)[/noparse]
  • computer guycomputer guy Posts: 1,113
    edited 2008-07-22 05:36
    1 - Yes diagram 2 is an example of using a transistor that should work for your project.
    2 - Yes that is correct.
    3 - Yes VDD is the regulated 5v from the stamp. If you are using the stamp on a breadboard/experimenters board then pin 21 is the only place to connect VDD. On dev boards such as the "Board of education" usually have about five pins for accessing VDD.
    4 - The 2N3904 should work, however I am not 100% sure. Try it and see.

    Thanks, I do realise I got the 1.2v and 0v around the wrong way. That message was typed quickly and I didn't re-read it.

    Hope this helps. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.

    Guitar Hero controller using the prop (WIP) --> HERE
  • computer guycomputer guy Posts: 1,113
    edited 2008-07-28 12:36
    How is the project going? smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.

    Guitar Hero controller using the prop (WIP) --> HERE
  • NosePickerNosePicker Posts: 54
    edited 2008-07-29 01:11
    Well I don't have any 15k resistors and the radio shack stores near by don't carry them either so I have to order them from somewhere. Also since the diagram only shows how to connect one of the switches I am not sure if I need a separate 15k resistor for each switch or just one and have all switches connect to the one. However I did more testing without any additional resistors and it seems to work most of the time, so I have actually began phase two of the project which is mostly software development. I have now written a windows program to capture serial data from the stamp and "record" the pin states along with the timing between each state change. I have also written the "playback" logic to send data via a serial port to the stamp and have it push the buttons for me. All I really will have left to do is to complete the circuit to add a transistor per switch to allow the stamp to complete the switch circuit in the controller.· I have a friend of mine that has me working on a project for him to remote control turning a computer on for him. So that project will have me side tracked for a few more days and I will be done with that. Once I get the guitar hero project finished I want to make a video and put in on youtube or something so you guys can see the finished project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks

    NosePicker
Sign In or Register to comment.