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 (136886 times)
  2. FAT32 Library (70013 times)
  3. Network Ethernet Library (56001 times)
  4. USB Device Library (46305 times)
  5. Network WiFi Library (41933 times)
  6. FT800 Library (41208 times)
  7. GSM click (29017 times)
  8. PID Library (26426 times)
  9. mikroSDK (26398 times)
  10. microSD click (25386 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

UNIQUE ID click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: ID

Downloaded: 81 times

Not followed.

License: MIT license  

Unique ID click carries DS2401, an enhanced silicon serial number IC. It’s a low cost solution for providing a unique registration number to your design.

No Abuse Reported

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

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

Do you want to report abuse regarding "UNIQUE ID click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


UNIQUE ID click

Unique ID click carries DS2401, an enhanced silicon serial number IC. It’s a low cost solution for providing a unique registration number to your design. The chip consists of a factory-lasered 64-bit ROM that includes a uniques a 48-bit serial number, an 8-bit CRC, and an 8-bit family code. It uses 1-wire communications for interfacing with the target board microcontroller, either through a GP1 or GP0 pin (here in place of the default AN and PWM mikroBUS pins). The board is designed to use either a 3.3V or 5V power supply.

uniqueid_click.png

click Product page


Click library

  • Author : Aleksandra Cvjeticanin
  • Date : Feb 2022.
  • Type : One Wire type

Software Support

We provide a library for the UNIQUE ID 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 UNIQUE ID click driver.

Standard key functions :

  • uniqueid_cfg_setup Config Object Initialization function.

    void uniqueid_cfg_setup ( uniqueid_cfg_t *cfg );
  • uniqueid_init Initialization function.

    err_t uniqueid_init ( uniqueid_t *ctx, uniqueid_cfg_t *cfg );

Example key functions :

  • uniqueid_read_id This function reads Family Code and Serial Number of device's ROM memory.
    err_t uniqueid_read_id ( uniqueid_t *ctx, uint8_t *family, uint8_t *serial_num ); 

Example Description

This example demonstrates the use of UNIQUE ID click board by reading and displaying Family Code and Serial Number on the UART Terminal.

The demo application is composed of two sections :

Application Init

Initionalizes both logger config object and click config object.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    uniqueid_cfg_t uniqueid_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
    uniqueid_cfg_setup( &uniqueid_cfg );
    UNIQUEID_MAP_MIKROBUS( uniqueid_cfg, MIKROBUS_1 );
    if ( ONE_WIRE_ERROR == uniqueid_init( &uniqueid, &uniqueid_cfg ) ) 
    {
        log_error( &logger, " Initialization error." );
        for ( ; ; );
    }

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

Application Task

Demonstrates the usage of uniqueid_read_id function, which stores the Family Code and Serial Number of the click in family_code and serial_num variables. Both values will be displayed on the UART Terminal.

void application_task ( void )
{
    uint8_t family_code;
    uint8_t serial_num[ 6 ];

    if ( UNIQUEID_OK == uniqueid_read_id( &uniqueid, &family_code, &serial_num[ 0 ] ) )
    {
        log_printf( &logger, "Family Code = 0x%.2X\r\n", ( uint16_t ) family_code ); 
        log_printf( &logger, "Serial Number = 0x%.2X%.2X%.2X%.2X%.2X%.2X\r\n", 
                    ( uint16_t ) serial_num[ 0 ], ( uint16_t ) serial_num[ 1 ], 
                    ( uint16_t ) serial_num[ 2 ], ( uint16_t ) serial_num[ 3 ], 
                    ( uint16_t ) serial_num[ 4 ], ( uint16_t ) serial_num[ 5 ] ); 
    }      

    Delay_ms ( 1000 ); 
}

Note

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

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

TDC click

0

TDC Click is a compact add-on board that recognizes events and provides a digital representation of the time they occurred. This board features the TDC7200, a time-to-digital converter from Texas Instruments. The Time to Digital Converter (TDC) performs the function of a stopwatch and measures the elapsed time (time-of-flight or TOF) between a START pulse and up to five STOP pulses. The ability to measure from START to multiple STOPs gives users the flexibility to select which STOP pulse yields the best echo performance.

[Learn More]

NFC Tag 5 click

0

NFC Tag 5 Click is a compact add-on board that contains a compact NFC tag IC. This board features the M24LR64E-R, a dynamic NFC/RFID tag IC with a dual interface 64-Kbit EEPROM from STMicroelectronics. It features an I2C interface alongside an RF contactless interface operating at 13.56MHz, organized as 8192×8 bits in the I2C mode and 2048×32 bits in the ISO 15693 and ISO 18000-3 mode 1 RF mode. The M24LR64E-R also features an energy harvesting analog output and a user-configurable digital output pin, used as an interrupt, toggling during either RF write in progress or RF busy mode.

[Learn More]

mikromedia 7 for STM32F7

1

Mikromedia 7 for STM32F7 is a compact development system with lots of on-board peripherals which allow development of devices with multimedia contents.

[Learn More]