0
\$\begingroup\$

I want to send data from PC to microcontroller via USB and vice versa with Communication Class. I have used USB to Serial applications like Putty or RealTerm but they work only for COM Port and not for simple USB.

I found a similar question it explains but doesn't answers the problem.

Here is a python module which does similar but isn't installing on my Windows 10 x64 (tried many methods)

If you know some similar application or module please let me know about it.

\$\endgroup\$

closed as too broad by Elliot Alderson, Bimpelrekkie, Chris Stratton, Rev1.0, StainlessSteelRat Mar 13 at 17:17

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ You want a USB-to-UART bridge. They're readily available and not very expensive. \$\endgroup\$ – Hearth Mar 12 at 13:50
  • 1
    \$\begingroup\$ they work only for COM Port and not for simple USB. Uhm, USB is much more complex. It does not support serial (AT?) commands directly like a COM port does. What is possible is to emulate a COM port over USB but that requires some USB to "something else" hardware, like for example an FT232RL chip. \$\endgroup\$ – Bimpelrekkie Mar 12 at 13:52
  • 2
    \$\begingroup\$ You either need to implement something like USB-CDC in your embedded side, or write custom PC software to talk whatever USB protocol you devise and implement instead. \$\endgroup\$ – Chris Stratton Mar 12 at 13:53
  • \$\begingroup\$ A communications class device IS a regular serial ("COM") port as presented to you by the operating system. \$\endgroup\$ – filo Mar 12 at 16:30
1
\$\begingroup\$

All microcontrollers have a hardware UART or the possibility of bitbanging one. The easiest way to get some data to a PC would be to add a USB-UART bridge, and then just open the COM/TTY port in python to transfer the data according to a protocol that you define.

USB-UART bridges are supported by all modern operating systems and integrate without issues. If you were to design your own method of connecting the microcontroller directly to the USB, it would require you to thoroughly understand the USB protocol, and frankly that is not worth the time required to learn it.

SPI and I2C bridges are available as well, but not as easy to implement.

\$\endgroup\$

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