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.

Cannot Configure UART0 in TM4C1294NCPDT

Please check the following code for configuring uart0 in TM4C1294NCPDT. Its sending data out.

main()
{
SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
UART_INIT();
}

void UART_INIT (void) 
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

UARTDisable(UART0_BASE);
UARTFIFODisable(UART0_BASE);
UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |UART_CONFIG_PAR_NONE));

GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0); // U0RX
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_1); //U0TX

GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinConfigure(GPIO_PA0_U0RX);
UARTFlowControlSet(UART0_BASE, UART_FLOWCONTROL_NONE);

UARTFIFOEnable(UART0_BASE);
UARTEnable(UART0_BASE);

UARTCharPut(UART0_BASE, 'A');
UARTCharPut(UART0_BASE, 'T');

}

Please do respond asap...


Thanks
Mary Ann

  • Sorry ITs not transmitting / receiving
  • Hi,

    Please see in your Tiva/ examples/boards/your_board/uart_echo project - just import it in your tool chain to have a good configuration.

    Also, your main function could be good for DOS programs, but not for embedded world - here you do not have an operating system to allow you to get out of main, so your micro must spin only in main. Something like this:

    main()
    {
    SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
    UART_INIT();

    while(1){;}

    }

    Also, useful to read the user manual - see the UART FIFO - how deep is, compare with your configuration. If you need to send only two characters, maybe will be a good idea to disable the FIFO, but after enabling the UART, since this function implicitly enables the FIFO.

  • Mary Ann,

    SysCtlClockGet() does not work on TM4C129 devices.
    See this thread:
    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/324693

    Randy