TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 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 (136652 times)
  2. FAT32 Library (69866 times)
  3. Network Ethernet Library (55901 times)
  4. USB Device Library (46244 times)
  5. Network WiFi Library (41871 times)
  6. FT800 Library (41108 times)
  7. GSM click (28965 times)
  8. PID Library (26403 times)
  9. mikroSDK (26328 times)
  10. microSD click (25342 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
Example

iButton click

Rating:

5

Author: MIKROE

Last Updated: 2018-07-17

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: 1-Wire

Downloaded: 5487 times

Not followed.

License: MIT license  

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.

No Abuse Reported

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

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

Do you want to report abuse regarding "iButton click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Example Blog

iButton click

iButton click

Native view of the iButton click board.

View full image
iButton click

iButton click

Front and back view of the iButton click board.

View full image
iButton Serial Number

iButton Serial Number

Native view of the iButton Serial Number.

View full image

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.
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 One wire communication.


Additional notes and information

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

Current 9 click

0

Current 9 Click is a compact add-on board providing a precise and accurate current sensing solution. This board features the CT415-HSN830DR, high-bandwidth and ultra-low-noise XtremeSense® TMR current sensor designed for the current range up to 30A from Crocus Technology. This sensor also features an integrated current-carrying conductor which handles rated current and generates a current measurement as a linear analog output voltage, accomplishing a total output error of about ±1% full-scale. After that, the user is allowed to process the output voltage in analog or digital form.

[Learn More]

DIGI POT 13 click

0

DIGI POT 13 Click is a compact add-on board that contains a digitally controlled potentiometer. This board features the MAX5419, a 256-tap non-volatile digital potentiometer from Analog Devices. On this Click board™, one digitally I2C-controlled potentiometer is realized with typical end-to-end resistance values of 200kΩ. It can operate from both 3.3V and 5V power supplies and provides a low 35ppm/ºC end-to-end nominal resistance temperature coefficient and only 5ppm/ºC ratiometric.

[Learn More]

AD-SWIO 3 click

0

AD-SWIO 3 Click is a compact add-on board representing a software configurable input/output solution for various purposes. This board features the AD74115H, a single-channel, software-configurable input and output with HART mode from Analog Devices. It provides many functionality for analog input, analog output, digital input, digital output, 2-wire, 3-wire, and 4-wire resistance temperature detector (RTD), and thermocouple measurement capability. The supply power and isolation part are managed by the ADP1034, a 3-channel isolated micropower management unit with seven digital isolators and programmable power control, also from Analog Devices.

[Learn More]