I have connected PmodGps to JA connector of zedboard. I have downloaded the pmod example code(Microblaze) and did a little modification for Zynq devices. The code is listed below. For some reasons the code does not seem to be working. (The build is finished but there is blank terminal. Its not going inside that while loop. Probably because GPS.Ping does not get any data).
And there is a minor warning in one of the files of BSP (bsp -> ps7_coretexa9_0 -> libsrc -> PmodGps_v1_1 - > src - PmodGPSselftest.c). I have attached the screenshots for better understanding.
Please help me with this.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/************ Include Files ************/
#include "PmodGPS.h"
#include "xil_cache.h"
#include "xparameters.h"
#include "xil_printf.h"
/************ Macro Definitions ************/
#ifdef XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ
#define PERIPHERAL_CLK 100000000 // FCLK0 frequency is not in xparameters.h for some reason
#else
#define PERIPHERAL_CLK XPAR_CPU_M_AXI_DP_FREQ_HZ
#endif
/************ Function Prototypes ************/
void DemoInitialize();
void DemoRun();
/************ Global Variables ************/
PmodGPS GPS;
/************ Function Definitions ************/
int main(void) {
DemoInitialize();
DemoRun();
return 0;
}
void DemoInitialize() {
GPS_begin(&GPS, XPAR_PMODGPS_0_AXI_LITE_GPIO_BASEADDR ,
XPAR_PMODGPS_0_AXI_LITE_UART_BASEADDR, XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ);
GPS_setUpdateRate(&GPS, 1000);
}
void DemoRun() {
while (1) {
if (GPS.ping) {
GPS_formatSentence(&GPS);
if (GPS_isFixed(&GPS)) {
xil_printf("Latitude: %s\n\r", GPS_getLatitude(&GPS));
xil_printf("Longitude: %s\n\r", GPS_getLongitude(&GPS));
xil_printf("Altitude: %s\n\r", GPS_getAltitudeString(&GPS));
xil_printf("Number of Satellites: %d\n\n\r", GPS_getNumSats(&GPS));
} else {
xil_printf("Number of Satellites: %d\n\r", GPS_getNumSats(&GPS));
}
GPS.ping = FALSE;
}
}
}
Question
Sridhar Prasath Aruppukottai Ganesan
Hello all,
I have connected PmodGps to JA connector of zedboard. I have downloaded the pmod example code(Microblaze) and did a little modification for Zynq devices. The code is listed below. For some reasons the code does not seem to be working. (The build is finished but there is blank terminal. Its not going inside that while loop. Probably because GPS.Ping does not get any data).
And there is a minor warning in one of the files of BSP (bsp -> ps7_coretexa9_0 -> libsrc -> PmodGps_v1_1 - > src - PmodGPSselftest.c). I have attached the screenshots for better understanding.
Please help me with this.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/************ Include Files ************/
#include "PmodGPS.h"
#include "xil_cache.h"
#include "xparameters.h"
#include "xil_printf.h"
/************ Macro Definitions ************/
#ifdef XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ
#define PERIPHERAL_CLK 100000000 // FCLK0 frequency is not in xparameters.h for some reason
#else
#define PERIPHERAL_CLK XPAR_CPU_M_AXI_DP_FREQ_HZ
#endif
/************ Function Prototypes ************/
void DemoInitialize();
void DemoRun();
/************ Global Variables ************/
PmodGPS GPS;
/************ Function Definitions ************/
int main(void) {
DemoInitialize();
DemoRun();
return 0;
}
void DemoInitialize() {
GPS_begin(&GPS, XPAR_PMODGPS_0_AXI_LITE_GPIO_BASEADDR ,
XPAR_PMODGPS_0_AXI_LITE_UART_BASEADDR, XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ);
GPS_setUpdateRate(&GPS, 1000);
}
void DemoRun() {
while (1) {
if (GPS.ping) {
GPS_formatSentence(&GPS);
if (GPS_isFixed(&GPS)) {
xil_printf("Latitude: %s\n\r", GPS_getLatitude(&GPS));
xil_printf("Longitude: %s\n\r", GPS_getLongitude(&GPS));
xil_printf("Altitude: %s\n\r", GPS_getAltitudeString(&GPS));
xil_printf("Number of Satellites: %d\n\n\r", GPS_getNumSats(&GPS));
} else {
xil_printf("Number of Satellites: %d\n\r", GPS_getNumSats(&GPS));
}
GPS.ping = FALSE;
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.