ismrx3  2.0.0.0
Main Page

ISM RX 3 click

ISM RX 3 Click is a compact add-on board that contains a Sub-GHz RF receiver. This board features the MAX41470, a high-performance, low-power receiver ideal for amplitude shift-keyed (ASK) and frequency shift-keyed (FSK) data from Maxim Integrated, now part of Analog Devices.

click Product page


Click library

  • Author : Luka FIlipovic
  • Date : Feb 2021.
  • Type : SPI type

Software Support

We provide a library for the ISMRX3 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 ISMRX3 Click driver.

Standard key functions :

Example key functions :

Example Description

This example showcases ability of click board to configure

and read incoming rf signal and parses data using data and clock line.

The demo application is composed of two sections :

Application Init

Initialization of communication modules (SPI, UART), and additional

communication pins. Resets device, reads device ID, and sets default configuration that sets ASK modulation and 433.92MHz with 5bps data rate.

void application_init ( void )
{
log_cfg_t log_cfg;
ismrx3_cfg_t ismrx3_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
ismrx3_cfg_setup( &ismrx3_cfg );
ISMRX3_MAP_MIKROBUS( ismrx3_cfg, MIKROBUS_1 );
err_t init_flag = ismrx3_init( &ismrx3, &ismrx3_cfg );
if ( init_flag == SPI_MASTER_ERROR )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
ismrx3_reset( &ismrx3 );
uint8_t read_data;
ismrx3_generic_read( &ismrx3, 0x1E, &read_data );
log_info( &logger, " > ID: 0x%.2X", ( uint16_t )read_data );
Delay_ms( 500 );
ismrx3.modulation = ISMRX3_MODULATION_ASK;
ismrx3.reference_freq = ISMRX3_FREQUENCY_MHZ_433p92;
ismrx3.data_rate = ISMRX3_DATA_RATE_KBPS_5;
ismrx3.freq_deviation = ISMRX3_DEVIATION_KHZ_40;
if ( ISMRX3_ERROR == ismrx3_default_cfg ( &ismrx3 ) )
{
log_error( &logger, " Configuration Error. " );
log_info( &logger, " Please, change device configuration parameters and run program again... " );
for ( ; ; );
}
manchester_counter = 0;
log_info( &logger, " Application Task " );
}

Application Task

Reads clock pin and gets samples of data pin state, converts it in manchester

data that stores in buffer. When it fills out manchester buffer checks if expected preamble data is received. If it is checks the next byte(it should be received data length). Then parses rest of data and if it's correct shows it on log.

void application_task ( void )
{
if ( ismrx3_get_clk( &ismrx3 ) )
{
sample = ismrx3_get_data( &ismrx3 );
if ( last_sample == sample )
{
consecutive++;
}
else
{
if ( consecutive < 4 )//Single sample
{
manchester_buf[ manchester_counter++ ] = last_sample + 48;//Convert to ascii 1/0
}
else if ( consecutive < 6 )//Two samples
{
manchester_buf[ manchester_counter++ ] = last_sample + 48;//Convert to ascii 1/0
manchester_buf[ manchester_counter++ ] = last_sample + 48;//Convert to ascii 1/0
}
consecutive = 1;
last_sample = sample;
}
while ( ismrx3_get_clk( &ismrx3 ) );
}
if ( manchester_counter >= MANCHESTER_BUF_LEN - 1 )
{
parse_samples( );
manchester_counter = 0;
}
}

Note

  • The expected data that is received is:

    PREAMBLE_WORD(2bytes), DATA_LENGTH(1byte), DATA(1..255bytes)

  • By default PREAMBLE_WORD is set to be 0xAAAA.

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.ISMRX3

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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ismrx3_init
err_t ismrx3_init(ismrx3_t *ctx, ismrx3_cfg_t *cfg)
ISM RX 3 initialization function.
ismrx3_reset
void ismrx3_reset(ismrx3_t *ctx)
Reset function.
ismrx3_get_data
uint8_t ismrx3_get_data(ismrx3_t *ctx)
Read data output.
MANCHESTER_BUF_LEN
#define MANCHESTER_BUF_LEN
Definition: main.c:40
ISMRX3_ERROR
@ ISMRX3_ERROR
Definition: ismrx3.h:222
ISMRX3_MAP_MIKROBUS
#define ISMRX3_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: ismrx3.h:153
application_task
void application_task(void)
Definition: main.c:120
ISMRX3_DATA_RATE_KBPS_5
#define ISMRX3_DATA_RATE_KBPS_5
Definition: ismrx3.h:132
ismrx3_cfg_setup
void ismrx3_cfg_setup(ismrx3_cfg_t *cfg)
ISM RX 3 configuration object setup function.
ismrx3_generic_read
err_t ismrx3_generic_read(ismrx3_t *ctx, uint8_t reg, uint8_t *data_out)
ISM RX 3 data reading function.
ismrx3_get_clk
uint8_t ismrx3_get_clk(ismrx3_t *ctx)
Read clock output.
ismrx3_cfg_t
ISM RX 3 Click configuration object.
Definition: ismrx3.h:195
ISMRX3_MODULATION_ASK
#define ISMRX3_MODULATION_ASK
ISM RX 3 data modulation setting.
Definition: ismrx3.h:106
manchester_buf
uint8_t manchester_buf[MANCHESTER_BUF_LEN]
Definition: main.c:43
application_init
void application_init(void)
Definition: main.c:66
ISMRX3_FREQUENCY_MHZ_433p92
#define ISMRX3_FREQUENCY_MHZ_433p92
Definition: ismrx3.h:114
ismrx3_default_cfg
err_t ismrx3_default_cfg(ismrx3_t *ctx)
ISM RX 3 default configuration function.
ISMRX3_DEVIATION_KHZ_40
#define ISMRX3_DEVIATION_KHZ_40
Definition: ismrx3.h:123
ismrx3_t
ISM RX 3 Click context object.
Definition: ismrx3.h:171