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.

CCS/TM4C123GH6PM: UART with Analog Discovery

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hey! So I have what's hopefully a quick question. I successfully used UART0 to send data to PuTTY. Then I tried to use another UART in order to send data to my Analog Discovery module (as a first stage before sending data to an ESP8266 Wifi module). However, I am not getting any data on my Analog Discovery. I am confident that the Analog is set up correctly because I have used it for a similar task in a previous project. 

Below is the code where I configure the UART module. I am using UART7 in the code below simply because I tried going through all of the others already. The code is a modification of the TI usb_dev_gamepad.c example code.

void ConfigureUART(void)
{
    //
    // Enable the GPIO Peripheral used by the UART.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);

    //
    // Enable UART7
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);

    UARTDisable(UART7_BASE);
    //
    // Configure GPIO Pins for UART mode.
    //
    GPIOPinConfigure(GPIO_PE0_U7RX);
    GPIOPinConfigure(GPIO_PE1_U7TX);
    GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART7_BASE, UART_CLOCK_PIOSC);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, 16000000);

    UARTEnable(UART7_BASE);
}

And here is the section of code where the data is sent

void sendData()
{
    UARTprintf("%d.%d%d%d\n", ones, tenths, hundredths, thousandths);

}

Thanks!

  • Cole Mowrer said:
    UARTStdioConfig(0, 115200, 16000000);

    The first argument for the UARTStdioConfig() function in the UART port number to configure, so the above example code should be:

        //
        // Initialize the UART7 for console I/O.
        //
        UARTStdioConfig(7, 115200, 16000000)

    Note that the utils\uartstdio.c which comes with TivaWare supports only UARTs 0-3 by default. To be able to use UARTs 4-7 the g_ui32UARTBase[], g_ui32UARTInt[] and g_ui32UARTPeriph[] arrays in utils\uartstdio.c need extending.

  • Wow. Can't believe I missed that. Gotta pay attention to those details! Thanks so much yet again!!