20%
OFF
MIKROE-1892
26 g
Status:
I2C 1-Wire Click is a compact add-on board that performs bidirectional conversions between I2C master and 1-Wire slave devices. This board features the DS2482-800, an 8-channel 1-Wire master device from Analog Devices. The DS2482-800 interfaces directly to the Standard (100kHz max) or Fast Mode (400kHz max) I2C master to perform bidirectional protocol conversion between the I2C master and any downstream 1-Wire slave devices. Internal factory-trimmed timers relieve the host MCU from generating time-critical 1-Wire waveforms, supporting both Standard and Overdrive 1-Wire communication speeds. This Click board™ is suitable for controlling up to eight 1-Wire devices through a single I2C interface, such as EEPROMs, temperature sensors, and similar devices with momentary high source current modes.
I2C 1-Wire Click is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
This product is no longer in stock
Availability date:
I2C 1-Wire Click is based on the DS2482-800, a self-timed 8-channel 1-Wire master (relative to any attached 1-Wire slave device) from Analog Devices, performing bidirectional conversions between I2C master and 1-Wire slave devices. To optimize 1-Wire waveform generation, the DS2482-800 performs slew-rate control on rising and falling 1-Wire edges. It also has a programmable feature to mask the fast presence pulse edge that some 1-Wire slave devices can generate and programmable strong pull-up features that supports 1-Wire power delivery to 1-Wire devices such as EEPROMs, temperature sensors, and similar devices with momentary high source current modes.
The DS2482-800 communicates with an MCU using the standard I2C 2-Wire interface to read data and configure settings, supporting Fast Mode up to 400kHz. Once supplied with command and data, the I/O controller of the DS2482-800 performs time-critical 1-Wire communication functions such as reset/presence detect cycle, read-byte, write-byte, single-bit R/W and triplet for ROM search without requiring interaction with the host MCU. The host MCU obtains feedback and data (completion of a 1-Wire function, presence pulse, 1-Wire short, search direction taken) through the status and read data registers.
The DS2482-800 has a 7-bit slave address with the first four MSBs fixed to 0011. The address pins, A0, A1, and A2, are programmed by the user and determine the value of the last three LSBs of the slave address, allowing up to 8 devices to operate on the same bus segment. The value of these address pins can be set by positioning onboard SMD jumpers labeled as I2C ADR to an appropriate position marked as 1 or 0.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the PWR SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Type
1-Wire
Applications
Can be used for controlling up to eight 1-Wire devices through a single I2C interface
On-board modules
DS2482-800 - self-timed 8-channel 1-Wire master from Analog Devices
Key Features
I2C-to-1-Wire bridge, I2C interface with Standard and Fast Mode speed, 8 1-Wire channels, selectable I2C slave address, Standard and Overdrive 1-Wire speed, supports EEPROMs and temperature sensors, low power consumption, and more
Interface
1-Wire,I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
This table shows how the pinout on I2C 1-Wire Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED Indicator |
JP1-JP3 | I2C ADR | Right | I2C Address Selection 1/0: Left position 1, Right position 0 |
JP4 | PWR SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
HD1 | OW | Populated | 1-Wire Channels Header |
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | - | 5 | V |
We provide a library for the I2C 1 Wire 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 I2C 1 Wire Click driver.
Key functions
This function writes one byte to the click module.
This function reads one byte from the click module.
This function does a hardware reset of the click module.
Example Description
This example showcases how to initialize, confiure and use the I2C 1-Wire click. The click is a I2C (host) to 1-Wire interface (slave). In order for the example to work one or more
1-Wire (GPIO) click modules are required. Gnd goes to gnd, power goes to power and the cha- nnels are there to read data from connected modules.
void application_task ( void )
{
uint8_t chan_state;
uint8_t cnt_chan;
uint8_t cnt_val;
uint8_t id_code[ 9 ];
chan_state = 1;
i2c1wire_soft_reset( &i2c1wire );
Delay_10ms( );
i2c1wire_set_config( &i2c1wire, I2CONEWIRE_CONFIG_1WS_HIGH |
I2CONEWIRE_CONFIG_SPU_HIGH |
I2CONEWIRE_CONFIG_APU_LOW );
Delay_10ms( );
for( cnt_chan = 0; cnt_chan < 8; cnt_chan++ )
{
i2c1wire_set_channel( &i2c1wire, cnt_chan );
i2c1wire_one_wire_reset( &i2c1wire );
Delay_10ms( );
i2c1wire_write_byte_one_wire( &i2c1wire, I2CONEWIRE_WIRE_COMMAND_READ_ROM );
Delay_10ms();
for( cnt_val = 8; cnt_val > 0; cnt_val-- )
{
id_code[ cnt_val ] = i2c1wire_read_byte_one_wire( &i2c1wire );
if ( id_code[ cnt_val ] == I2CONEWIRE_WIRE_RESULT_OK )
{
log_printf( &logger, "rn Channel %d : No device on the channelrn", cnt_chan );
Delay_100ms( );
break;
}
else if ( chan_state )
{
log_printf( &logger, " Channel %d : ID = 0x", cnt_chan );
chan_state = 0;
}
log_printf( &logger, "%d", id_code[ cnt_val ] );
Delay_100ms( );
}
log_printf( &logger, "rn---------------------------------------rn" );
}
log_printf( &logger, "***rn" );
}
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:
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.
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.
NOTE: Please be advised that any peripheral devices or accessories shown connected to the Click board™ are not included in the package. Check their availability in our shop or in the YMAN section below.