How does it work?
I2C 1-Wire 2 Click is based on the DS2485, an advanced 1-Wire master with memory from Analog Devices. The core function of the DS2485 involves facilitating the protocol transition between the I2C master interface and any connected 1-Wire slave devices. It is equipped with internal, adjustable timers that manage the 1-Wire signaling, thereby offloading the host processor of the duty to produce timing-sensitive 1-Wire signals. This feature allows for both regular and accelerated 1-Wire communication rates. An internal weak pull-up can pull the 1-Wire line up, an external resistor by populating R6 with a chosen resistance value, or combining internal and external pull-up methods for enhanced flexibility. This Click board™ is predominantly utilized in industrial sensor and tool applications, temporary consumables, and for identifying printer cartridges.
Upon receiving commands and data, the DS2485’s input/output management unit takes over the execution of crucial 1-Wire operations such as the reset/presence-detection cycle, byte reading and writing, block reading and writing, single-bit read/write operations, executing triplets for ROM search activities, and handling complete command sequences for 1-Wire authenticators—all without the need for continuous host processor intervention.
Featuring a 0.75Kb EEPROM array, the DS2485 offers general-purpose, reprogrammable memory distributed across three 32-byte pages at even-numbered addresses, while odd-numbered pages are locked and inaccessible. Each of these even-numbered pages comes with optional security settings.
For communication with the host processor, the DS2485 uses an I2C interface, supporting both standard and fast modes, with communication speeds up to 1MHz. Additionally, the device’s general-purpose I/O pin, available on the GPO terminal, can be managed independently via specific commands.
This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
1-Wire
Applications
Ideal for industrial sensors and tools, single-use consumables, and printer cartridge identification
On-board modules
DS2485 – advanced 1-Wire master with memory from Analog Devices
Key Features
I2C to 1-Wire protocol conversion, supports both standard and overdrive 1-Wire communication speeds, adjustable internal timers for signal management, flexible 1-Wire line pull-up options, 0.75Kb EEPROM with user-programmable memory, security features, independently operated GPIO, and more
Interface
1-Wire,I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on I2C 1-Wire 2 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 |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
I2C 1-Wire 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Software Support
We provide a library for the I2C 1-Wire 2 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 2 Click driver.
Key functions
-
i2c1wire2_master_reset
This function is used to reset device, and return all configuration registers to the default values. -
i2c1wire2_write_port_cfg
This function is used to write a 1-Wire configuration register. -
i2c1wire2_search
This function is used to perform 1-Wire Search algorithm and return one device ROMID.
Example Description
This example demonstrates the use of the I2C 1-Wire 2 Click board by searching if a device is connected and reading its ROMID.
void application_task ( void )
{
err_t error_flag;
uint8_t flag;
uint8_t last_flag;
uint8_t rom_id[ 8 ] = { 0 };
#define I2C1WIRE2_DEVICE_SEARCH_CODE 0xF0
error_flag = i2c1wire2_search ( &i2c1wire2, &flag, rom_id, &last_flag, I2C1WIRE2_SEARCH_RESET |
I2C1WIRE2_SEARCH_1WIRE_RESET, I2C1WIRE2_DEVICE_SEARCH_CODE );
if ( I2C1WIRE2_OK == error_flag )
{
if ( I2C1WIRE2_RESULT_BYTE_OK == flag )
{
log_printf( &logger, " Device found: rn" );
log_printf( &logger, " Device ROMID: 0x" );
for ( uint8_t n_cnt = 0; n_cnt < 8; n_cnt++ )
{
log_printf( &logger, "%.2X", ( uint16_t ) rom_id[ n_cnt ] );
}
log_printf( &logger, " rn" );
log_printf( &logger, " Last device flag %d rn", last_flag );
}
else if ( I2C1WIRE2_NO_DEVICE_DETECTED == flag )
{
log_printf( &logger, " No device detected rn" );
}
else if ( I2C1WIRE2_NO_PRESENCE_PULS == flag )
{
log_printf( &logger, " No presence puls rn" );
}
}
else
{
log_printf( &logger, " ERROR rn" );
}
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.I2C1Wire2
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.