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.

TM4C1294NCZAD use RTSCTS flowcontrol problem

Other Parts Discussed in Thread: TM4C1294NCZAD

hi, i am suing TM4C1294NCZAD, and designed a board using RTSCTS hardware flowcontrol, but encounter 2 problem.

1. how could i configure UART0  and use this RTSCTS flowcontrol?

in my code, i wrote like this,

first configure rts and cts pin 

ROM_GPIOPinConfigure(GPIO_PB5_U0RTS);
ROM_GPIOPinConfigure(GPIO_PE6_U0CTS);
ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_5);
ROM_GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_6);

UARTFlowControlSet(g_ui32UARTBase[ulPort], UART_FLOWCONTROL_TX | UART_FLOWCONTROL_RX);

then when i want to insert RTS , use

UARTModemControlClear(g_ui32UARTBase[ulPort], UART_OUTPUT_RTS);

UARTModemControlSet(g_ui32UARTBase[ulPort], UART_OUTPUT_RTS);

could this work to change RTS pin status?

2. when i enabled RTSCTS, i use UARTDisable(), the program will stuck in it, and it will wait for the data in tx fifo get out. but how could i clear the fifo and pass this step?

the code in UARTDisable listed below.

void
UARTDisable(uint32_t ui32Base)
{
//
// Check the arguments.
//
ASSERT(_UARTBaseValid(ui32Base));

//
// Wait for end of TX.
//
while(HWREG(ui32Base + UART_O_FR) & UART_FR_BUSY)
{
}

//
// Disable the FIFO.
//
HWREG(ui32Base + UART_O_LCRH) &= ~(UART_LCRH_FEN);

//
// Disable the UART.
//
HWREG(ui32Base + UART_O_CTL) &= ~(UART_CTL_UARTEN | UART_CTL_TXE |
UART_CTL_RXE);
}

i use 6911 before, and i want to use tm4c now to implmented program into this platform.  

very thankful for your suggestions!

  • Hello Rubin

    Yes, the UARTModemControlSet and Clear function shall be used for RTS flow control

    However UARTDisable will disable the UART operation. Instead if you want to use the RTS/CTS then you need to check the RTS and CTS status before sending a data. Is the TM4C12x device a DTE or DCE?

    Regards
    Amit
  • hi Amit,
    the tm4c12x device is a DCE, we are making serial device server using this chip.
    i finally solved this problem. it's because there is a mistake about my rs232 cable, it's male to male, 2 and 3 crossed, but 7 and 8 not, after i cross it, it act normal.
    thanks for your help, Amit.
  • Hello Rubin,

    I agree and that is a important input that you have shared (I know cb1 and others have pointed that in the past)

    Regards
    Amit
  • Hi Rubin,

    UARTModemControlSet(g_ui32UARTBase[ulPort], UART_OUTPUT_RTS);

    Flow control is bidirectional like (Xon/Xoff). The Host has to Poll or monitor signal CTS order to know when it is ok to send again data.

    Amit asked; DTE or DCE yet virtual piped com ports and most terminal emulators can reverse CTS/RTS setting to make your code work.