2022-05-23 10:09 AM
Actually, my aim is to get data from a digiducer sensor with STM32F0 via USB port and can't understand how.
2022-05-23 10:40 AM
The sensor connects via USB?
Does you STM32F0 provide for a USB HOST?
It it does assume you'll need to write a suitable CLASS DRIVER
2022-05-24 3:04 AM
yes the sensor connects only with USB.
and when i was searching for the right STM32 MCU to get data from this connector, i found the STM32F0 that has inside a USB device as shown in the figure below.
is there any piece of help about this CLASS driver to base on or a helpful document to assume this USB communication?
2022-05-24 4:08 AM
You know what you're doing?
In the headline you write about "microphone USB", in the description you mention a USB sensor.
USB device means that you can connect it to a USB host (for example a computer), not that you can connect other USB devices, such as your sensor.
2022-05-24 4:41 AM
Thank you LCE for the explanation.
actually, according to my understanding, I thought that Microphone USB and My sensor ( in my case, a digiducer for vibration that has a USB connector) give the same data, that's why i mentioned both of them.
I'm a student and I'm working on an academic project in which i have to read data from this sensor with STM32F0. via USB and don't know how.
if you can guide me, I will be so thankful.
2022-05-24 5:33 AM
> i have to read data from this sensor with STM32F0. via USB
You cannot.
As I said: STM32F0 is a USB device only, as far as I understand the STM32F0 website.
You need an STM32 with USB host / on the go capabilities, which the STM32F0 does not have.
Maybe the assignment is a little bit different, like:
connect a sensor (not via USB) to an STM32F0, then send sensor data from STM32F0 via USB to PC.
?
2022-05-24 6:50 AM
@amlok.1 "I'm a student"
Then you should be going to your teacher/supervisor for assistance: they know you, and the task you've been assigned, and the resources available to you - we know none of that.
"i have to read data from this sensor with STM32F0. via USB"
As the others have said, you cannot.
A USB connection always consists of a Host, and a Device (ignoring Hubs for now).
Your sensor is a USB Device - therefore you will need a USB Host to connect to it.
As it says in the diagram you posted, the STM32F0 is also a USB Device - it cannot connect to another USB Device.
This is fundamental to the way USB works - it is not anything specific to the STM32
https://en.wikipedia.org/wiki/USB#System_design
2022-05-24 8:06 AM
ok, now I understand what you said.
in my case, the sensor( digiducer) can only be connected by USB. I need to get data from it and stock it in an MCU ( if you can suggest me a host that can work among the STM MCUs ).
2022-05-24 8:10 AM
Thank you @Andrew Neil for the clarification.
Do you know an MCU that can get this data for my sensor via USB because this is the only way it can connect?
2022-05-24 8:31 AM
I don't have an extensive list, perhaps you can do a parametric search on the part via the website, but the F2, F4, F7 and H7 all have models which support USB HOST, and USB DEVICE operational modes.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.