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/TM4C1294NCPDT: Receiving GPS data in PC serial port and ARDUINO UART Port also, but not receiving the GPS Data in TM4C1294NCPDT UART PORT

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Tool/software: Code Composer Studio

Hii

When I am communicating GPS(ORG1411-PM04) with Arduino and PC, we are successfully receiving the GPS DATA  but through TM4C1294NCPDT UART  we are not receiving the correct data.

You can go through the below screenshot PC Serial PORT 

Below is the screenshot of TM4C1294NCPDT UART data

Below is the code which I am using for GPS communication

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "inc/hw_gpio.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "utils/uartstdio.h"
#include "utils/uartstdio.c"
#include "driverlib/uart.h"
#include "inc/hw_uart.h"

/**
 * main.c
 */

uint8_t gps_data[1000],ch1[80],gps_data1[100],ch;
uint32_t ui32SysClkFreq,i=0;
void ON_OFF(void)                                                   // ON_OFF Pulse Generate
{

    SysCtlDelay(20000000);        
    GPIOPinWrite(GPIO_PORTP_BASE , GPIO_PIN_2 , GPIO_PIN_2);
    SysCtlDelay(20000000);        
    GPIOPinWrite(GPIO_PORTP_BASE , GPIO_PIN_2 , 0);
    SysCtlDelay(4000000);        
}
void GPS_Init(void)
{
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	GPIOPinConfigure(GPIO_PA6_U2RX);
	GPIOPinConfigure(GPIO_PA7_U2TX);
	GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_6 | GPIO_PIN_7);
	UARTConfigSetExpClk(UART2_BASE, ui32SysClkFreq ,4800,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
}

int main(void)
{
	ui32SysClkFreq = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
	GPS_Init();
	ON_OFF();
	while(1)
	{
    		 if(UARTCharsAvail(UART2_BASE))
    		    	gps_data[i++]  = UARTCharGet(UART2_BASE);
	
		if(i==1000)
			i = 0;

	}
}

Kindly help me out from this problem

Thanks & Regard

Anamika

  • Hello Anamika,

    Your UART setup seems to be fine, so if you are getting the wrong data, my first suspicion is that the baudrate isn't set correctly. Are you certain that the GPS should use 4800? That seems very low for a GPS module to me.

  • I ran into an interesting issue when looking at your problem. I used an older EK-TM4C129XL launchpad and also had trouble receiving on PA6 when I connected to the pin X8-16 on the booster pack connector. It worked fine when I connected to the edge connectors (X11-25). On the newer launchpad with PCB revision A, I did not have this problem. Here is a picture of the old and new launchpad PCBs to help you identify which version you have.

  • Hello Anamika,

    Have you made any progress on solving this issue?

  • Hello Anamika,

    As we haven't heard back from you, I’m assuming you were able to resolve your issue.

    I will close this thread now, but if you have not solved this issue then post a reply below (or open a new thread if the thread has locked due to time-out).

  • Hii Bob Crosby

    Sorry for the late response.

    I am using EK-TM4C1294XL Rev- D

    As I observed when I am pressing hard on UART2 pins then  I am able to receive the GPS data correctly, may be its the problem of loose connection.