TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136537 times)
  2. FAT32 Library (69730 times)
  3. Network Ethernet Library (55841 times)
  4. USB Device Library (46172 times)
  5. Network WiFi Library (41800 times)
  6. FT800 Library (40985 times)
  7. GSM click (28921 times)
  8. PID Library (26383 times)
  9. mikroSDK (26277 times)
  10. microSD click (25297 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

LLC I2C click

Rating:

6

Author: MIKROE

Last Updated: 2018-12-18

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Port expander

Downloaded: 3273 times

Not followed.

License: MIT license  

LLC I2C click can be utilized as the level converter for the logic signals, which makes it a very useful Click board. The topology of this logic level conversion (LLC) circuit is perfectly suited for the bi-directional I2C communication.

No Abuse Reported

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

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

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

LLC I2C click

LLC I2C click

Native view of the LLC I2C click board.

View full image
LLC I2C click

LLC I2C click

Front and back view of the LLC I2C click board.

View full image

Library Description

The library contains functions for starting, writing data to I2C wires and reading data from I2C wires.

Key functions:

  • void i2cllc_start() - The function executes start condition on I2C wires.
  • void i2cllc_write(uint8_t slaveAddress, uint8_t *pBuf, uint16_t nBytes, uint8_t endMode) - The function should execute write sequence on I2C wires.
  • void i2cllc_read(uint8_t slaveAddress, uint8_t *pBuf, uint16_t nBytes, uint8_t endMode) - The function should execute read sequence on I2C wires.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes I2C module
  • Application Initialization - Initialization driver init
  • Application Task - (code snippet) - Reads the temperature from the Thermo 7 click board and logs data to UART.

Note: The start configuration chip is required at the beginning of each program so that the chip wakes up and prepares for operation and measurement. What is included and set in the start-up function can be viewed in the help file.

void applicationTask()
{
    // Thermo 7 measurement Temperature
    uint8_t writeReg[ 1 ];
    uint8_t readReg[ 2 ] = {0};
    
    float Temp_msb;
    uint8_t Temp_lsb;
    char  tempText[ 50 ];

    writeReg[ 0 ] = 0x00;
    i2cllc_start();
    i2cllc_write( 0x48, &writeReg[0], 1, _I2CLLC_END_MODE_RESTART );
    i2cllc_read( 0x48, &readReg[0], 2, _I2CLLC_END_MODE_STOP );
    
    Temp_msb = readReg[ 0 ];
    Temp_lsb = readReg[ 1 ] & 0xF0;

    if( temp_lsb & 0x80 ) Temp_msb += 0.50;
    if( temp_lsb & 0x40 ) Temp_msb += 0.25;
    if( temp_lsb & 0x20 ) Temp_msb += 0.125;
    if( temp_lsb & 0x10 ) Temp_msb += 0.0625;

    FloatToStr(Temp_msb, tempText);
    mikrobus_logWrite(" Ambient temperature : ", _LOG_TEXT );
    mikrobus_logWrite(tempText, _LOG_TEXT);
    mikrobus_logWrite(" C", _LOG_LINE);
    Delay_ms( 1000 );
}

Other mikroE Libraries used in the example:

I2C

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

Proximity click

0

Proximity Click features VCNL4010 proximity and ambient light sensor. It combines an infrared emitter and PIN photodiode for proximity measurement with a range of up to 20cm.

[Learn More]

IR Grid click

0

IR Grid click is a thermal imaging sensor. It has an array of 64 very sensitive factory calibrated IR elements (pixels), arranged in 4 rows of 16 pixels, each measuring an object temperature up to 300˚C within its local Field of View (FOV). The MLX90621ESF-BAD IR sensor used on this Click board™ has only four pins, and it is mounted inside of the industry standard TO39 package. It is equipped with 2Kbit of EEPROM for storing the compensation and calibration parameters.

[Learn More]

Smart Sens 2 click

0

Smart Sens 2 Click is a compact add-on board that contains a smart sensor system with an integrated IMU sensor. This board utilizes the BHI260AP, BME688, BMP390, and BMM150, an ultra-low-power programmable smart sensor, environmental and pressure sensor, and a magnetometer from Bosch Sensortec. The BHI260AP includes a powerful 32-bit MCU and a 6-axis IMU (3-axis accelerometer and 3-axis gyroscope) alongside an event-driven software framework. In addition to its internal functions also perform signal data processing from several onboard sensors performing measurements of various parameters such as an environmental and magnetic field. In addition to these primary functions, this Click board™ allows users to select the desired serial interface, use the debug interface, and select BOOT mode.

[Learn More]