LBAND RTK click
LBAND RTK Click is a compact add-on board that provides global and easy access to satellite L-Band GNSS corrections. This board features the NEO-D9S-00B, an professional-grade satellite data receiver for L-band correction broadcast from u-blox. Operating in a frequency range from 1525MHz to 1559MHz, the NEO-D9S-00B decodes the satellite transmission and outputs a correction stream, enabling a high-precision GNSS receiver to reach accuracies down to centimeter level. It can also select the GNSS correction data delivery channel alongside advanced security features such as signature and anti-jamming.
click Product page
Click library
- Author : Stefan Filipovic
- Date : Jan 2023.
- Type : UART/I2C/SPI type
Software Support
We provide a library for the LBAND RTK Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for LBAND RTK Click driver.
Standard key functions :
lbandrtk_cfg_setup
Config Object Initialization function.
void lbandrtk_cfg_setup(lbandrtk_cfg_t *cfg)
LBAND RTK configuration object setup function.
LBAND RTK Click configuration object.
Definition lbandrtk.h:320
lbandrtk_init
Initialization function.
err_t lbandrtk_init(lbandrtk_t *ctx, lbandrtk_cfg_t *cfg)
LBAND RTK initialization function.
LBAND RTK Click context object.
Definition lbandrtk.h:293
Example key functions :
lbandrtk_set_default_pmp_cfg
This function sets the Point to multipoint (PMP) to default configuration to RAM layer.
err_t lbandrtk_set_default_pmp_cfg(lbandrtk_t *ctx)
LBAND RTK set default pmp cfg function.
lbandrtk_get_pmp_cfg
This function reads the Point to multipoint (PMP) configuration from RAM layer.
err_t lbandrtk_get_pmp_cfg(lbandrtk_t *ctx, lbandrtk_pmp_cfg_t *pmp_cfg)
LBAND RTK get pmp cfg function.
LBAND RTK Click CFG-PMP: Point to multipoint (PMP) configuration object.
Definition lbandrtk.h:273
lbandrtk_read_ubx_frame
This function waits for an UBX frame message to arrive and reads it.
err_t lbandrtk_read_ubx_frame(lbandrtk_t *ctx, lbandrtk_ubx_frame_t *frame)
LBAND RTK read ubx frame function.
LBAND RTK Click UBX frame union object.
Definition lbandrtk.h:253
Example Description
This example demonstrates the use of LBAND RTK click by setting the Point to multipoint (PMP)
configuration and waiting for the UBX-RXM-PMP message, then parsing it and displaying on the USB UART.
The demo application is composed of two sections :
Application Init
Initializes the driver, reads the module version, sets the Point to multipoint (PMP) configuration
(for EU center frequency by default) and then reads that config and displays on the USB UART.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
Delay_ms ( 100 );
lbandrtk.frame.payload_len = 0;
{
log_printf( &logger, " ------ MODULE VERSION ------\r\n" );
log_printf( &logger, " SW version:\r\n %s\r\n\n", &lbandrtk.frame.payload[ 0 ] );
log_printf( &logger, " HW version:\r\n %s\r\n\n", &lbandrtk.frame.payload[ 30 ] );
log_printf( &logger, " Extension:\r\n" );
for ( uint16_t cnt = 0; cnt < ( ( lbandrtk.frame.payload_len - 40 ) / 30 ); cnt++ )
{
log_printf( &logger, " %s\r\n", &lbandrtk.frame.payload[ 40 + cnt * 30 ] );
}
log_printf( &logger, " ----------------------------\r\n\n" );
}
Delay_ms ( 100 );
{
log_error( &logger, " Set default PMP configuration." );
for ( ; ; );
}
{
log_printf( &logger, " ----- PMP CONFIGURATION ----\r\n" );
log_printf( &logger,
" Center frequency: %lu\r\n", pmp_cfg.
center_freq );
log_printf( &logger,
" Search window: %u\r\n", pmp_cfg.
search_window );
log_printf( &logger,
" Use service ID: %u\r\n", ( uint16_t ) pmp_cfg.
use_service_id );
log_printf( &logger,
" Service ID: %u\r\n", pmp_cfg.
service_id );
log_printf( &logger,
" Data rate: %u\r\n", pmp_cfg.
data_rate );
log_printf( &logger,
" Use descrambler: %u\r\n", ( uint16_t ) pmp_cfg.
use_descrambler );
log_printf( &logger,
" Use prescrambling: %lu\r\n", ( uint16_t ) pmp_cfg.
use_prescrambling );
log_printf( &logger, " ----------------------------\r\n\n" );
}
log_info( &logger, " Application Task " );
}
#define LBANDRTK_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition lbandrtk.h:215
#define LBANDRTK_CLASS_ID_UBX_MON
Definition lbandrtk.h:79
#define LBANDRTK_MSG_ID_UBX_MON_VER
Definition lbandrtk.h:91
err_t lbandrtk_write_ubx_frame(lbandrtk_t *ctx, lbandrtk_ubx_frame_t *frame)
LBAND RTK write ubx frame function.
@ LBANDRTK_ERROR
Definition lbandrtk.h:357
@ LBANDRTK_OK
Definition lbandrtk.h:356
void application_init(void)
Definition main.c:34
uint8_t use_prescrambling
Definition lbandrtk.h:282
uint32_t unique_word_low
Definition lbandrtk.h:284
uint8_t use_service_id
Definition lbandrtk.h:277
uint8_t use_descrambler
Definition lbandrtk.h:280
uint16_t descrambler_init
Definition lbandrtk.h:281
uint16_t search_window
Definition lbandrtk.h:275
uint16_t service_id
Definition lbandrtk.h:278
uint32_t center_freq
Definition lbandrtk.h:274
uint16_t data_rate
Definition lbandrtk.h:279
uint32_t unique_word_high
Definition lbandrtk.h:283
Application Task
Waits for an incoming UBX messages, reads and displays them on the USB UART. If the received message is
PMP data it will be parsed additionally.
{
{
{
log_printf( &logger, " -------- UBX-RXM-PMP -------\r\n" );
log_printf( &logger, " Version: %u\r\n", ( uint16_t ) lbandrtk.frame.payload[ 0 ] );
log_printf( &logger, " Time tag [ms]: %lu\r\n",
( ( uint32_t ) lbandrtk.frame.payload[ 7 ] << 24 ) | ( ( uint32_t ) lbandrtk.frame.payload[ 6 ] << 16 ) |
( ( uint16_t ) lbandrtk.frame.payload[ 5 ] << 8 ) | lbandrtk.frame.payload[ 4 ] );
log_printf( &logger, " Unique word: 0x%.8LX%.8LX\r\n",
( ( uint32_t ) lbandrtk.frame.payload[ 15 ] << 24 ) | ( ( uint32_t ) lbandrtk.frame.payload[ 14 ] << 16 ) |
( ( uint16_t ) lbandrtk.frame.payload[ 13 ] << 8 ) | lbandrtk.frame.payload[ 12 ],
( ( uint32_t ) lbandrtk.frame.payload[ 11 ] << 24 ) | ( ( uint32_t ) lbandrtk.frame.payload[ 10 ] << 16 ) |
( ( uint16_t ) lbandrtk.frame.payload[ 9 ] << 8 ) | lbandrtk.frame.payload[ 8 ] );
log_printf( &logger, " Unique word bit errors: %u\r\n", ( uint16_t ) lbandrtk.frame.payload[ 19 ] );
if ( lbandrtk.frame.payload[ 0 ] )
{
log_printf( &logger, " FEC bits : %u\r\n", ( ( uint16_t ) lbandrtk.frame.payload[ 21 ] << 8 ) | lbandrtk.frame.payload[ 20 ] );
}
else
{
log_printf( &logger, " FEC bits : %u\r\n", ( ( uint16_t ) lbandrtk.frame.payload[ 525 ] << 8 ) | lbandrtk.frame.payload[ 524 ] );
}
log_printf( &logger, "\r\n Service ID : %u\r\n", ( ( uint16_t ) lbandrtk.frame.payload[ 17 ] << 8 ) | lbandrtk.frame.payload[ 16 ] );
log_printf( &logger, " Spare byte: %u\r\n", ( uint16_t ) lbandrtk.frame.payload[ 18 ] );
if ( lbandrtk.frame.payload[ 0 ] )
{
num_bytes_user_data = ( ( uint16_t ) lbandrtk.frame.payload[ 3 ] << 8 ) | lbandrtk.frame.payload[ 2 ];
{
}
log_printf( &logger, " User data bytes: %u\r\n", num_bytes_user_data );
log_printf( &logger, " User data:\r\n" );
for ( uint16_t cnt = 0; cnt < num_bytes_user_data; cnt++ )
{
if ( 0 == ( cnt % 20 ) )
{
log_printf( &logger, "\r\n" );
}
log_printf( &logger, "%.2X ", ( uint16_t ) lbandrtk.frame.payload[ 24 + cnt ] );
}
}
else
{
log_printf( &logger, " User data bytes: %u\r\n", num_bytes_user_data );
log_printf( &logger, " User data:\r\n" );
for ( uint16_t cnt = 0; cnt < num_bytes_user_data; cnt++ )
{
if ( 0 == ( cnt % 20 ) )
{
log_printf( &logger, "\r\n" );
}
log_printf( &logger, " %.2X", ( uint16_t ) lbandrtk.frame.payload[ 20 + cnt ] );
}
}
log_printf( &logger, "\r\n ----------------------------\r\n\n" );
Delay_ms ( 100 );
}
else
{
log_printf( &logger, " ---- UBX FRAME RECEIVED ----\r\n" );
log_printf( &logger, " Class ID: 0x%.2X\r\n", ( uint16_t ) lbandrtk.frame.class_id );
log_printf( &logger, " Message ID: 0x%.2X\r\n", ( uint16_t ) lbandrtk.frame.msg_id );
log_printf( &logger, " Payload length: %u\r\n", lbandrtk.frame.payload_len );
log_printf( &logger, " Payload:" );
for ( uint16_t cnt = 0; cnt < lbandrtk.frame.payload_len; cnt++ )
{
if ( 0 == ( cnt % 20 ) )
{
log_printf( &logger, "\r\n" );
}
log_printf( &logger, " %.2X", ( uint16_t ) lbandrtk.frame.payload[ cnt ] );
}
log_printf( &logger, "\r\n ----------------------------\r\n\n" );
Delay_ms ( 100 );
}
}
}
#define LBANDRTK_UBX_RXM_PMP_MAX_USER_DATA
LBAND RTK UBX-RXM-PMP setting.
Definition lbandrtk.h:170
#define LBANDRTK_UBX_RXM_PMP_EBN0_SCALE
Definition lbandrtk.h:171
#define LBANDRTK_CLASS_ID_UBX_RXM
Definition lbandrtk.h:80
#define LBANDRTK_MSG_ID_UBX_RXM_PMP
Definition lbandrtk.h:92
void application_task(void)
Definition main.c:108
Note
Make sure to use a correct L-Band antenna and that it's placed outside on open-sky in order to be able to receive PMP data from satellites.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.LBANDRTK
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.