This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Determine if a UART device is connected



I have a program that will be configured from console through a UART, disconnected and set to run on a battery backed hibernation cycle.

There are many running messages that get kicked out at various verbosity settings. The simple plan is for the configurer to lower the verbosity to a point where no messages will attempt to print to console after configuring the device. This way the device won't be wasting time/power on print statements when nobody is listening.

This means that we will need custom configuration software to ensure that the verbosity is dropped post-configuration, and raised on connection. (Because if we leave this up to the configurer they will no doubt forget this step occasionally)

Before writing that extra code I thought I should ask if there is a way I can check, from the Tiva side, if there is anyone listening to that console UART. This way when the device wakes up from hibernation it could check to see if there is a console connection and enable/disable printing based on that. As far as I know it's not possible, but as far as I know there could be an indicator bit set somewhere.

  • If the wiring is purely RX/TX, I don't think there is any kind of a feedback signal available to the UART module. Two options come to mind: 1) have the listener say for example CR+LF when it connects, that would then wake up the printings 2) wire the RTS/CTS signals, and use real hardware flow control - not all UARTs have the pins available, though
  • Hello Jamie,

    The only check that can be made is that if the RX pin of the UART is high, then "may be" there is a driver on the other side.

    Regards
    Amit