TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 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 (139266 times)
  2. FAT32 Library (71754 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47432 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42408 times)
  7. GSM click (29835 times)
  8. mikroSDK (28101 times)
  9. PID Library (26886 times)
  10. microSD click (26198 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

NFC 6 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: RFID/NFC

Downloaded: 85 times

Not followed.

License: MIT license  

NFC 6 Click is a compact add-on board that contains an NFC transceiver for contactless communication. This board features the ST25R95, a near-field communication transceiver from STMicroelectronics. It supports reader and writer operating modes and emulates ISO/IEC 14443-3 Type A cards. The RF communications are done over the 13.56MHz. The transceiver features tag detection mode, field detection mode, transmission and reception modes, and more.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "NFC 6 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "NFC 6 Click" changes.

Do you want to report abuse regarding "NFC 6 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


NFC 6 Click

NFC 6 Click is a compact add-on board that contains an NFC transceiver for contactless communication. This board features the ST25R95, a near-field communication transceiver from STMicroelectronics. It supports reader and writer operating modes and emulates ISO/IEC 14443-3 Type A cards. The RF communications are done over the 13.56MHz. The transceiver features tag detection mode, field detection mode, transmission and reception modes, and more.

nfc6_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Sep 2023.
  • Type : SPI type

Software Support

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

Standard key functions :

  • nfc6_cfg_setup Config Object Initialization function.

    void nfc6_cfg_setup ( nfc6_cfg_t *cfg );
  • nfc6_init Initialization function.

    err_t nfc6_init ( nfc6_t *ctx, nfc6_cfg_t *cfg );
  • nfc6_default_cfg Click Default Configuration function.

    err_t nfc6_default_cfg ( nfc6_t *ctx );

Example key functions :

  • nfc6_send_command This function sends a desired command by using SPI serial interface.

    err_t nfc6_send_command ( nfc6_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len );
  • nfc6_read_data This function reads a response data bytes by using SPI serial interface.

    err_t nfc6_read_data ( nfc6_t *ctx, uint8_t *data_out, uint16_t buffer_size, uint16_t *rx_len );
  • nfc6_read_mifare_tag_uid This function reads the UID of a MIFARE ISO14443-A type tags with 4-byte or 7-byte UIDs.

    err_t nfc6_read_mifare_tag_uid ( nfc6_t *ctx, uint8_t *tag_uid, uint8_t *tag_uid_len );

Example Description

This example demonstrates the use of NFC 6 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 and logger, performs the Click default configuration and reads the device ID.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    nfc6_cfg_t nfc6_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.
    nfc6_cfg_setup( &nfc6_cfg );
    NFC6_MAP_MIKROBUS( nfc6_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == nfc6_init( &nfc6, &nfc6_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( NFC6_ERROR == nfc6_default_cfg ( &nfc6 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    uint8_t device_id[ 13 ] = { 0 };
    nfc6_send_command ( &nfc6, NFC6_CMD_IDN, NULL, NULL );
    if ( NFC6_OK == nfc6_read_data ( &nfc6, device_id, sizeof ( device_id ), NULL ) )
    {
        log_printf ( &logger, " Device ID: %s\r\n", device_id );
    }

    log_info( &logger, " Application Task " );
}

Application Task

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

void application_task ( void )
{
    uint8_t tag_uid[ NFC6_TAG_UID_MAX_LEN ] = { 0 };
    uint8_t tag_uid_len = 0;
    if ( NFC6_OK == nfc6_read_mifare_tag_uid ( &nfc6, tag_uid, &tag_uid_len ) )
    {
        log_printf( &logger, " TAG UID: " );
        for ( uint8_t cnt = 0; cnt < tag_uid_len; cnt++ )
        {
            log_printf( &logger, "0x%.2X ", ( uint16_t ) tag_uid[ cnt ] );
        }
        log_printf( &logger, "\r\n----------------------------------\r\n" );
        Delay_ms ( 500 );
    }
}

Note

Only ISO14443-A type 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.NFC6

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.


ALSO FROM THIS AUTHOR

NFC Tag 4 Click

0

NFC Tag 4 Click is NFC tag device, offering 16 Kbit of electrically erasable programmable memory (EEPROM).

[Learn More]

Charger 3 Click

0

Charger 3 Click is a compact add-on board that represents a standalone battery charger with thermal regulation. This board features the TP4056, a complete constant-current/constant-voltage linear charger for single-cell lithium-ion batteries from NanJing Top Power ASIC Corp.

[Learn More]

IR eclipse click

5

This is a example which demonstrates the use of IR eclipse click board. The EE-SS198 is a photointerrupter sensor that consists of an IR diode and phototransistor in one package When the beam from the transmitter is eclipsed by placing an object in the gap (like a piece of paper), the sensor is activated.

[Learn More]