magicrfid 2.0.0.0
Main Page

Magic RFID click

‍Magic RFID Click is a compact add-on board that contains an embedded RFID module. This board features the M6E-NANO, UHF RFID module with ultra-low power consumption from JADAK. Supporting the EPC Gen2V2 and ISO 18000-63 standard, the M6E-NANO module is available for global use. It operates in the Ultra High Frequency (UHF) band in a range from 859 up to 930MHz and can be used for write/read applications.

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Sep 2021.
  • Type : UART type

Software Support

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

Standard key functions :

Example key functions :

Example Description

‍This example reads and processes data from Magic RFID clicks.

The demo application is composed of two sections :

Application Init

‍Initialize driver init and starts default configuration module.

void application_init ( void )
{
log_cfg_t log_cfg;
magicrfid_cfg_t magicrfid_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
magicrfid_cfg_setup( &magicrfid_cfg );
MAGICRFID_MAP_MIKROBUS( magicrfid_cfg, MIKROBUS_1 );
if ( UART_ERROR == magicrfid_init( &magicrfid, &magicrfid_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_printf( &logger, " >> Please, wait for device setup. \r\n" );
magicrfid_default_cfg ( &magicrfid );
Delay_ms( 1000 );
log_printf( &logger, " >> Initialization done, reading tag is available. \r\n" );
log_info( &logger, " Application Task " );
}
#define MAGICRFID_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: magicrfid.h:131
void application_init(void)
Definition: main.c:28

Application Task

‍Reads TAG information and RSSI value of the TAG and logs it on UART.

void application_task ( void )
{
magicrfid_process( &magicrfid, &tag );
if ( magicrfid_get_data_status( &tag ) == 1 )
{
log_printf( &logger, " >> TAG INFO: 0x" );
for( uint8_t cnt = 0; cnt < 12; cnt++ )
{
log_printf( &logger, "%.2X", ( uint16_t ) tag.tag_buf[ cnt ] );
}
log_printf( &logger, "\r\n" );
log_printf( &logger, " >> TAG RSSI: %d\r\n", ( uint16_t ) tag.tag_rssi );
}
}
void magicrfid_process(magicrfid_t *ctx, magicrfid_data_t *data_obj)
General collecting response function.
void magicrfid_tag_parser(magicrfid_data_t *data_obj)
Gets Tag value after parsing.
void magicrfid_reset_data(magicrfid_data_t *data_obj)
Reset collecting data and start new measurement.
uint8_t magicrfid_get_data_status(magicrfid_data_t *data_obj)
Get current data status.
void application_task(void)
Definition: main.c:61

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

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.