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

Edited by HelplessGuy

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

@HelplessGuy,

I can't answer all of your questions, but maybe I can answer some of them.  I also have a GPS Pmod, and I have enjoyed it.

You can find the code I used to work with GPS within my OpenArty project.  That includes not only serial port code, but also PPS tracking code.

My example code does not include any AXI peripherals.  If you want to use an AXI peripheral, you might find an AXI serial port to be more useful than an AXI GPIO peripheral, as most of the GPS processing you do will be with the serial port.

To your question, yes, you can just plug it in.  My first test with such a component (on the Arty, so PL alone) is to forward the serial port directly from the GPS Pmod to a serial port, with no logic in between.  You can find a description of such a test in the Verilog tutorial I have been writing, on chapter one: wires.  That should allow you to view the GPS serial port output, so you can start working on it from there  (9600 baud, no parity, 8 bits, etc.).  Since you are using a ZedBoard, you might find a bit more work is required to connect such a serial port to the linux kernel on the PS side of the chip.  With a bit of Google-foo, I found this article.  Hope that helps you out,

Dan

Share this post


Link to post
Share on other sites
  • 0

Hi @HelplessGuy,

I'm not aware of any HDL projects for the  Pmod GPS. We have the PmodGPS IP Core.  The getting started with Digilent Pmod IP tutorial link above should help you use the Pmod GPS IP Core. Make sure you are using the digilent board files  and the most current Vivado library here. I have attached some screen shots below that should help.

cheers,

Jon 

Zedboard_pmodGPS_1.jpg

Zedboard_pmodGPS_2.jpg

Share this post


Link to post
Share on other sites
  • 0

The output of the block diagram needs 10 Bits. But the hardware platine is only having 6 to connect it to one Pmod and two on top.

How should I connect the platine to my zedboard?

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

Hi @HelplessGuy,

Here is a forum thread that discusses using the xdc with a Arty-Z7( zynq processor) to connect different pmods using the Pmod IP Cores. Are you using Verilog/VHDL or the Zynp processor to connect to the Pmod GPS IP Core? If you project allows you to use the ZYNQ processor then i would suggest it. If you are trying to connect to the Pmod GPS IP Core using Verilog/VHDL you will need to facilitate the communicate through the AXI bus which is not an easy task . The Zynq processor handles the AXI communication. This tutorial will be very helpful with using the ZYNQ processor and the Pmod GPS IP Core.

cheers,

Jon

Share this post


Link to post
Share on other sites
  • 0

I am not really sure about the incoming signals.

The GPS-Pmod has 8 connections (2 on top and 6 at the side). But your constraint file has 10 input signals. Which signals do I have to use, and where do I have to connect them (in the case of your example)?

Share this post


Link to post
Share on other sites
  • 0

Hi @HelplessGuy,

Here is a completed Vivado/SDk 2018.2 project for the Zedboard using the on-board SD card reader and the Pmod GPS on Pmod Port JA. I have attached screen shots of the process. The project uses the Digilent board files along with the Vivado library. In Vivado's board tab right click on the JA Pmod port and select Pmod GPS IP core. In SDK I use the Hello world template and added the xilffs library in the BSP.  

cheers,

Jon

Zed_SD_3.jpg

Zed_SD_2.jpg

Zed_SD_1.jpg

Zed_SD.jpg

Zed_SD_5.jpg

Zed_SD_4.jpg

SD card screenshot.PNG

SD card contents screenshot.PNG

Share this post


Link to post
Share on other sites
  • 0

Hi @HelplessGuy,

I have added screen shots for using a constraint file and making external for the pins 1-4 T. If you are using the digilent board files and the vivado library you will not need a constraint file or making the pins external. The board files and the Vivado library handle the constraints.

thank you,

Jon

Zed_SD_7.jpg

Zed_SD_6.jpg

Zed_SD_9.jpg

Zed_SD_8.jpg

Share this post


Link to post
Share on other sites
  • 0

Hi

I was creating the HW as you said, and I wrote some software in SDK (you can see it below).

My only problem is, that the GPS.ping is not working.

I was sitting this fu***** cold afternoon in the park for one hour but didn't get any ping. I also wrote in some other forum threats about this problem.

Do you have any explaining for this?

greetings!

 

my code:

/************ Include Files ************/
#include <stdio.h>
#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)) {
        	printf("Timestamp: %f\n\r", GPS_getTime(&GPS));
            printf("Latitude: %s\n\r", GPS_getLatitude(&GPS));
            printf("Longitude: %s\n\r", GPS_getLongitude(&GPS));
            printf("Altitude: %s\n\r", GPS_getAltitudeString(&GPS));
            printf("Number of Satellites: %d\n\n\r", GPS_getNumSats(&GPS));
         } else {
            printf("Number of Satellites: %d\n\r", GPS_getNumSats(&GPS));
         }
         GPS.ping = FALSE;
      }
   }
}

 

Share this post


Link to post
Share on other sites
  • 0

Hi,

>> cold afternoon in the park for one hour

not sure if I wanted to take on GPS and FPGA at the same time... I'd probably use a laptop and Teraterm or the like to establish basic functionality via UART.

Also, be aware that "cold" starting a GPS module can take a long time. It needs to download the almanac / ephemeris data. 1h seems a lot, but several minutes isn't unusual.

Share this post


Link to post
Share on other sites
  • 0

Hi,

@xc6lx45: I tested it at home, but also not working so I went in a park. there was nothing around me. No buildings that are taller than 2 floors. and they were more than 200m away from me. I had my laptop with me and used the console of SDK (with other projects it was working perfectly.)

@jpeyron: the block diagram is below. I did it as you described it above.

image.png.73e0b0ef382f2ab73aec139e1f244ec0.png

 

Share this post


Link to post
Share on other sites
  • 0

Hi Hi @HelplessGuy,

Looking through your posts I'm not seeing what version of vivado you are using. So... what version of vivado are you using? Are you able to download and use Vivado 2018.2? If so have you tried the verified and completed Pmod GPS project done in Vivado 2018.2 attached above? 

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

oke, sad.

I was trying now your project (with my hardware design) because, the posted project of you is for zedboard and not for zybo.

The posted project of you is also having an old IP block.

But I also do not get any connection with your SDK code to GPS module

Edited by HelplessGuy

Share this post


Link to post
Share on other sites
  • 0
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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now