This file contains some tips on using the GPS PMOD.
To make use of the GPS PMOD in your own project, follow these steps:
- Download the latest version of Digilent's Vivado Library
- Install the Digilent Board Support Files if you haven't already done so
- Launch Vivado and create a new project
- Don't add any sources
- Be sure to select your board in the project creation wizard
- Add the Digilent Vivado Library to the list of IP repositories used by the project
- Create a new block design
- Build a basic MicroBlaze design
- You can use the instructions located here as a reference
- You'll need to have the following blocks in your design:
- MicroBlaze
- MicroBlaze Debug Module
- Clocking Wizard
- Processor System Reset
- AXI Interconnect
- AXI Interrupt Controller
- Concat
- AXI Uartlite
- PmodGPS_v1_1
- Ensure the interrupt port of the GPS and UART blocks are connected to the Concat block
- Run Generate Bitstream
- When bitstream generation is complete, export the hardware
- File > Export > Export Hardware
- Ensure Include bitstream is selected
- Launch SDK
- File > Launch SDK
- Accept the defaults
- Create a new blank C application project
- Create a new source file
- Copy the contents of the example source code into the new file and save
- Power on and program the board with the bitstream
- Connect the SDK terminal to the board
- Select one of the COM ports
- Baud Rate: 9600
- Launch the software on the board using SDK
The LED on the GPS PMOD will blink until it is able to obtain a position fix. Until that time, the software will only print the number of satellites to the terminal.
Given that the GPS driver code is written in C, this may present a problem when you need to write the rest of your software in C++ (e.g. when WiFi is involved). The GPS driver code cannot be compiled using mb-g++
. To explicitly build the GPS code using a C compiler, follow these steps:
These steps assume the GPS example code is located in a file called
gps.c
and that global variables and functions are declared ingps.h
. (Example)
- Add all the source files to your existing C++ project
- Right click on
gps.c
in the Project Explorer and choose Properties - In the left pane, navigate to
C/C++ Build > Settings
- Change the contents of the Command field to
mb-gcc
- When including
gps.h
, wrap the#include
as follows:
extern "C" {
#include "gps.h"
}
You do not need to leverage interrupts to make use of the GPS PMOD. To poll the device for an update, use the following function:
// Poll PMOD for GPS Data
// GPS is an instance of PmodGPS
GPS_getData(&GPS);
Do not think that you'll be able to use the GPS module inside a building. Based on personal experience, the antenna has a difficult time obtaining a position fix even when standing outside. Don't make this an integral part of your project/demo.