The I2C decoder I/O decodes analog data on an I2C bus to I2C data. Just measure the Clock and Data lines of the I2C bus with a scope and connect the measuring channels to the I2C decoder I/O. The I2C decoder I/O has auto level detection and auto bus speed detection. The output of the I2C decoder I/O can be shown in a Table sink.
The I2C decoder always needs two sources: the first connected source will be used as I2C SCL (clock) and the second connected source will be used as I2C SDA (data).
I2C communication uses 7 or 10 bit addresses, followed by a bit that indicates a read (1) or write (0) of that address. The I2C decoder displays the addresses in its output.
The following fields are extracted from the I2C communication and shown as a column in a table:
|The address in decimal notation
|The address in hexadecimal notation
|Indicating if the transmitted address was acknowledged
|Indicating if the data is read or written
|Indicating the size of the data
|The data in hexadecimal notation
|The data in decimal notation
|The data in ASCII notation
|Indicating if the last data byte was acknowledged
|Indicating various different bus states
Properties and actions
To control the behavior of the I2C decoder I/O, several properties and actions are available. These can be accessed through a popup menu which is shown when the I/O is right clicked in the Object Tree. The properties can also be accessed through its settings window which is shown when the I/O is double clicked in the Object Tree. To open the Object tree, click the Show object tree button.
By default, the settings window only shows the most used settings. When Advanced is ticked, the extended window with all settings is shown. See also the program settings.
The I2C decoder always needs two sources: the first connected source will be used as I2C SCL and the second connected source will be used as I2C SDA. When the sources are connected the wrong way, the Swap inputs action will correct it.
Level (SCL) and Level (SDA)
In order to decode the analog signals into a digital signal, the I²C decoder I/O compares the analog input signals with mid levels: anything above that level is considered "high" and anything below that level is considered "low". The Level (..) properties set a mid level for the SCL and SDA signal individually.
Hysteresis (SCL) and Hysteresis (SDA)
To minimize the effect of noise on the signals when comparing the signals to the mid levels, a Hysteresis can be used around these levels. Anything above "level + hysteresis/2" is considered "high" and anything below "level - hysteresis/2" is considered "low". The Hysteresis (..) properties set the size of the hysteresis for the SCL and SDA signal individually.
Auto detect level and hysteresis
Enabling Auto detect level and hysteresis will let the software determine a suitable mid level and hysteresis, based on the measured signal. Each time new data is available, the suitable levels and hystereses will be determined again. In streaming mode, levels and hystereses are determined once based on the first chunk of data and remain at these values though out the whole measurement.
Auto detect level and hysteresis is default enabled.
Ignore 10 bit addressing
When I2C uses 10 bit addressing, the highest 5 bits in the address field contain 11110 as an indicator that 10 bit addressing is used. The next byte then also contains address information. When Ignore 10 bit addressing is enabled, this mechanism is ignored and the address byte is decoded as an 7 bit address and the next byte is treated as data byte.