Component: I2C Multiplexer (TCA9548A) (Comms: System)

From Flowcode Help
Revision as of 11:14, 30 July 2021 by BenR (talk | contribs) (→‎Examples)
Jump to navigationJump to search


Author MatrixTSL
Version 1.0 (Release)
Category Comms: System


Image I2C Multiplexer (TCA9548A) component

An I2C multiplexing IC allowing up to 8 different I2C busses to be connected to a single I2C channel on your target microcontroller.

Examples

Here we have a simple example showing how to use the multiplexer to connect multiple of the same I2C sensor IC to the microcontroller.

The multiplexer IC is connected directly to the microcontroller I2C pins and up to 8 temp/humidity sensors are connected to the CH0-CH7 I2C pins of the multiplexer.


FC6 Icon.png I2C Multiplex Example

Downloadable macro reference

SelectChannel

Selects a single output channel to multiplex the I2C output to (0-7).

Parameters

BYTE Channel
Range: 0-7


Return value

This call does not return a value


SetChannelMask

Allows a user determined number of channels to be connected to the I2C bus.

Parameters

BYTE Mask
Range: 0-255 / Bit0=CH0 EN / Bit1 = CH1 EN etc


Return value

This call does not return a value


Initialise

Startup the I2C bus ready for communications.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Address Bits

This property is of type Fixed list of ints and can be referenced with the variable name AddressBits.

No additional information


Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::CHANNEL.

Channel selection

SDA

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SDA.

Pin used for SDA (data signal)

SCL

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SCL.

Pin used for SCL (clock signal)

Stop Delay

This property is of type True or false and can be referenced with the variable name cal_i2c1::StopDel.

On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not

a 10ms delay between an I2C stop event and the next I2C start event.


Most modern microcontrollers will not have a problem so this property can be disabled to speed up the

I2C communications.

Baud Select

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::BAUD_LIST.

Baud rate option selector

Baud Rate

This property is of type Signed integer and can be referenced with the variable name cal_i2c1::BAUD.

Baud rate to be used

Simulate Comms

This property is of type True or false and can be referenced with the variable name SimComms.

No additional information


Scope Traces

This property is of type True or false and can be referenced with the variable name cal_i2c1::ScopeTraces.

Selects if the component pin connections are automatically generated on the data recorder window or not.

Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion.

No: Do not show the pin signals on the data recorder window.

Console Data

This property is of type True or false and can be referenced with the variable name cal_i2c1::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::Injector.

Specifies the injector component on the panel to interact with to provide comms simulation.