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.

Can't get RTS pin to work

Other Parts Discussed in Thread: TM4C129XNCZAD

Hello,

I'm using a TM4C129XNCZAD in an RS485. I'm using Uart3. I need to have the TX Enable for communication, but I can't get the Uart3RTS to work.

I enabled it using this code:

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);

GPIOPinConfigure(GPIO_PJ4_U3RTS); //TX enable RS485, PJ4

GPIOPinTypeUART(GPIO_PORTJ_AHB_BASE, GPIO_PIN_4 );

UARTModemControlSet(MODBUS_UART_BASE, UART_OUTPUT_RTS);

But I can't see the pin going high when I transmit data.

Also, I tried to enable the EOT interrupt, but doesn't work, I can see data flowing through the UART, but after the end of all bits, I don't enter in interrupt. I enabled it in this way:

#define UART_INT_EOT 0x800 // End of Transmission Interrupt Mask

UARTIntEnable(MODBUS_UART_BASE, (UART_INT_RX | UART_INT_RT | UART_INT_TX | UART_INT_EOT));

Can you help me?

Thanks

  • Mattia Berton1 said:

    UARTModemControlSet(MODBUS_UART_BASE, UART_OUTPUT_RTS);

    But I can't see the pin going high when I transmit data.

    First, I think you misunderstand how the RTS works, it is not automatic. RTS is controlled by you. For automatic control you need the UARTFlowControlSet call.

    Second, are you sure UART 3 has modem control signals?

    Third there is no separate end of transmission interrupt.

    Robert

  • So, if I don't misunderstood:

    1) For RTS I mean a way to set a pin during transmission and reset after. How can I implement in the microcontroller? I tried to do:

        UARTModemControlSet(UART3_BASE, UART_OUTPUT_RTS);
        UARTFlowControlSet(UART3_BASE,UART_FLOWCONTROL_RX | UART_FLOWCONTROL_RX);


    but without success.

    2) According to datasheet, it has RTS and CTS (also according to UART3:UARTPP register)

    So, my question is: "how can I set the pin during data transmission?"

  • Mattia Berton1 said:
    So, my question is: "how can I set the pin during data transmission?"

    You have to write the SW to do that. The RTS in auto sets when there is room in the FIFO and CTS control sending.

    Mattia Berton1 said:

    1) For RTS I mean a way to set a pin during transmission and reset after. How can I implement in the microcontroller? I tried to do:

        UARTModemControlSet(UART3_BASE, UART_OUTPUT_RTS);
        UARTFlowControlSet(UART3_BASE,UART_FLOWCONTROL_RX | UART_FLOWCONTROL_RX);


    but without success.

    Really a more complete description than "doesn't work" is more likely to be fruitful.

    And all of this is in the manual. What part of the manual(s) made you believe that RTS would be set on transmission? The TIVAWare documentation on UARTFlowCOntrolSet is quite clear.

    Robert