TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136813 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55952 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41892 times)
  6. FT800 Library (41197 times)
  7. GSM click (28990 times)
  8. PID Library (26420 times)
  9. mikroSDK (26376 times)
  10. microSD click (25383 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

Smart Card 2 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.6

mikroSDK Library: 2.0.0.0

Category: Adapter

Downloaded: 118 times

Not followed.

License: MIT license  

Smart Card 2 Click is a compact add-on board for reading smart cards. This board features Microchip’s SEC1210, a low-power single-chip Smart Card controller with a UART interface. The SEC1210 bridge controller uses a combination of hardware and software to deliver high-performance and flexible design customization options. It is fully compliant with standards like ISO/IEC 7816, EMV 4.2/4.3, ETSI TS 102 221, and PC/SC, utilizing TrustSpan™ technology that enables digital systems to communicate securely, process, move and store information. With its onboard card holder, it supports data processing with 2FF smart cards, and with an additional connector for external connection, it also allows the processing of a standard 1FF card.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Smart Card 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Smart Card 2 click" changes.

Do you want to report abuse regarding "Smart Card 2 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Smart Card 2 click

Smart Card 2 Click is a compact add-on board for reading smart cards. This board features Microchip’s SEC1210, a low-power single-chip Smart Card controller with a UART interface. The SEC1210 bridge controller uses a combination of hardware and software to deliver high-performance and flexible design customization options. It is fully compliant with standards like ISO/IEC 7816, EMV 4.2/4.3, ETSI TS 102 221, and PC/SC, utilizing TrustSpan™ technology that enables digital systems to communicate securely, process, move and store information. With its onboard card holder, it supports data processing with 2FF smart cards, and with an additional connector for external connection, it also allows the processing of a standard 1FF card.

smartcard2_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Nov 2022.
  • Type : UART type

Software Support

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

Standard key functions :

  • smartcard2_cfg_setup Config Object Initialization function.

    void smartcard2_cfg_setup ( smartcard2_cfg_t *cfg );
  • smartcard2_init Initialization function.

    err_t smartcard2_init ( smartcard2_t *ctx, smartcard2_cfg_t *cfg );

Example key functions :

  • smartcard2_send_ccid This function sends the CCID command message by using UART serial interface.

    err_t smartcard2_send_ccid ( smartcard2_t *ctx, smartcard2_ccid_t *data_in );
  • smartcard2_read_ccid This function reads a CCID response or event message by using UART serial interface.

    err_t smartcard2_read_ccid ( smartcard2_t *ctx, smartcard2_ccid_t *data_out );
  • smartcard2_icc_power_on This function activates the card by performing an ICC power ON command. The device will respond with a data block containing ICC ATR (Answer to Reset) message.

    err_t smartcard2_icc_power_on ( smartcard2_t *ctx, uint8_t power_sel );

Example Description

This example demonstrates the use of Smart Card 2 click board by checking the SIM card presence and activating the card on insert. The card should respond with an ATR (Answer to Reset) message.

The demo application is composed of two sections :

Application Init

Initializes the driver and enables the device.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    smartcard2_cfg_t smartcard2_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.
    smartcard2_cfg_setup( &smartcard2_cfg );
    SMARTCARD2_MAP_MIKROBUS( smartcard2_cfg, MIKROBUS_1 );
    if ( UART_ERROR == smartcard2_init( &smartcard2, &smartcard2_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

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

Application Task

Reads and parses all CCID messages received from the device. Checks the SIM card presence and activates it if it's inserted. The card should respond with an ATR (Answer to Reset) message. All data is being logged on the USB UART where you can track their changes.

void application_task ( void )
{
    smartcard2_ccid_t ccid = { 0 };
    if ( SMARTCARD2_OK == smartcard2_read_ccid ( &smartcard2, &ccid ) )
    {
        smartcard2_display_ccid_message ( ccid );
    }
    if ( SMARTCARD2_ICC_PRESENT == icc_status )
    {
        log_printf( &logger, " Activating card... \r\n" );
        smartcard2_icc_power_on ( &smartcard2, SMARTCARD2_POWER_SEL_3V );
        Delay_ms ( 100 );
    }
}

Note

This example doesn't parse ATR messages. There are some online ATR parsers which could be used for decoding those messages. For example: https://smartcard-atr.apdu.fr/

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

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

DC Motor 16 click

0

DC Motor 16 Click is a compact add-on board that contains a high-performance single phase reversible DC motor drive with speed control. This board features the ZXBM5210, a fully-featured DC motor drive solution with an average current capability of up to 700mA from Diodes Incorporated. The ZXBM5210 has several modes of operations selected by two GPIO pins, has a wide supply voltage range from 3V to 18V, and low power consumption.

[Learn More]

Buck-Boost 4 click

0

Buck-Boost 4 Click is a compact add-on board that contains a buck-boost DC/DC converter with four integrated MOSFETs. This board features the TPS55289, a buck-boost converter from Texas Instruments. It can deliver on its output voltages from 0.8 up to 22V, from the input voltage in a range of 3 up to 30V. The output voltage can be programmed in 10mV steps.

[Learn More]

Thermo 7 click

5

Thermo 7 click is a Click board equipped with the sensor IC, which can digitize temperature measurements between -55°C and +125°C so that the temperature measurement data can be processed by the host MCU.

[Learn More]