0
votes

I am working on my personal project for an oscilloscope, where I send bulk data from MCU(STM32) to PC through USB Full-Speed (12 Mbits). I would like to communicate with the device(STM32) by using PySerial. I found out that USB is half-duplex, where the host (PC) sets talking privileges with the device - "speak when you're spoken to". What I don't understand is how does the host set the talking privileges - Does my computer or pyserial automatically handle this, or do I have to do some handshaking protocol that needs to be implemented in code in both the host and device? I'm wondering since in the event both device and host are sending data, what happens to the data? Thank you!

1

1 Answers

0
votes

On your PC you do not have to worry about the USB protocol. That is the responsibility of the USB stack in your OS and the associated USB device drivers.

So you just use PySerial to send and receive your data.