TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137099 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56124 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42077 times)
  6. FT800 Library (41387 times)
  7. GSM click (29116 times)
  8. mikroSDK (26562 times)
  9. PID Library (26489 times)
  10. microSD click (25487 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

RFID click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: RFID/NFC

Downloaded: 229 times

Not followed.

License: MIT license  

RFid click features CR95HF 13.56 MHz contactless transceiver as well as trace antenna.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "RFID click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "RFID click" changes.

Do you want to report abuse regarding "RFID click".

  • Example 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


RFID click

RFid click features CR95HF 13.56 MHz contactless transceiver as well as trace antenna.

rfid_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Apr 2021.
  • Type : SPI type

Software Support

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

Standard key functions :

  • rfid_cfg_setup Config Object Initialization function.

    void rfid_cfg_setup ( rfid_cfg_t *cfg );
  • rfid_init Initialization function.

    RFID_RETVAL rfid_init ( rfid_t *ctx, rfid_cfg_t *cfg );
  • rfid_default_cfg Click Default Configuration function.

    void rfid_default_cfg ( rfid_t *ctx );

Example key functions :

  • rfid_select_communication_interface Select communication interface.

    err_t rfid_select_communication_interface ( rfid_t* ctx, uint8_t com_interface );
  • rfid_get_tag_uid Get RFID tag uid function.

    err_t rfid_get_tag_uid ( rfid_t *ctx, uint8_t rfid_protocol, uint8_t *tag_uid );
  • rfid_get_device_id RFID get device id function.

    err_t rfid_get_device_id ( rfid_t *ctx, uint8_t *device_id );

Example Description

This example demonstrates the use of RFID Click board by reading MIFARE ISO/IEC 14443 type A tag UID.

The demo application is composed of two sections :

Application Init

Initializes the driver, selects the communication interface and performs the click default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    rfid_cfg_t rfid_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 " );
    Delay_ms ( 100 );

    // Click initialization.

    rfid_cfg_setup( &rfid_cfg );
    RFID_MAP_MIKROBUS( rfid_cfg, MIKROBUS_1 );
    err_t error_flag = rfid_init( &rfid, &rfid_cfg );
    if ( error_flag != RFID_OK ) 
    {
        log_error( &logger, " Please, run program again... " );
        for ( ; ; );
    }

    log_printf( &logger, " Selecting communication interface... \r\n" );
    error_flag = rfid_select_communication_interface ( &rfid, RFID_SPI );
    if ( error_flag != RFID_OK ) 
    {
        log_error( &logger, " Please, run program again... " );
        for ( ; ; );
    }

    log_printf( &logger, " Configuring the device... \r\n" );
    error_flag = rfid_default_cfg ( &rfid );
    if ( error_flag != RFID_OK ) 
    {
        log_error( &logger, " Please, run program again... " );
        for ( ; ; );
    }

    log_printf( &logger, " The device has been configured! \r\n" );
}

Application Task

If there's a tag detected, it reads its UID and displays it on USB UART.


void application_task ( void )
{
    uint8_t tag_uid[ 20 ] = { 0 };
    uint8_t tag_len = rfid_get_tag_uid( &rfid, RFID_ISO_14443A, tag_uid );
    if ( tag_len > 0 )
    {
        log_printf( &logger, " TAG UID: " );
        for ( uint8_t cnt = 0; cnt < tag_len; cnt++ )
        {
            log_printf( &logger, "0x%.2X ", ( uint16_t ) tag_uid[ cnt ] );
        }
        log_printf( &logger, "\r\n----------------------------------\r\n" );
        Delay_ms ( 1000 );
    }
}

Note

It is recommended to tie SSI_0, SSI_1 to VCC/GND at power-up, depending on the communication interface selection by A and B on-board jumpers. SSI_0 - UART: 0 SPI: 1 SSI_1 - UART: 0 SPI: 0

Only tags with 4-byte or 7-byte UIDs are compatible with this example. We recommend MIKROE-1475 - an RFiD tag 13.56MHz compliant with ISO14443-A standard.

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

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.


ALSO FROM THIS AUTHOR

EZO Carrier DO click

0

EZO Carrier Click - Oxygen is a compact add-on board suitable for determining the dissolved oxygen of a liquid in your application. This board features the EZO-DO™, an ISO 5814 compliant embedded dissolved oxygen circuit board from Atlas Scientific.

[Learn More]

Stepper 4 click

0

Stepper 4 click carries a TB67S269FTG - a two-phase bipolar stepping motor driver using a PWM chopper, with a clock in decoder built in. Rating is 50 V/2.0 A. Microstepping resolution is externally manipulated, as well as output current scaling.

[Learn More]

IR Grid click

5

IR Grid click is a thermal imaging sensor. It has an array of 64 very sensitive factory calibrated IR elements (pixels), arranged in 4 rows of 16 pixels, each measuring an object temperature up to 300ËšC within its local Field of View (FOV).

[Learn More]