cancel
Showing results for 
Search instead for 
Did you mean: 

Can I connect my STM32 to another device who has input USB-TTL converter?

User2501
Associate II

Hello,

I'm currently trying to receive some data from device #2 (legacy device, not a PC) with my uC STM32 (device #1). But in order to receive the data I need to generate a pulse in the DTR pin or CTS (both are connected in the device #2) on the converter USB to TTL of the device.

0693W00000YAmC6QAL.jpg 

I can communicate with the device #2 using the serial communication software like Docklight Scripting by using the Manual RTS/DTR control but I need to do this with the STM32 and for that I am using the USART1 of the STM32 that will be connected to a TTL to USB converter as shown in the [Figure1] where I setup a GPIO to connect to the RTS pin of the converter of the device #1, where I want to generate a pulse of x milliseconds in the CTS/DTR of the device #2 but it doesn’t work.

So, my second attempt was to connect an external converter (device #3) to the device #1 and check all the pins of device #3 with a logic analyzer to see if I manage to generate a pulse in the DTR or CTS pin of device #3 but it didn’t work. I even connected the device #3 with the software Docklight scripting and I can see the pulse generated in the DTR pin with the logic analyzer when I press the DTR button in the software.

0693W00000YAmCBQA1.jpg 

I'm thinking I need some kinda drivers to detect the COM port of the converter but I am not sure if I can do this with directly from the STM32

7 REPLIES 7
Javier1
Principal

So youre trying to code an USB CDC host in your stm32?

https://controllerstech.com/usb-cdc-device-and-host-in-stm32/

we dont need to firmware by ourselves, lets talk

Yes, but I dont know what I have to do in the STM32 side to generate the pulse in the CTS or DTR in the device #2 through the USB.

you caught me there....

Never used those CTS or DTR lines.

It is my theoretical understanding those lines are used for Flow control CTS stands for clear to send (the USB slave-device manages this line) and DTR stands for ready to send (the USB host-master manages this line).

I never used them but i know they are supported by the stm32's builtin USB peripheral, but youre not using the native USB peripheral from your stm32 so it boils down to your TTL-USB converter FT232R.

0693W00000YAmcoQAD.pngHow are you connecting those lines, maybe post some pictures or wiring?

we dont need to firmware by ourselves, lets talk

Well, I have two options to use USART - USB bridge or directly the USB peripheral. But I abandoned the USB peripheral option because I don't know how to generate the pulse on the CTS pin of device #2. If you know how to do this with the stm32 built in usb peripheral library and if it works I can discard the usart to usb bridge option.

>> If you know how to do this with the stm32 built in usb peripheral library and if it works I can discard the usart to usb bridge option.

Sounds like something you need to try out

https://community.st.com/s/question/0D50X00009XkYXrSAN/flow-control-with-usb-cdc-or-nacking

we dont need to firmware by ourselves, lets talk

Do you know if the stm32 as an USB host can detect an TTL-USB converter of the device #2 ? Because normally for a PC you need to install some drivers in order to for the computer to detect it but not sure with the microcontroller...

Hello, I`m sorry that isn't answer. I want to ask have you found some solution to connect ttl to stm32?