Skip to main content
Explorer
February 15, 2023
Question

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

  • February 15, 2023
  • 1 reply
  • 4127 views

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

    This topic has been closed for replies.

    1 reply

    Graduate II
    February 15, 2023

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

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

    User2501Author
    Explorer
    February 15, 2023

    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.

    Graduate II
    February 15, 2023

    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?