I2C Block

How this block appears in a Simulink model?

appearance.PNG

What can be configured?

Configuration Parameter Selectable Option/Value Description
I2C driver port 0--1 Select driver port
Clock Frequency (kHz) 100--400 Specify clock speed of selected I2C module configuration.
SDA pin Select pin for I2C SDA
SDA internal pullup Enable/disable internal pullup
SCL pin Select pin for I2C SCL
SCL internal pullup Enable/disable internal pullup
Bytes write count Specify number of bytes to write to I2C in a transaction.
Bytes read count Specify number of bytes to read from I2C in a transaction.
Enable I2C scan device ESP log message. Enable this to scan all i2c devices connected and display their salve addresses. To use this, feature a serial monitor is required.
Sample time (sec) -1 (inherited) or specify Specify sample time for the block

When to use this block?
This block can be used to communicate with a device suing I2C protocol

Demo

I2C demo

Previous : SPI Block
Next : ADC Block