Hello,
Is there a simple example of using an I2C multiplexer (PCA9548A).
I found Stefan's post but I can't find a simple example or documentation.
My goal is to use the multiplexer to manage 6 or 8 analog output modules (MCP4725).
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
IΒ΄ll try to get this thread going again as iΒ΄m having simliar problems.
Right now i get a red triangle on my connected devices (iΒ΄m testing with a BME280 sensor and a PCA9685 resvo driver).
The TCA9548 have the green symbol beside it.
On the "red" devices i get that the bus is not running.
I have tried to either run it using the parent bus cycle setting or creating a new freewheeling task prio 1 but nothing helps.
I have compared my settings to the settings from the example from the MUX package and i have read (i think) every thread in forge that could be of interest.
EDIT: The ic2detect only shows the mux (70-70) and the servo drive (70-76) so iΒ΄ll look in to if i managed to burn the 280-sensor while soldering).
Another question regarding the 280 sensor. I have a sensor
GY-BM
E/P
280
that should record humidity and temperatur.
Could this be a problem with the library?
Does anyone have an idea of what i might be doing wrong?
I have some experience from Codesys but not much so this could be an easy one.
All suggestions are welcome.
I tried to upload the project archive but it did not work. Should i upload the export or how could i show you my horrible project?
Hi,
sorry I was not there for a long time.
The TCA9548 needs terminating resistors, do you have them in?
That's why I went to QWIIC, the muxboard already has them built in.
If it still does not work, try it first without the muxboard.
PS: Note the channel assignment.
Muxboard 0 = I2C_Master 1,0,0,0,0,0,0,0
Muxboard 1 = I2C_Master 2,0,0,0,0,0,0,0
etc.
Last edit: andrax 2023-10-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there someone who knows how big of a effort it would be to update Stefan's original code to make it work with a more up to date version of codesys or should i downgrade my system?
andrax - are you using a downgraded version of codesys or have you downgraded all the libraries? What Oscat lib are you using? what version?
thanks for your reply!
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Is there a simple example of using an I2C multiplexer (PCA9548A).
I found Stefan's post but I can't find a simple example or documentation.
My goal is to use the multiplexer to manage 6 or 8 analog output modules (MCP4725).
Thanks in advance.
Hi,
I have a project with 3 sensors. I hope this helps you further.
Hi
Thank you very much for your answer. Is there a program to drive the multiplexer.
Hi!
IΒ΄ll try to get this thread going again as iΒ΄m having simliar problems.
Right now i get a red triangle on my connected devices (iΒ΄m testing with a BME280 sensor and a PCA9685 resvo driver).
The TCA9548 have the green symbol beside it.
On the "red" devices i get that the bus is not running.
I have tried to either run it using the parent bus cycle setting or creating a new freewheeling task prio 1 but nothing helps.
I have compared my settings to the settings from the example from the MUX package and i have read (i think) every thread in forge that could be of interest.
EDIT: The ic2detect only shows the mux (70-70) and the servo drive (70-76) so iΒ΄ll look in to if i managed to burn the 280-sensor while soldering).
Another question regarding the 280 sensor. I have a sensor
that should record humidity and temperatur.
Could this be a problem with the library?
Does anyone have an idea of what i might be doing wrong?
I have some experience from Codesys but not much so this could be an easy one.
All suggestions are welcome.
I tried to upload the project archive but it did not work. Should i upload the export or how could i show you my horrible project?
Best,
Martin
Last edit: martinll 2023-10-22
Hi,
sorry I was not there for a long time.
The TCA9548 needs terminating resistors, do you have them in?
That's why I went to QWIIC, the muxboard already has them built in.
If it still does not work, try it first without the muxboard.
PS: Note the channel assignment.
Muxboard 0 = I2C_Master 1,0,0,0,0,0,0,0
Muxboard 1 = I2C_Master 2,0,0,0,0,0,0,0
etc.
Last edit: andrax 2023-10-29
hi!
this is also a delayed answer, sorry for this.
when coding in python i get the TCA9548a working.
Is there someone who knows how big of a effort it would be to update Stefan's original code to make it work with a more up to date version of codesys or should i downgrade my system?
andrax - are you using a downgraded version of codesys or have you downgraded all the libraries? What Oscat lib are you using? what version?
thanks for your reply!
Martin
the TCA9548a does not work in Codesys.
In Pyton this is only queried once and in Codesys cyclically.
Of course you can also insert a terminating resistor in each port, then you should have no problems.
I use this one:
https://botland.de/8-bit-multiplexer/12723-qwiic-mux-breakout-8-kanal-modul-mit-i2c-multiplexer-tca9548a-sparkfun-bob-16784-5904422341428.html
You can simply set the library to the latest version.
You do not need Oscat.
Do you need an example project for the BMP280?
the TCA9548a does not work in Codesys.
In Pyton this is only queried once and in Codesys cyclically.
Of course you can also insert a terminating resistor in each port, then you should have no problems.
I use this one:
https://botland.de/8-bit-multiplexer/12723-qwiic-mux-breakout-8-kanal-modul-mit-i2c-multiplexer-tca9548a-sparkfun-bob-16784-5904422341428.html
You can simply set the library to the latest version.
You do not need Oscat.
Do you need an example project for the BMP280?