How does it work?
LLC-I2C click does not use an integrated circuit, as already mentioned. With ICs avoided completely, there are some benefits gained: the overall cost of the LLC circuit is greatly reduced, a more robust MOSFET solution reduces the failure rate, and when powered off, both the low voltage and the high voltage sides are isolated from one another (by non-conductive MOSFETs). This type of circuit is sometimes referred to as a level shifting or level translating circuit and it is often necessary when the I2C slave device (typically a sensor IC) uses different logic voltage levels for the I2C communication than the master device, which is a host microcontroller in most cases. The conversion of this circuitry is bi-directional, which makes it suitable to be used with the I2C communication protocol.
The I2C protocol was first introduced by NXP Semiconductors (formerly Philips Semiconductors), in 1982. They also introduced an application note that explains the operation of the LLC circuit in more details. The circuit is divided into low-side and high-side sections for future reference, although the circuit is symmetrical and can be used in both directions.
When there is no communication going on, both gates and sources of the MOSFETs are pulled up to their specific reference voltage levels. This will turn OFF both MOSFETs since there is no gate-source voltage difference (e.g. VG=VS=VSL).
Since the I2C is operated by asserting its bus lines to a LOW logic level, when the source terminal of the MOSFET on one side (e.g. high-side) is driven to a LOW logic level, its VGS potential will rise since the gate voltage is fixed. When the VGS reaches the threshold voltage (1.2V typically for the used transistors), the MOSFET will turn ON, conducting current through the body diode of the opposite-side (low-side) MOSFET, which will become directly polarized. This mechanism can be used to convert signal levels in both directions, within the whole operating range of the used MOSFETs.
The reference voltage for the high-side can be selected by using the SMD jumper labeled as VCC SEL. The pull-up voltage for the high-side can be selected from the mikroBUS™ power rails, so it can be either 3.3V or 5V. For the low-side, an arbitrary reference voltage can be applied to the VSL pin of the J1 header, respecting the maximum voltage rating. J1 is the standard, 2.54mm pin-header. The low-side I2C bus pins are also routed to the J1 header, allowing an external device to be connected (using the standard wire-jumpers). As already mentioned, the low-side can actually use higher voltage levels than the master, but in most usage scenarios, it will be lower than the master, thus the terminology.
Specifications
Type
Port expander
Applications
I2C logic level conversion circuit has its use in many different projects. It is used for the I2C logic voltage level matching between the slave and the master device
On-board modules
None
Key Features
Very low cost achieved using only passive elements, and four MOSFETs, ability to use an arbitrary voltage level conversion in the range from 1.2V up to 10V
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on LLC-I2C Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
PWR | PWR | – | Power LED indicator |
VCC SEL | VCC SEL | Left | Logic voltage level selection (master): left position 3.3V, right position 5V |
J1 | – | – | I2C bus with the converted voltage levels (I2C slave) |
Software Support
We provide a library for the LLC-I2C Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for LLC-I2C Click driver.
Key functions
-
This function writes data to the desired register.
-
This function reads data from the desired register.
Example Description
This click can be utilized as the level converter for logic signals. The topology of this logic level conversion (LLC) circuit is perfectly suited for the bi-directional I2C communication.
void application_task ( void )
{
// Thermo 7 measurement Temperature
uint8_t write_reg = 0x00;
uint8_t read_reg[ 2 ] = { 0 };
float temp_msb;
uint8_t temp_lsb;
llci2c_generic_read ( &llci2c, write_reg, read_reg, 2 );
temp_msb = read_reg[ 0 ];
temp_lsb = read_reg[ 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;
log_info( &logger, " Ambient temperature : %2.f C", temp_msb );
Delay_ms ( 1000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.LlcI2c
Additional notes and informations
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.