Jump to content

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

From Flowcode Help
Author MatrixTSL
Version 1.0
Category Comms: System


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.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_I2C_Multiplexer_TCA9548A.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_I2C_Multiplexer_TCA9548A.fcfx

Detailed description

No detailed description exists yet for this component

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.


I2C Multiplex Example






Macro reference

Initialise

Initialise
Startup the I2C bus ready for communications. 
- VOID Return


SelectChannel

SelectChannel
Selects a single output channel to multiplex the I2C output to (0-7). 
- BYTE Channel
Range: 0-7 
- VOID Return


SetChannelMask

SetChannelMask
Allows a user determined number of channels to be connected to the I2C bus. 
- BYTE Mask
Range: 0-255 / Bit0=CH0 EN / Bit1 = CH1 EN etc 
- VOID Return


Property reference

Properties
Multiplexer Properties
Address Bits
 
I2C Properties
Connections
Channel
Channel selection 
SDA
Pin used for SDA (data signal) 
SCL
Pin used for SCL (clock signal) 
Options
Stop Delay
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
Baud rate option selector 
Baud Rate
Baud rate to be used 
Simulation
Simulate Comms