iButton click - is an iButton™ probe Click board™. The iButton is a technology based on the one-wire communication protocol, and a chip usually packed in a robust stainless steel casing. The button-shaped iButton device has two contacts - the lid and the base. These contacts carry the necessary connections down to a sensitive silicone chip, embedded inside the metal button. When the iButton touches the reader probe on the Click board™, it establishes the communication with the host MCU, via the one-wire interface. The communication is almost instant, so it is enough to press the iButton lightly to the probe contacts. Note: The Click board™ comes with the DS1990A, a serial number iButton™ device with a unique 64-bit serial number. For more information on the serial number iButton™ device, please visit the official product page.
Description
iButton click - is an iButton™ probe Click board™. The iButton is a technology based on the one-wire communication protocol, and a chip usually packed in a robust stainless steel casing. The button-shaped iButton device has two contacts - the lid and the base. These contacts carry the necessary connections down to a sensitive silicone chip, embedded inside the metal button. When the iButton touches the reader probe on the Click board™, it establishes the communication with the host MCU, via the one-wire interface. The communication is almost instant, so it is enough to press the iButton lightly to the probe contacts.
Due to its robustness, the iButton can withstand much more stress than similar devices used to carry an information: tags, cards, and other such devices are prone to damage, while a chip packed inside a thick stainless steel can be highly resilient. This Click board™ carries an iButton probe, along with two LEDs. It can be used to interface any iButton with the host MCU, displaying the resulting status information on any of the two independently programmed LEDs. This Click board™ is very useful for building a wide range of applications that can utilize a wide number of different iButton devices.
How does it work?
iButton click carries the CZ-0-PIN, a high-quality iButton probe from Demiurge company. The metal probe ensures resistance to dirt, dust, moisture, shock and other environmental hazards while ensuring good alignment with the iButton device, at the same time. The manufacturer guarantees compatibility with Maxim iButton devices, but any other device compatible with the maxim iButton can be read by the probe.
The iButton device is capable of powering itself up through the data line by employing the so-called parasite power supply. This Click board™ is equipped with the pull-up resistor to the 3.3V mikroBUS™ rail, providing power for the iButton that way. So-called parasite PSU of the iButton contains an internal capacitor, which provides enough current for the proper operation, once it has been charged by the data line. To allow proper functioning of the parasitic PSU, the idle state of the data line is HIGH, while the data line of the iButton device is in an open-drain configuration, pulling the data line to a LOW logic level when asserted.
The 1-Wire communication line is routed to the SMD jumper, which allows routing of the 1-Wire communication either to the PWM pin or to the AN pin of the mikroBUS™. These pins are labeled GP0 and GP1 respectively, the same as the SMD jumper positions, making the selection of the desired pin simple and straightforward.
The green LED labeled as ST1 is routed to the RST pin of the mikroBUS™, while the red LED is labeled as ST2 and it is routed to the CS pin of the mikroBUS™. These two pins allow visual feedback from the software, for example, if the serial number of the docked iButton matches the authorization criteria, the green LED can be used to signal it. These LEDs are can be used for any type of signalization, and are not directly connected with the iButton device itself.
Specifications
Type
1-wire
Applications
An ideal solution for building a wide range of applications that can utilize a wide number of different iButton devices
On-board modules
CZ-0-PIN, a high quality iButton probe from Demiurg company
Key Features
The metal probe ensures good alignment of the iButton device, two programmable LEDs that can be used for the status report, simple software development with the included library functions
Interface
1-wire
Input Voltage
3.3V
Click board size
M (42.9 x 25.4 mm)
Pinout diagram
This table shows how the pinout on iButton click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes
Pin
Pin
Notes
1-Wire Data IN/OUT
GP0
1
AN
PWM
16
GP1
1-Wire Data IN/OUT
Red LED Cathode
ST2
2
RST
INT
15
NC
Green LED Cathode
ST1
3
CS
RX
14
NC
NC
4
SCK
TX
13
NC
NC
5
MISO
SCL
12
NC
NC
6
MOSI
SDA
11
NC
Power supply
+3.3V
7
3.3V
5V
10
NC
Ground
GND
8
GND
GND
9
GND
Ground
Onboard settings and indicators
Label
Name
Default
Description
PWR
PWR
-
Power LED indicator
ST1
ST1
-
User programmable GREEN LED
ST2
ST2
-
User programmable RED LED
JP1
GP0, GP1
Left
1-Wire data comm. pin selection: left position GP0, right position GP1
Software support
We provide a demo application for iButton click on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Initializes and defines the GPIO click driver and functions witch turn on or turn off the LED.
Key functions:
void ibutton_enableGreenLed(uint8_t state); - The function enables or disables a green LED on click (RST pin) depending on the state of the parameter value.
void ibutton_enableRedLed(uint8_t state); - The function enables or disables a red LED on the Click board™ (CS pin) depending the on the state of the parameter valuer.
Example description
The application is composed of three sections:
System Initialization - Initializes the peripherals and pins.
Application Initialization - Initializes the Click board™ driver.
Application Task - Realizes communication between the iButton and buffer (EEPROM) which includes reading, writing and comparing values.
uint8_t Check_ibutton(uint8_t *ibutton_data) - Compares iButton data values with buffer data values.
uint8_t Check_CRC(uint8_t *ibutton)
void Do_something(void) - Enables red LED on click and disables green LED on click.
void Do_something_else(void) - Enables green LED on the Click board and disables red LED on click.
uint8_t Add_key() - Writes iButton data to buffer data in first free location.
uint8_t * Read_from_EEPROM(uint8_t key_num, uint8_t *buffer_data) - Reads data from the buffer (EEPROM).
uint8_t Read_Key() - Reads iButton data, compares this data with buffer data and depending on the comparison calls other functions to do something.
uint8_t Get_Free_Location(uint8_t *buffer_data) - Returns the value of the first free buffer location.
void Write_to_EEPROM(uint8_t key_num, uint8_t *buffer_data, uint8_t *ibutton_data) - Writes data to buffer (EEPROM).
uint8_t *Get_data() - Realizes One wire communication.
The full application code, and ready to use projects can be found on our Libstock page.
Additional notes and information
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.
mikroSDK
This click board is supported by mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.