Shop OBEX P1 Docs P2 Docs Learn Events
Propeller as controller button — Parallax Forums

Propeller as controller button

I have a cheap usb “snes controller” that I want to use for usb input on my computer through a propeller chip. So instead of a person pushing a button on the controller, I want the propeller to control the button. I have taken apart the controller and I found the contact pads. How do I interface the contact pads to the propeller? I can solder wires to the pads, but how do “hook up” the wires to the propeller? Thank you for any suggestions

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2020-07-30 22:34
    The safest bet is to have the Propeller control relays to make the desired connections.

    You might be able to use a simpler approach if the hardware allows. A lot depends on the way the controller poles the switches. Often times the switches are multiplex which makes controlling a switch with direct connection callenging.

    Here's a link to an old project of mine. I used relays and an old cell phone to allow a Propeller to send text messages. There are a zillion better solutions to the one I used but my solution sure made a lot of fun relay noise.

    Edit: The cell phone buttons were multiplex. I couldn't figure out a way to simulate a button press without using the relays.
  • Generally, one side of each button pad will be going to ground, the other into a pulled-up input pin on the IC.

    To simulate a press on such a buttons, simply pull the input side of the button circuit low. Since the controller is most likely using 5V, you might need to use some kind of transistor circuit to do it.
    (Another note: if you are not powering the propeller from the same computer's USB ports, you must also connect the grounds together)

    Also, if you simply want to give controller inputs to the PC, you can bypass the middleman and use some software on the PC to accept inputs over the Propeller's COM port. See the instructions and Spin code for my SNES2COM program (which is designed to read a real SNES controller and make it available to the PC)
  • Wuerfel_21 wrote: »
    Generally, one side of each button pad will be going to ground, the other into a pulled-up input pin on the IC.

    This makes life easier.
    Nevermind my relay suggestion.
  • Thank you for the info

    After some research I might have found another approach. I’m trying to interface the propeller to a raspberry pi (not serial) but as a joystick/keyboard (HID). Adafruit has some software that will use raspberry pi gpio pins to make keyboard functions. https://github.com/adafruit/Adafruit-Retrogame This should work for my project...however, can I just directly hook my propeller output pins to the rpi gpios? Then I could skip using the cannibalized game pad
  • Yes, you can directly hook propeller pins to raspberry pins, but ideally put some 3k-ish resistors in series for safety.
  • Why don't you just use serial? Doesn't anybody have a program that runs on the Pi that reads serial input and turns it into keyboard input?
  • ti85ti85 Posts: 44
    edited 2020-08-21 02:35
    Hey...I’m getting back to this project. I got the raspberry pi program to run correctly with push buttons. To refresh, I have a c program on the raspberry pi that reads each gpio and is mapped as keyboard inputs using uinput. The gpio pins have pull-ups on the input pins and the buttons are connected to ground. It works perfectly.

    Now, I want to have the propeller chip Simulate the push buttons by using the propeller pins as output. I’m planning on using 3.3k serial resistors between the rpi gpio and propeller pins. However, my next question is related to powering the two devices. The propeller will be powered by usb on my computer(QuickStart board) and the rpi is powered by an external wall plug. So, do I need to have a common gnd between the two devices, in addition to the gpio pins?
  • ti85 wrote: »
    I’m planning on using 3.3k serial resistors between the rpi gpio and propeller pins. . . . So, do I need to have a common gnd between the two devices, in addition to the gpio pins?

    The 3.3K resistors really only needed if you're using the Propeller with a 5V device. The RPi uses 3.3V logic and as long of the pins are set as input, a resistor isn't really needed. 100 ohm resistors could be added if you wanted to be extra safe.

    The 3.3K resistors could cause problems in some scenarios. I personally think you'd be better off not using resistors.

    Yes, you need to have a common ground between the two devices.

Sign In or Register to comment.