Beginner
10 min

Achieve precise geolocation in vehicle tracking with the NEO-F10N-00B and PIC18F45K80

Professional-grade L1/L5 dual-band GNSS receiver

GNSS 16 Click with EasyPIC v8

Published May 28, 2024

Click board™

GNSS 16 Click

Dev. board

EasyPIC v8

Compiler

NECTO Studio

MCU

PIC18F45K80

Deliver precise location information with an accuracy of meters, ideal for urban applications where dense buildings can challenge satellite signal reception

A

A

Hardware Overview

How does it work?

GNSS 16 Click is based on the NEO-F10N-00B-00B, a professional-grade L1/L5 dual-band GNSS receiver from u-blox, designed for precise navigation within urban environments. Using u-blox's proprietary F10 technology, the NEO-F10N-00B operates on both L1 and L5 signals. Its dual-band multipath mitigation technology significantly enhances signal reception from these bands, ensuring reliable meter-level accuracy. As a multi-constellation receiver, the NEO-F10N-00B supports various GNSS systems, making it ideal for vehicle tracking and micro-mobility solutions. The NEO-F10N-00B's dual-band RF front end allows it to simultaneously handle multiple dual-frequency GNSS constellations. The user can configure the receiver to focus on specific constellations, optimizing power consumption. The NEO-F10N-00B comes pre-configured to concurrently receive signals from GPS, Galileo, and BeiDou, with SBAS enhancement. Individual constellations can also be enabled or disabled, except for QZSS, which

depends on GPS availability. The receiver's firmware is also upgradeable, offering adaptability for various application needs. Communication between the NEO-F10N-00B and the host MCU is made through a UART interface using the standard UART RX and TX pins. The module communicates at 115200bps by default, allowing efficient data exchange. This Click board™ also incorporates a reset pin (RST) for direct module resetting and an external interrupt signal (EI) that can be programmed for various functions, such as waking up the module. It also features an orange PPS LED indicator that signals the pulse per second, adjustable to different conditions. This Click board™ also has the possibility of a backup supply from a connected battery. The receiver enters the hardware backup mode if the main power supply is interrupted and a backup supply is present. In this mode, the RTC time and the GNSS orbit data in the battery-backed RAM (BBR) are maintained. Valid time and GNSS orbit data at startup improve

positioning performance by enabling hot starts, warm starts, and AssistNow Autonomous. This ensures faster TTFF when the main power is resupplied. The NEO-F10N-00B also offers a single antenna input. So, via an SMA antenna connector with an impedance of 50Ω, this board is compatible with various antennas available from MIKROE, like the GNSS Active External Antenna, to enhance its connectivity. This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. Given that the NEO-F10N-00B module operates at 3.3V, a logic-level translator, TXS0106, is also used for proper operation and an accurate signal-level translation. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.

GNSS 16 Click hardware overview image

Features overview

Development board

EasyPIC v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports many high pin count 8-bit PIC microcontrollers from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer. 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. Thanks to innovative manufacturing technology, EasyPIC v8 provides a fluid and immersive working experience, allowing access anywhere and under any

circumstances at any time. Each part of the EasyPIC v8 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 module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.

Communication options such as USB-UART, USB DEVICE, and CAN are also included, including the well-established mikroBUS™ standard, two display options (graphical and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from the smallest PIC MCU devices with only eight up to forty pins. EasyPIC v8 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.

EasyPIC v8 horizontal image

Microcontroller Overview

MCU Card / MCU

default

Architecture

PIC

MCU Memory (KB)

32

Silicon Vendor

Microchip

Pin count

40

RAM (Bytes)

3648

You complete me!

Accessories

GNSS Active External Antenna is a unique multi-band type of antenna coming from u-blox that is the perfect selection for high precision GNSS applications, which require highly accurate location abilities such as RTK. The ANN-MB-00 is a multi-band (L1, L2/E5b/B2I) active GNSS antenna with a 5m cable and SMA connector. The antenna supports GPS, GLONASS, Galileo, and BeiDou and includes a high-performance multi-band RHCP dual-feed patch antenna element, a built-in high-gain LNA with SAW pre-filtering, and a 5 m antenna cable with SMA connector, and is waterproof.

GNSS 16 Click accessories 1 image

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
Reset
RE1
RST
ID COMM
RE0
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
External Interrupt
RC0
PWM
NC
NC
INT
UART TX
RC6
TX
UART RX
RC7
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

GNSS 16 Click Schematic schematic

Step by step

Project assembly

EasyPIC v8 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the EasyPIC v8 as your development board.

EasyPIC v8 front image hardware assembly
GNSS2 Click front image hardware assembly
MCU DIP 40 hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
EasyPIC v8 Access DIPMB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
NECTO Compiler Selection Step Image hardware assembly
NECTO Output Selection Step Image hardware assembly
Necto image step 6 hardware assembly
Necto DIP image step 7 hardware assembly
Necto image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto PreFlash Image hardware assembly

Track your results in real time

Application Output

1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support

Library Description

This library contains API for GNSS 16 Click driver.

Key functions:

  • gnss16_parse_gngga - This function parses the GNGGA data from the read response buffer.

  • gnss16_reset_device - This function resets the device by toggling the RST pin.

Open Source

Code example

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.

/*!
 * @file main.c
 * @brief GNSS 16 Click Example.
 *
 * # Description
 * This example demonstrates the use of GNSS 16 click board by processing
 * the incoming data and displaying them on the USB UART.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and resets the click board.
 *
 * ## Application Task
 * Reads and processes all incoming data and displays them on the USB UART.
 *
 * ## Additional Function
 * - static void gnss16_clear_app_buf ( void )
 * - static err_t gnss16_process ( gnss16_t *ctx )
 * - static void gnss16_parser_application ( char *rsp )
 *
 * @author Nenad Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "gnss16.h"

// Application buffer size
#define PROCESS_BUFFER_SIZE         200

static gnss16_t gnss16;
static log_t logger;

static uint8_t app_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
static int32_t app_buf_len = 0;

/**
 * @brief GNSS 16 clearing application buffer.
 * @details This function clears memory of application buffer and reset its length.
 * @note None.
 */
static void gnss16_clear_app_buf ( void );

/**
 * @brief GNSS 16 data reading function.
 * @details This function reads data from device and concatenates data to application buffer. 
 * @param[in] ctx : Click context object.
 * See #gnss16_t object definition for detailed explanation.
 * @return @li @c  0 - Read some data.
 *         @li @c -1 - Nothing is read.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
static err_t gnss16_process ( gnss16_t *ctx );

/**
 * @brief GNSS 16 parser application.
 * @details This function reads and parse data from device.
 * @param[in] rsp Response buffer.
 * @details This function logs GNSS data on the USB UART.
 * @return None.
 * @note None.
 */
static void gnss16_parser_application ( char *rsp );

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    gnss16_cfg_t gnss16_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.
    gnss16_cfg_setup( &gnss16_cfg );
    GNSS16_MAP_MIKROBUS( gnss16_cfg, MIKROBUS_1 );
    if ( UART_ERROR == gnss16_init( &gnss16, &gnss16_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    gnss16_reset_device( &gnss16 );
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    gnss16_process( &gnss16 );
    if ( app_buf_len > ( sizeof ( GNSS16_RSP_GNGGA ) + GNSS16_GNGGA_ELEMENT_SIZE ) ) 
    {
        gnss16_parser_application( app_buf );
    }
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

static void gnss16_clear_app_buf ( void ) 
{
    memset( app_buf, 0, app_buf_len );
    app_buf_len = 0;
}

static err_t gnss16_process ( gnss16_t *ctx ) 
{
    int32_t rx_size = 0;
    char rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
    
    rx_size = gnss16_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 ) 
        {
            gnss16_clear_app_buf(  );
            return GNSS16_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 GNSS16_OK;
    }
    return GNSS16_ERROR;
}

static void gnss16_parser_application ( char *rsp )
{
    char element_buf[ 100 ] = { 0 };
    if ( GNSS16_OK == gnss16_parse_gngga( rsp, GNSS16_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 ] );
            gnss16_parse_gngga( rsp, GNSS16_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 ) );
            gnss16_parse_gngga( rsp, GNSS16_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++;
        }
        gnss16_clear_app_buf(  );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.