Difference between revisions of "Component: I2C Multiplexer (TCA9548A) (Comms: System)"

From Flowcode Help
Jump to navigationJump to search
 
(11 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
==I2C Multiplexer (TCA9548A) component==
 
==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.
 
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: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_I2C_Multiplexer_TCA9548A.fcfx FC_Comp_Source_I2C_Multiplexer_TCA9548A.fcfx]
 +
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_I2C_Multiplexer_TCA9548A.fcfx FC_Comp_Source_I2C_Multiplexer_TCA9548A.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 26: Line 48:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 42: Line 80:
 
{{Fcfile|I2C_Multiplex_Example.fcfx|I2C Multiplex Example}}
 
{{Fcfile|I2C_Multiplex_Example.fcfx|I2C Multiplex Example}}
  
==Downloadable macro reference==
 
  
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
==Macro reference==
 +
 +
===Initialise===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Startup the I2C bus ready for communications. 
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 +
 +
===SelectChannel===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 62: Line 125:
  
  
 +
===SetChannelMask===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 78: Line 142:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Startup the I2C bus ready for communications. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
  
  
Line 101: Line 150:
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Multiplexer Properties
 
|-
 
|-
 
|-
 
|-
Line 108: Line 161:
 
| colspan="2" |  
 
| colspan="2" |  
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Stop Delay
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I2C Properties
 
|-
 
|-
| colspan="2" | 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.  
 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Baud Select
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
| colspan="2" | Baud rate option selector 
 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Baud Rate
+
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | Baud rate to be used 
+
| colspan="2" | Channel selection 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Scope Traces
+
| width="90%" | SDA
 
|-
 
|-
| colspan="2" | 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. 
+
| colspan="2" | Pin used for SDA (data signal) 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Console Data
+
| width="90%" | SCL
 
|-
 
|-
| colspan="2" | Selects if the console data is automatically generated or not 
+
| colspan="2" | Pin used for SCL (clock signal) 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Injector
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Options
 
|-
 
|-
| colspan="2" | Specifies the injector component on the panel to interact with to provide comms simulation. 
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
+
| width="90%" | Stop Delay
 
|-
 
|-
 +
| colspan="2" | 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.  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
+
| width="90%" | Baud Select
 
|-
 
|-
| colspan="2" | Channel selection 
+
| colspan="2" | Baud rate option selector 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| width="90%" | SDA
+
| width="90%" | Baud Rate
 
|-
 
|-
| colspan="2" | Pin used for SDA (data signal) 
+
| colspan="2" | Baud rate to be used 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | SCL
 
|-
 
| colspan="2" | Pin used for SCL (clock signal) 
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
|-
 
|-
 
|-
 
|-

Latest revision as of 13:10, 7 February 2023

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.


FC6 Icon.png I2C Multiplex Example






Macro reference

Initialise

Fc9-comp-macro.png Initialise
Startup the I2C bus ready for communications. 
Fc9-void-icon.png - VOID Return


SelectChannel

Fc9-comp-macro.png SelectChannel
Selects a single output channel to multiplex the I2C output to (0-7). 
Fc9-u8-icon.png - BYTE Channel
Range: 0-7 
Fc9-void-icon.png - VOID Return


SetChannelMask

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


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Multiplexer Properties
Fc9-type-16-icon.png Address Bits
 
Fc9-conn-icon.png I2C Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-conn-icon.png Options
Fc9-type-7-icon.png 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.  
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms