Jump to content
  • 0

GPS Pmod


HelplessGuy

Question

Hello everyone,

I bought for my Zedboard the GPS Pmod.

I wrote something about reading the datas out with UART.

Do you have some example code, how to do this? And is it possible to connect the GPS Module directly to my Pmod connections? And do I take the AXI GPIO block in the block diagram to solve this?

 

Edit:

I was able to solve it. But I do not really know now why. I think that I did some mistakes with the interrupt handling. I use now polled mode and now it is working perfectly. But I am still interested in the hardware design. I want to understand how the interrupt is working

Link to comment
Share on other sites

Recommended Posts

On 11/21/2018 at 7:22 AM, HelplessGuy said:

No I do not know how to connect only the GPS Pmod to my Zedboard Pmods.

In constraint and HDL File, the GPS Pmod IP-block needs more outputs defined, that given from the Pmod-board.

So where should I connect what

Hi @HelplessGuy,

To clarify you are trying to connect the Pmod GPS to the Zybo? Here is a completed Vivado 2018.2 Zybo/Pmod GPS without the sd card portion and using the interrupt. Here  is a completed Vivado 2018.2 Zybo/Pmod GPS with the sd card portion and does not use the interrupt. Make sure you have the digilent board files installed correctly and that you fix the path to the vivado library to reflect where it is on your pc in Vivado's project manager->settings.

thank you,

Jon

Link to comment
Share on other sites

Hi @jpeyron,all of your examples are using only the GPS_getSentence() function. I want to use now the GPS_GetTime(), GPS_GetLatitude() and the GPS_GetLongitude() functions. the problem is only, that these functions are not working, in the case that I use the following code:

GPSPmod Inst;
double time_of_gps;

int main(void)
{
	GPS_begin(&Inst, XPAR_PMODGPS_0_AXI_LITE_GPIO_BASEADDR, XPAR_PMODGPS_0_AXI_LITE_UART_BASEADDR, PERIPHERAL_CLK);
	GPS_setUpdateRate(&Inst, 1000);

	time_of_gps = GPS_GetTime(&Inst);

	return 0;
}

can you tell me why? and is there code existing, that is working? if I use the GPS_GetSentence() function parallel, this function is delivering a result

Link to comment
Share on other sites

Hi @HelplessGuy,

Please attach the code you are using to access the other functions listed below:

double GPS_getTime(PmodGPS *InstancePtr);

int GPS_getNumSats(PmodGPS *InstancePtr);

double GPS_getPDOP(PmodGPS *InstancePtr);

double GPS_getAltitude(PmodGPS *InstancePtr);

double GPS_getSpeedKnots(PmodGPS *InstancePtr);

double GPS_getSpeedKM(PmodGPS *InstancePtr);

double GPS_getHeading(PmodGPS *InstancePtr);

thank you,

Jon

Link to comment
Share on other sites

Hi  @D@n Hi @jpeyron

I am using the following code:

#include <stdio.h>
#include "xparameters.h"
#include "sleep.h"
#include "XGpio.h"
#include "PmodGPS.h"
#include "XUartLite.h"

#define		PERIPHERAL_CLK	100000000 	//Clock definition for GPS
#define		BASEADDRESS_GPS	0x2000000	//from 0x2000000 to 0x3FFFFFF memory for received GPS data
#define		BASEADDRESS_TEST	0x4000000	//from 0x4000000 to 0x5FFFFFF memory for received GSM data

PmodGPS 	GPSInst;
XUartLite	UARTInst;
XGpio		GPIOInst;

uint gpssize = 0;
char GPS_data[] = "<GPS did not get a ping>";

char* ptr_gps = (char*)(BASEADDRESS_GPS);
double* ptr_test = (double*)(BASEADDRESS_TEST);

void init(void);
void Receive_GPS_Data(void);

int main (void)
{
	init();
	Receive_GPS_Data();
}

void init(void)
{
	/*
	 * Initialize GPS
	 */
	GPS_begin(&GPSInst, XPAR_PMODGPS_0_AXI_LITE_GPIO_BASEADDR, XPAR_PMODGPS_0_AXI_LITE_UART_BASEADDR, PERIPHERAL_CLK);
	GPS_setUpdateRate(&GPSInst, 1000);
}

void Receive_GPS_Data(void)
{
	GPS_bool status;

	status = GPS_getSentence(&GPSInst, ptr_gps);
	if (status == 0)
	{
		printf("No Data received!\n");
		//return;
	}
	printf("get Sentence: %s\n", *ptr_gps); //debug

	*ptr_test = GPS_getTime(&GPSInst);
	printf("Satelite Time: %f\n", *ptr_test); //debug
	printf("\n");
}

The return I get is the flowing:

image.thumb.png.27d7d2145dca015c7e810f17024edb72.png

  • So I receive data (you can see it that I do not enter the if) the problem is only, that there is no time. And that the char is looking strange!

Hope for some help, greetings!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...