Stay connected to the world around you and find your way with ease
A
A
Hardware Overview
How does it work?
GPS 5 Click is based on the M20050-1, an integrated GNSS receiver module with an integrated antenna incorporating the MediaTek MT3333 flash chip from Antenova. The M20050-1 tracks 3 GNSS constellations concurrently (GPS+Galileo+GLONASS or GPS+Beidou) to considerably enhance the location and has configurable low power modes alongside acquisition and tracking sensitivity of -163dBm and -165dBm. This module offers indoor and outdoor multi-path detection and compensation and has an accurate 0.5ppm TXCO that ensures short TTFF besides an active interference cancellation (AIC) feature. This Click board is ideal for asset tracking/ personal safety, navigation devices, and sports equipment applications based on good attributes. The M20050-1 has three power-saving modes: Standby, Backup, and Periodic. Standby mode is a power-saving mode initiated with a hardware signal routed on the STB pin of the mikroBUS™ socket or by a software command.
It shuts down the RF section of the module, putting the processor into Standby mode. The RTC is kept alive, and the RAM power is maintained to keep the module configuration. Periodic mode is a user-configurable mode that reduces current consumption by only waking the module for short periods to maintain FIX data. Backup mode is accessed due to the absence of the main board power supply VCC. For this reason, there is an additional backup power supply in the form of a battery that powers the RAM and RTC sections of the receiver and needs to be applied at all times for Backup mode to run correctly. Once initiated, the RTC and all configurations are saved along with any ephemeris data to allow quick TTFF once the VCC is re-applied. GPS 5 Click communicates with MCU using the UART interface with commonly used UART RX and TX pins operating at 115200bps by default to transmit and exchange data with the host MCU. It also possesses an active-low reset signal routed on the
RST pin of the mikroBUS™ socket that activates a hardware reset of the M20050-1. The reset function can also be used using an onboard RESET button. In addition to precise positioning, the GPS 5 Click also has an accurate timing signal indicated via a red LED indicator marked as 1PPS, a blue LED indicator marked with FIX, which shows once a GPS fix has been obtained, as well as the possibility of using an external active antenna which can also be found in our offer, activated through EN pin of the mikroBUS™ socket. This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.
![GPS 5 Click top side image](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1edd2d20-1363-6f9a-b331-02420a0004ab/01-gps-5-click-front.png)
![GPS 5 Click lateral side image](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1edd2d21-29c3-6424-a665-02420a0004ab/02-gps-5-click-side.png)
![GPS 5 Click bottom side image](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1edd2d22-a018-6768-878d-02420a0004ab/03-gps-5-click-back.png)
Features overview
Development board
EasyMx PRO v7a for STM32 is the seventh generation of ARM development boards specially designed to develop embedded applications rapidly. It supports a wide range of 32-bit ARM microcontrollers from STMicroelectronics and a broad set of unique functions, such as the first-ever embedded debugger/programmer over USB-C. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. With two different connectors for each port, EasyMx PRO v7afor STM32 allows you to connect accessory boards, sensors, and custom electronics more efficiently than ever. Each part of the EasyMx
PRO v7a for STM32 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board also includes a clean and regulated power supply block for the development board. It can use a wide range of external power sources, including an external 12V power supply, 7-23V AC or 9-32V DC via DC connector/screw terminals, and a power source via the USB Type-C (USB-C) connector. Communication options such as USB-UART, USB-HOST/DEVICE, CAN, and
Ethernet are also included, including the well-established mikroBUS™ standard, one display option for the TFT board line of products, and a standard TQFP socket for the seventh-generation MCU cards. This socket covers 32-bit ARM MCUs like STM32 Cortex-M3, -M7, and -M4 MCUs. EasyMx PRO v7afor STM32 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
![default](https://cdn.mikroe.com/rent-a-product/request-setup/mcu-cards/easymx-pro-v7-stm32-stm32f407vgt6.png)
Type
7th Generation
Architecture
ARM Cortex-M4
MCU Memory (KB)
10
Silicon Vendor
STMicroelectronics
Pin count
100
RAM (Bytes)
100
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
![GPS 5 Click Schematic schematic](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1ee95048-2cc3-6bf0-b2f3-0242ac120005/GPS-5-click-v103-Schematic-1.png)
Step by step
Project assembly
Track your results in real time
Application Output
After pressing the "FLASH" button on the left-side panel, it is necessary to open the UART terminal to display the achieved results. By clicking on the Tools icon in the right-hand panel, multiple different functions are displayed, among which is the UART Terminal. Click on the offered "UART Terminal" icon.
![UART Application Output Step 1](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703a-40a0-6b58-88de-02420a00029a/UART-AO-Step-1.jpg)
Once the UART terminal is opened, the window takes on a new form. At the top of the tab are two buttons, one for adjusting the parameters of the UART terminal and the other for connecting the UART terminal. The tab's lower part is reserved for displaying the achieved results. Before connecting, the terminal has a Disconnected status, indicating that the terminal is not yet active. Before connecting, it is necessary to check the set parameters of the UART terminal. Click on the "OPTIONS" button.
![UART Application Output Step 2](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703a-eb29-62fa-ba91-02420a00029a/UART-AO-Step-2.jpg)
In the newly opened UART Terminal Options field, we check if the terminal settings are correct, such as the set port and the Baud rate of UART communication. If the data is not displayed properly, it is possible that the Baud rate value is not set correctly and needs to be adjusted to 115200. If all the parameters are set correctly, click on "CONFIGURE".
![UART Application Output Step 3](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703b-7543-6fbc-9c69-0242ac120003/UART-AO-Step-3.jpg)
The next step is to click on the "CONNECT" button, after which the terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
![UART Application Output Step 4](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703c-068c-66a4-a4fc-0242ac120003/UART-AO-Step-4.jpg)
Software Support
Library Description
This library contains API for GPS 5 Click driver.
Key functions:
gps5_set_rst_pin
This function sets the RST pin logic state.gps5_generic_read
This function reads a desired number of data bytes by using UART serial interface.gps5_parse_gngga
This function parses the GNGGA data from the read response buffer.
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* @file main.c
* @brief GPS 5 Click Example.
*
* # Description
* This example demonstrates the use of GPS 5 click by reading and displaying
* the GPS coordinates.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and resets the click board.
*
* ## Application Task
* Reads the received data, parses the GNGGA info from it, and once it receives the position fix
* it will start displaying the coordinates on the USB UART.
*
* ## Additional Function
* - static void gps5_clear_app_buf ( void )
* - static err_t gps5_process ( gps5_t *ctx )
* - static void gps5_parser_application ( char *rsp )
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "gps5.h"
#define PROCESS_BUFFER_SIZE 200
static gps5_t gps5;
static log_t logger;
static char app_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
static int32_t app_buf_len = 0;
static int32_t app_buf_cnt = 0;
/**
* @brief GPS 5 clearing application buffer.
* @details This function clears memory of application buffer and reset its length and counter.
* @return None.
* @note None.
*/
static void gps5_clear_app_buf ( void );
/**
* @brief GPS 5 data reading function.
* @details This function reads data from device and concatenates data to application buffer.
* @param[in] ctx : Click context object.
* See #gps5_t object definition for detailed explanation.
* @return @li @c 0 - Read some data.
* @li @c -1 - Nothing is read or Application buffer overflow.
* See #err_t definition for detailed explanation.
* @note None.
*/
static err_t gps5_process ( gps5_t *ctx );
/**
* @brief GPS 5 parser application.
* @param[in] rsp Response buffer.
* @details This function logs GNSS data on the USB UART.
* @return None.
* @note None.
*/
static void gps5_parser_application ( char *rsp );
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
gps5_cfg_t gps5_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
gps5_cfg_setup( &gps5_cfg );
GPS5_MAP_MIKROBUS( gps5_cfg, MIKROBUS_1 );
if ( UART_ERROR == gps5_init( &gps5, &gps5_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
gps5_process( &gps5 );
if ( app_buf_len > ( sizeof ( ( char * ) GPS5_RSP_GNGGA ) + GPS5_GNGGA_ELEMENT_SIZE ) )
{
gps5_parser_application( app_buf );
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
static void gps5_clear_app_buf ( void )
{
memset( app_buf, 0, app_buf_len );
app_buf_len = 0;
app_buf_cnt = 0;
}
static err_t gps5_process ( gps5_t *ctx )
{
int32_t rx_size = 0;
char rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
rx_size = gps5_generic_read( ctx, rx_buf, PROCESS_BUFFER_SIZE );
if ( rx_size > 0 )
{
int32_t buf_cnt = 0;
if ( ( app_buf_len + rx_size ) > PROCESS_BUFFER_SIZE )
{
gps5_clear_app_buf( );
return GPS5_ERROR;
}
else
{
buf_cnt = app_buf_len;
app_buf_len += rx_size;
}
for ( int32_t rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ )
{
if ( rx_buf[ rx_cnt ] )
{
app_buf[ ( buf_cnt + rx_cnt ) ] = rx_buf[ rx_cnt ];
}
else
{
app_buf_len--;
buf_cnt--;
}
}
return GPS5_OK;
}
return GPS5_ERROR;
}
static void gps5_parser_application ( char *rsp )
{
char element_buf[ 100 ] = { 0 };
if ( GPS5_OK == gps5_parse_gngga( rsp, GPS5_GNGGA_LATITUDE, element_buf ) )
{
static uint8_t wait_for_fix_cnt = 0;
if ( strlen( element_buf ) > 0 )
{
log_printf( &logger, "\r\n Latitude: %.2s degrees, %s minutes \r\n", element_buf, &element_buf[ 2 ] );
gps5_parse_gngga( rsp, GPS5_GNGGA_LONGITUDE, element_buf );
log_printf( &logger, " Longitude: %.3s degrees, %s minutes \r\n", element_buf, &element_buf[ 3 ] );
memset( element_buf, 0, sizeof( element_buf ) );
gps5_parse_gngga( rsp, GPS5_GNGGA_ALTITUDE, element_buf );
log_printf( &logger, " Altitude: %s m \r\n", element_buf );
wait_for_fix_cnt = 0;
}
else
{
if ( wait_for_fix_cnt % 5 == 0 )
{
log_printf( &logger, " Waiting for the position fix...\r\n\n" );
wait_for_fix_cnt = 0;
}
wait_for_fix_cnt++;
}
gps5_clear_app_buf( );
}
}
// ------------------------------------------------------------------------ END