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



