Tableau de clic iButton
Tableau de clic iButton
Le iButton Click Board™ est une sonde iButton. L'iButton est une technologie basée sur le protocole de communication à un fil et une puce généralement emballée dans un boîtier robuste en acier inoxydable. Le dispositif iButton en forme de bouton possède deux contacts - le couvercle et la base. Ces contacts transportent les connexions nécessaires jusqu'à une puce en silicium sensible, intégrée à l'intérieur du bouton métallique. Lorsque l'iButton touche la sonde du lecteur sur l' iButton Click Board™ , il établit la communication avec le MCU hôte, via l'interface à un fil. La communication est presque instantanée, il suffit donc d'appuyer légèrement l'iButton sur les contacts de la sonde.
The iButton Click Board™ - is an iButton™ probe. The iButton is a technology based on the 1-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 1-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 The iButton Click Board™ Work?
The iButton Click Board™ 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. The iButton 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 labelled 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 |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
Input Voltage | 3.3V |
PINOUT DIAGRAM
This table shows how the pinout of the iButton Click Board™ 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 the iButton Click Board™ 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 iButton Click Board™™ driver.
- Application Task - Realizes communication between the iButton and buffer (EEPROM) which includes reading, writing and comparing values.
void applicationTask() { uint8_t check_flag; if(!Ow_Reset(OW_PORT, OW_PIN)) { check_flag = Read_Key(); if(check_flag = 0) { mikrobus_logWrite("Key exist", _LOG_LINE); Delay_ms(500); }else { mikrobus_logWrite("Key doesn't exist", _LOG_LINE); Delay_ms(500); } } else { mikrobus_logWrite("Add new key", _LOG_LINE); Delay_ms(500); while(Ow_Reset(OW_PORT, OW_PIN)) { if(check_state == 0) { mikrobus_logWrite("Insert iButton", _LOG_LINE); Delay_ms(500); check_state = 1; } } check_flag = Add_key(); if(check_flag == 0) { mikrobus_logWrite("Key added", _LOG_LINE); Delay_ms(500); }else { mikrobus_logWrite("Key already exist", _LOG_LINE); Delay_ms(500); } mikrobus_logWrite("Read iButton", _LOG_LINE); check_state = 0; } Delay_ms(100); }
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 1-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 a 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
The iButton 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.
Software Support
We provide a demo application for the iButton Click Board™ 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 iButton Click Board™™ driver.
- Application Task - Realizes communication between the iButton and buffer (EEPROM) which includes reading, writing and comparing values.
void applicationTask() { uint8_t check_flag; if(!Ow_Reset(OW_PORT, OW_PIN)) { check_flag = Read_Key(); if(check_flag = 0) { mikrobus_logWrite("Key exist", _LOG_LINE); Delay_ms(500); }else { mikrobus_logWrite("Key doesn't exist", _LOG_LINE); Delay_ms(500); } } else { mikrobus_logWrite("Add new key", _LOG_LINE); Delay_ms(500); while(Ow_Reset(OW_PORT, OW_PIN)) { if(check_state == 0) { mikrobus_logWrite("Insert iButton", _LOG_LINE); Delay_ms(500); check_state = 1; } } check_flag = Add_key(); if(check_flag == 0) { mikrobus_logWrite("Key added", _LOG_LINE); Delay_ms(500); }else { mikrobus_logWrite("Key already exist", _LOG_LINE); Delay_ms(500); } mikrobus_logWrite("Read iButton", _LOG_LINE); check_state = 0; } Delay_ms(100); }
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 1-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 a 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
The iButton 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.
Tableau de clic iButton
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.