1

noob here

So I managed to get my circuit to be a standalone circuit (as pictured below). I want to use this circuit as an input to a game on my computer. What I want to know is could this micro-usb breakout board https://www.diyelectronics.co.za/store/breakout-boards/2414-micro-usb-power-switch-breakout-module.html be used to communicate with the computer. Where would the data pins (d+/d-) connect to the atmega328?

Any help will be most appreciated circuit

  • ATmega328p is not a right choice for a game controller. from the ATmega family ATmega32u4 would be better (Arduino Leonardo and Micro). it has native USB with HID capability. but it is not available as DIP package – Juraj Dec 3 at 5:32
  • @Juraj So I would need a breakout board for the ATMEGA32u4? – user19964 Dec 3 at 5:36
  • Arduino Micro is a breakout board for 32u4. Micro Pro is even more compact (without the ICSP header) – Juraj Dec 3 at 5:37
  • @Juraj Ah okay, I will consider this option: thank you. – user19964 Dec 3 at 5:42
  • as I read in comments that it is a controller for a game you develop, then you can of course implement a basic Serial communication between your sketch on Arduino and your PC application – Juraj Dec 3 at 10:14
1

The ATmega328 does not have any native USB capability, so there is nowhere appropriate to connect D+/D- to the ATmega328.

Assuming you are emulating an Arduino Uno, then something like this:

https://www.jaycar.com.au/arduino-compatible-usb-to-serial-adaptor-module/p/XC4464

is what will come closest to mimicking the USB function on an Uno (ie a serial connection).

This shows how such a device would be connected:

https://www.jaycar.com.au/usb-serial-converter

  • Oh, so basically without a usb to serial adaptor, this won't be possible? Thank you for saving me time @user85471 – user19964 Dec 3 at 5:04
  • Yep. Long answer is that there may be a software USB implementation that allows this but you're better to look at something like an ATmega32u4, which is what is on a Leonardo, but they only appear to come in surface mount packages (but breakout boards exist). – user85471 Dec 3 at 5:10
  • does the ATMEGA32u4 have native usb capability? @user85471 – user19964 Dec 3 at 5:25
  • Something else to think about, there are many USB protocols. The linked to item in the answer likely uses a USB serial protocol. Keyboards use a USB human interface protocol. I assume gaming consoles which connect to computers using a USB port also use the USB human interface protocol. So the linked to device may not work. – st2000 Dec 3 at 5:26
  • You need to look at the chip specifications here. In the specifications it says: "Complies fully with Universal Serial Bus Specification Rev 2.0". However, note, that does not say what USB protocol is supported. That is up to the software. You need to do some leg work and figure out which USB protocol your game pad is using. Or if you can use your keyboard as the gaming input. – st2000 Dec 3 at 5:29

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.