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

@cepwin,

There's a real easy way to debug whether or not you are getting a fix or not.  Remove the FPGA design, and replace it with a pass through from the GPS UART transmit pin to the FT2232 UART RX transmit pin.  You can then use your favorite terminal program, mine is minicom some like teraterm, to examine the NEMA stream produced by the GPS device.  It's typically 9600 Baud, 8 data bits, no parity and one stop bit.  It's also pseudo-human readable--line upon line of CSVs--you should then be able to tell if you are getting lock or not.

I see no reason why you wouldn't be getting lock from your upstairs bedroom.

Also, for your security, you probably don't want to paste the NEMA stream coming out of the device here for discussion--since it may well reveal the coordinates of your bedroom.

Dan

Link to comment
Share on other sites

That you Dan!   I did a little googling over lunch and realized there's a very simple/stupid reason I'm not getting a signal....I don't have the GPS module....I see Digilent sells one a long with some other sensors/etc. that work with the Arty s7.   Those could be fun to play with.   I did create a full Microblaze with memory and UART and that appears to be good.   I just have to fix the code to use the UART library for that rather than the simple Microblaze that my class example used.   What I realized is Vivado will generate the necessary headers based on your design,

I also want to thank Jon again for his help as well.    I have learned so much working this issue.

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;
      }
   }
}

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

@HelplessGuy

@jpeyron had pointed out a valid bug, one I'm sorry I missed.  If you define something as a char *, and then pass it to a printf("%s,..._); you'll want to pass the name without the *. That should leave you wondering about whatever other bugs you may have in your code.  It looks like you have a similar bug on two lines with ptr_test as well.  There should be no "*" in ptr_test =GPS_getting...., nor in the printf that follows. 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...