Difference between revisions of "Component: I2C Multiplexer (TCA9548A) (Comms: System)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/I2C_Multiplexer_TCA9548A.fcfx FC_Comp_Source_temp/I2C_Multiplexer_TCA9548A.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/I2C_Multiplexer_TCA9548A.fcfx FC_Comp_Source_temp/I2C_Multiplexer_TCA9548A.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 79: | Line 79: | ||
{{Fcfile|I2C_Multiplex_Example.fcfx|I2C Multiplex Example}} | {{Fcfile|I2C_Multiplex_Example.fcfx|I2C Multiplex Example}} | ||
+ | |||
+ | |||
Line 85: | Line 87: | ||
==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=== | ===SelectChannel=== | ||
Line 118: | Line 134: | ||
|- | |- | ||
| colspan="2" | Range: 0-255 / Bit0=CH0 EN / Bit1 = CH1 EN etc | | colspan="2" | Range: 0-255 / Bit0=CH0 EN / Bit1 = CH1 EN etc | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
Revision as of 12:01, 3 February 2023
Author | MatrixTSL |
Version | 1.0 |
Category | Comms: System |
Contents
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_temp/I2C_Multiplexer_TCA9548A.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_temp/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.
Macro reference
Initialise
![]() |
Initialise |
Startup the I2C bus ready for communications. | |
![]() |
Return |
SelectChannel
![]() |
SelectChannel |
Selects a single output channel to multiplex the I2C output to (0-7). | |
![]() |
Channel |
Range: 0-7 | |
![]() |
Return |
SetChannelMask
![]() |
SetChannelMask |
Allows a user determined number of channels to be connected to the I2C bus. | |
![]() |
Mask |
Range: 0-255 / Bit0=CH0 EN / Bit1 = CH1 EN etc | |
![]() |
Return |