0
\$\begingroup\$

(Modified repost from stackoverflow since it might be more suited to this site)

I wanted to try building an arcade stick starting as simple as possible(ICs and basic electronic components as opposed to using an arduino board and the like) and use it on my computer, mostly just for the sake of building it.

The problem is that I know programming and basic circuitry, but I have no idea how both are connected. I already have a few scrapped male USB connectors and I have the circuit design pretty much done, the circuit would use a clock to generate a wave (something like pot 1, pot 2, button 1, button 2, repeat), but I'm not sure if the driver would be able to use that input in anyway.

So, how exactly would one go about getting a circuit to output information that a driver would be able to read? Does it read it in a binary high low way or does it read something like the amperage, allowing me to, for example, link a pot to a computer and read the input?

\$\endgroup\$
  • 3
    \$\begingroup\$ USB is an intelligent protocol that requires a microcontroller on the device end, since it has to send reports in the USB protocol. Arduino is about as simple as it gets in this case. \$\endgroup\$ – Ron Beyer Feb 9 '18 at 4:23
  • \$\begingroup\$ You need to use what you have learned to work. The lowest level hardware to the desktop has the biggest learning step. In the old days with DOS and the parallel printer port , it was easy but slow or limited to 50K \$\endgroup\$ – Sunnyskyguy EE75 Feb 9 '18 at 4:45
  • \$\begingroup\$ Does it read it in a binary high low That is how computers interfaced to peripherals in the 1980s ! Now with USB and even RS232 the data is serialized and "packaged" in some protocol. So you almost cannot avoid using a microcontroller. I suggest you look at the Arduino Leonardo which has build-in USB. \$\endgroup\$ – Bimpelrekkie Feb 9 '18 at 7:36
  • \$\begingroup\$ You can buy USB "bridge" ICs (or better, modules) that simulate a serial UART with control lines at the "user end" and connect to USB. You can in some cases just use the control lines to send high/low binary data or send or receive RS232 serial. \$\endgroup\$ – Russell McMahon Feb 9 '18 at 9:40
1
\$\begingroup\$

You can buy USB "bridge" ICs (or better, modules) that simulate a serial UART with control lines at the "user end" and connect to USB. You can in some cases just use the control lines to send high/low binary data or send or receive RS232 serial.

This is an example of a device that provides serial connection to USB

PL2303HX USB to TTL RS232 COM UART Module Serial Cable Adapter for Arduino

Similar - here you can see the insides - which are probably similar
Cp2102 USB 2.0 to UART TTL 6pin Module Serial Converter Adapter Blue Silver N3

And here are many more
Many give you serial access only but some add control leads.

This one has DTR

Some/many DO have the extra signals on onboard pads but these may not be identified.
This one has them silk screened on.

WARNING - note that the correspondence of the top and bottom legends may be confusing. You would expect that the bottom view resulted from rotating the PCBA 180 degrees along the top edge.
The "Gnd" marking at the top left of the top view (probably) relates to the first through-hole next to SU2 and not to the pinned end connector.

From here

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Thanks, that seems simple enough to use. Just one last question though. From my understanding, it uses a "begin" signal and a "end" signal around the information, does the chip does that after a set amount of clock signals or is it programmable? (if it's used like that at all) \$\endgroup\$ – Yamph Feb 11 '18 at 4:49
  • \$\begingroup\$ @Yamph I assume you mean the RS232 begin and end signals. You can use a very crude method with RS232 to send a simple signal to a remote unit by eg sending all high or all low data words. All high results in a mostly high serial line and all low results in s significantly low mean level which can be detected. Having characters arriving continually makes these two states easier to detect. That is not how RS232 is meant to be used, of course. || You can also "loop back" RXD to TXD under switch control so that the PC does or doesn't see a returned data stream. | Better is to use a UART receiver. \$\endgroup\$ – Russell McMahon Feb 12 '18 at 9:25
  • \$\begingroup\$ @Yamph ... || BUT you can use some of the external handshake lines shown on the PCB to send DC levels. DSR & DTR MAY be able to be used this way. Also CTS and RTS. Have a look at a description of how RS232 works to see how these can be used. Possibly helpful , and Wikipedia \$\endgroup\$ – Russell McMahon Feb 12 '18 at 9:37
1
\$\begingroup\$

You cannot connect buttons to a USB connector. You will need some chip running USB software in between.

The method to interface buttons is by using USB HIB (human interface device). You mouse and keyboard are examples of this.

Find yourself an HID (human interface device) example board. (eg: mbed) That way your device can be a keyboard/mouse.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.