TOP Contributors

  1. MIKROE (2693 codes)
  2. Alcides Ramos (362 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Bugz Bensce (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 (137949 times)
  2. FAT32 Library (70758 times)
  3. Network Ethernet Library (56444 times)
  4. USB Device Library (46825 times)
  5. Network WiFi Library (42586 times)
  6. FT800 Library (41785 times)
  7. GSM click (29468 times)
  8. mikroSDK (27020 times)
  9. PID Library (26661 times)
  10. microSD click (25797 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

1-Wire I2C click

Rating:

10

Author: MIKROE

Last Updated: 2019-05-23

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: 1-Wire

Downloaded: 6680 times

Not followed.

License: MIT license  

1-Wire I2C click converts the 1-wire signal from the MCU to I2C signal, which is then sent to the slave, and vice versa.

The click carries DS28E17 1-Wire-to-I2C master bridge from Maxim Integrated. 1-Wire I2C click runs on a 3.3V power supply.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "1-Wire I2C click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "1-Wire I2C click" changes.

Do you want to report abuse regarding "1-Wire I2C 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

mikroSDK Library Blog

1-Wire I2C click

1-Wire I2C click

Native view of the 1-Wire I2C click board.

View full image
1-Wire I2C click

1-Wire I2C click

Front and back view of the 1-Wire I2C click board.

View full image

Library Description

The library covers all the necessary functions to control OneWire I2C click board. 
The library performs the communication with the device via 1-Wire protocol by writing to registers and by reading from registers.

Key functions:

  • void onewirei2c_reset() - Reset function.
  • uint16_t onewirei2c_crc16( uint8_t *pData, uint8_t len ) - CRC calculation function.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes GPIO structures and start to write log.
  • Application Initialization -  Initialization driver enables - GPIO, reset OneWire I2C click and also write log.
  • Application Task - (code snippet) This is an example which demonstrates the use of OneWire I2C click board. OneWire I2C click communicates with register via One Wire protocol by the write to register and read from the register and communicating with Thermo 4 click. OneWire I2C will first send to the Thermo 4 click address and register address via I2C, and then read 2 bytes of data from that click. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes for every 1 sec.
void applicationTask() 
{
    onewirei2c_skipRom ();
    
    CRCPacket[ 0 ] = 0x5A;
    CRCPacket[ 1 ] = 0x90;
    CRCPacket[ 2 ] = 0x01;
    CRCPacket[ 3 ] = 0x00;

    CRCResult = onewirei2c_crc16( &CRCPacket, 4 );

    CRCPacket[ 0 ] = CRCResult & 0x00FF;
    CRCPacket[ 1 ] = ( CRCResult >> 8 ) & 0x00FF;

    onewirei2c_oneWireWrite( 0x5A );
    onewirei2c_oneWireWrite( 0x90 );
    onewirei2c_oneWireWrite( 0x01 );
    onewirei2c_oneWireWrite( 0x00 );

    onewirei2c_oneWireWrite( CRCPacket[ 0 ] );
    onewirei2c_oneWireWrite( CRCPacket[ 1 ] );
    
    owStatus = onewirei2c_oneWireRead();
    owStatus >>= 1;
    writeStatus = onewirei2c_oneWireRead();
    writeStatus >>= 1;

    onewirei2c_skipRom();

    CRCPacket[ 0 ] = 0x87;
    CRCPacket[ 1 ] = 0x91;
    CRCPacket[ 2 ] = 0x02;

    CRCResult = onewirei2c_crc16( &CRCPacket, 3 );

    CRCPacket[ 0 ] = CRCResult & 0x00FF;
    CRCPacket[ 1 ] = ( CRCResult >> 8 ) & 0x00FF;

    onewirei2c_oneWireWrite( 0x87 );
    onewirei2c_oneWireWrite( 0x91 );
    onewirei2c_oneWireWrite( 0x02 );

    onewirei2c_oneWireWrite( CRCPacket[ 0 ] );
    onewirei2c_oneWireWrite( CRCPacket[ 1 ] );

    owStatus = onewirei2c_oneWireRead();

    readData[ 0 ] = onewirei2c_oneWireRead();
    readData[ 1 ] = onewirei2c_oneWireRead();

    owStatus >>= 1;
    owStatus |= ( ( 0x01 & readData[ 0 ] ) * 0x80 );
    owStatus *= 0x80;

    readData[ 0 ] >>= 1;
    readData[ 0 ] |= ( ( 0x01 & readData[ 1 ] ) * 0x80 );

    ByteToStr( readData[ 0 ], logText );
    mikrobus_logWrite( " Temperature : ", _LOG_TEXT );
    mikrobus_logWrite( logText, _LOG_TEXT );

    if ( readData[ 1 ] > 0x7F )
    {
        mikrobus_logWrite( ".5 ",_LOG_TEXT );
    }
    else
    {
        mikrobus_logWrite( ".0 ", _LOG_TEXT );
    }

    mikrobus_logWrite( degCel, _LOG_LINE );

    Delay_1sec();
    Delay_1sec();    
}        

Other mikroE Libraries used in the example:

  • One_Wire
  • UART​
  • Conversion

Additional notes and informations

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

Color 17 click

0

Color 17 Click is a compact add-on board representing an accurate color-sensing solution. This board features the OPT4048, a high-speed precision tristimulus XYZ color sensor from Texas Instruments. The sensor has four sensing channels and uses precision optical filters to mimic the normal vision of the human eye. The OPT4048 also has 12 configurable conversion times that range from 600μs up to 800ms, with measurements that can be read synchronously or asynchronously. It is not excessively sensitive to micro-shadows and the small particles on the optical surface.

[Learn More]

Unique ID click

5

Unique ID click carries DS2401, an enhanced silicon serial number IC. The chip uses 1-wire communications for interfacing with the target board microcontroller.

[Learn More]

GNSS 6 click

0

GNSS 6 Click is a compact add-on board that provides fast positioning capabilities. This board features the Teseo-LIV3FL, a tiny low-power GNSS module from STMicroelectronics. It is an easy-to-use global navigation satellite system that embeds the Teseo III single-die standalone positioning receiver, which can work simultaneously on multiple constellations (GPS, Galileo, Glonass, BeiDou, and QZSS). It provides proven accuracy and robustness of the Teseo ICs and comes with embedded firmware that saves development time.

[Learn More]