I've an usb IMU (inertial measurement unit) for videogame applications and Windows detects it as usb input device and loads it in the HID devices section (Control Panel). Since it has not any COM port allocation, how can i read its raw data by matlab (or simulink) ? I tried with Instrument Control Toolbox but it requires a COM port adress. Thanks.
Related
I want to send data through USB between STM32 and Raspberry Pi. I don't want to use USB to Serial convertor, but instead have a actual USB Connection (maybe CDC class). I have to send data at high rate (Full speed). Please guide on how to achieve this?
A USB-serial connector is simply a microcontroller implementing a USB CDC/ACM virtual COM port and bridging to a UART which you would connect to a microcontroller's UART interface.
In your case you can simply implement the CDC/ACM directly on the STM32 using either of its USB device controller peripherals (USB support varies depending on the specific device https://www.st.com/resource/en/application_note/dm00296349-usb-hardware-and-pcb-guidelines-using-stm32-mcus-stmicroelectronics.pdf).
How you actually implement that will depend on what specific part, and what library or framework ecosystem you are using (e.g. SPL, CubeMX, Mbed). There are reference implementations, examples, drivers and libraries for all of these.
Your milage may vary, but I have measured ST's own USB library and example CDC/ACM virtual COM for STM32F1xx on a 72MHz MCU achieving 700kbits/s. Note that the performance is independent of the baud rate you might set on the host when you open the he VCP. Setting the baud rate simply sends a control packet to the device that can be used to set the baud rate of a UART in bridging applications. In your case such control packets can be ignored. There are similar packets for modem control signals such as DTR, RTS, CTS and RI, which you might choose to us for flow control or other signalling.
I have an analog to digital converter (ADC) MCP3008 connected to Raspberry PI 4 via SPI interface.
I need to process the signal from ADC in ODAS library (Open embeddeD Audition System).
ODAS is capable to process signal from a device in real time, but requires the device to be a soundcard.
Therefore I need to make Raspbian recognize SPI input from ADC as a soundcard.
After googling I found out that I need to write a device tree overlay to describe the soundcard.
I read about device tree overlays and viewed the device tree specification, but still can't figure out, which nodes and properties should I describe in the overlay?
Are there any USB devices that can be connected with a Linux Softphone?
These USB phones are enumerating as USB composite device: sound device and some control device, usually custom HID.
Audio part should work with virtually any softphone (e.g. command line baresip or pjsua). One I have (EX-03) has not the best sound quality as it supports only 8kHz sampling, but in general they should be fine for telephone calls.
Control part (receiving events from keybord, using ring speaker or display if present) may be tricky to handle as it may be impossible to find any documentation. If you are lucky you may find other software (e.g. skype control software included on CD) that works with this particular USB phone and then use USB sniffer to analyze packets / protocol.
i cannot figure this out by myself. What is the point of the RTS (direction) line in the RS485 ModBus communication?
There is no description about it on the internet, all the images in google only show the RX & TX lines but i know that RTS is also used.
Thanks
The only use of RTS in the context of RS485 based communications is so-called RS485 Transceiver Control (see for example the related Docklight RS485 setting). In Microsoft Windows API for serial communications, this mode is called RTS_CONTROL_TOGGLE:
Specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low.
It has nothing to do with the 2-wire RS485 bus and the MODBUS application protocol used on such a bus. But some older RS232-to-RS485 (or USB-to-RS485) converters require the RTS signal to be set to high before transmitting any data, and reset it to low for receiving data.
Most standard RS485 interfaces and converters for PC can handle this switch between transmit and receive automatically, so they don't need the RTS at all. Just for example - For the popular MOXA brand this is called ADDC (Automatic Data Direction Control).
Is there a way to receive the data sent over USB to PC using HID protocol in MATLAB? I tried the host hid receiver block found in STM32 blockset in Simulink but it gives an error saying that STM32 device not found so I guess that blockset is spesific for a STM32 device.
Under Linux, you can read from /dev/input/mice. It covers position data and clicks. You might need to adjust the reading privileges of the device file.