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/EK-TM4C123GXL: Strange output when reading from GPS module gy-neo6mv2

Part Number: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hi 

I am having a connection with uart (interrupt) to a GPS module and everything works fine except for I am getting a weird reading on the serial console.

I want to know how to get like a useful type of the coordinates sent by the GPS

here's the code for UART configuration

// uart0 configuration -> pc serial
void ConfigureUARTSerial(void) {
//    uint32_t g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
//                        SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
//                        SYSCTL_CFG_VCO_480), 120000000);
    // Enable the GPIO Peripheral used by the UART.
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    // Enable UART0
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    // Configure GPIO Pins for UART mode.
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    // Initialize the UART for console I/O.
    UARTStdioConfig(0, 4800, 120000000);
}

 and here's the code for ISR 

//PP0 -> RX , PP1 -> TX
void GPSPosition(void)
{
    uint32_t ui32Status;
    ui32Status = UARTIntStatus(UART6_BASE, true);       //get interrupt status
    UARTIntClear(UART6_BASE, ui32Status);               //clear the asserted interrupts
    gucRxChar = UARTCharGet(UART6_BASE);
//    printf("Coordinate : %c",gucRxChar);
    // i want to print the content here to the serial console
    UARTCharPutNonBlocking(UART0_BASE, gucRxChar);
}

here how the output looks like

thanks in advance 

  • It looks like a baud rate problem. Make sure you configure terminal to the same baud rate as you used on the TM4C123.

  • hello Bob

    thank for your reply, but i dont think this is the problem. iam sure i have the right baud rate at the terminal, see here please

    i also change it to 14400 and 9600 and still the same, just differs in the speed of the readings and the printing 

  • Then are your really running at 120MHz? I see a function "clock_change()" in your last post. The third parameter in UARTStdioConfig() needs to be the current system clock frequency in Hz so that it can properly set the baudrate you requested. If the system clock is only 25MHz, then it should look like this:

     UARTStdioConfig(0, 4800, 25000000);

    Another option is to change the UART clock source to the PIOSC (precision internal oscillator), which is 16MHz.

    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
    UARTStdioConfig(0, 4800, 16000000);

  • hi Bob

    thanks again for your perfect answer. it worked with me with the PIOSC.

    I just want to know why it didn't work with only 16MHz and worked when I used the PIOSC? what is the difference

    also for if future reference if someone stumbled at the same point, the GPS module works better at 9600 baud rate, not 4800.

    Best regards
    Hesham