i2ctocan 2.0.0.0
|
I2C to CAN Click is a compact add-on board that contains I2C to CAN-physical transceiver, which extends a single-master I2C bus through harsh or noisy environments. This board features the LT3960, a robust high-speed transceiver that extends a single-master I2C bus up to 400kbps using the CAN-physical layer from Analog Devices. One LT3960 from SCL and SDA I2C lines creates equivalent differential buses (CAN) on two twisted pairs, while the second LT3960 recreates the I2C bus locally for any slave I2C devices on the other end of the twisted pairs. A built-in 3.3V LDO powers both the I2C and CAN lines from a single input supply from 4V to 60V. This Click boardâ„¢ is suitable for industrial and automotive networking, remote sensor applications, and more.
We provide a library for the I2cToCan Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on mikroE github account.
This library contains API for I2cToCan Click driver.
i2ctocan_cfg_setup
Config Object Initialization function. i2ctocan_init
Initialization function. i2ctocan_default_cfg
Click Default Configuration function. i2ctocan_set_slave_address
Set I2C Slave address function. i2ctocan_generic_write
I2C to CAN I2C writing function. i2ctocan_generic_read
I2C to CAN I2C reading function. This library contains API for the I2C to CAN click driver. This demo application shows an example of an I2C CAN click wired to the VAV Press click for reading differential pressure and temperature measurement.
The demo application is composed of two sections :
Initialization of I2C module and log UART. After driver initialization and default settings, the app set VAV Press click I2C slave address ( 0x5C ) and enable device.
This is an example that shows the use of an I2C to CAN click boardâ„¢. Logs pressure difference [ Pa ] and temperature [ degree Celsius ] values of the VAV Press click wired to the I2C to CAN click boardâ„¢.
Results are being sent to the Usart Terminal where you can track their changes.
Additional Function :
get_dif_press_and_temp
Get differential pressure [ Pa ] and temperature [ degree Celsius ] function. The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), 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 Mikroelektronika compilers.