2024-03-11 11:32 AM
Hi all
I am using 4 sensors on my project. These are comminicated with stm32f4 board via I2C. However there ara 3 I2C channel on stm32f4 board. Is it possible to connect them to same channel via ı2c multiplexer ? As ı researched, the multiplexer is used with the same sensors. The multiplexer i mentionoed is TCA9548A.
2024-03-11 11:46 AM
@yasinbjk50 wrote:stm32f4 board
Which STM32F4 board - an ST board, or your own custom board?
Fundamental to the operation of I2C is the Slave Address - that's what lets you have multiple Slaves on a single I2C bus.
Do your sensors not allow you to select different addresses?
@yasinbjk50 wrote:The multiplexer i mentionoed is TCA9548A.
So this:
https://www.ti.com/product/TCA9548A
Yes, as its datasheet shows, that is designed to allow a single I2C Master to connect to multiple I2C buses:
2024-03-11 11:54 AM
Hi,
yes. see:
https://wolles-elektronikkiste.de/en/tca9548a-i2c-multiplexer
2024-03-11 02:49 PM
What sensor are you interfacing to? Most I2C devices can be hardwired for a different address. Then in FW, you can read/write to each sensor address independently. Knowing what sensor would clarify this.
2024-03-13 03:08 AM
The board ı am using is 32f407vg. However the sensors are different from each other (rtc module, pulse sensor, lux sensor, lcd module). As ı understand, TCA9548A is used for connecting same sensors. Is it appropriate device for my project?
2024-03-13 03:13 AM
DS1307 (RTC module), BH1705(Light Sensor), MAX30100 (Pulse Sensor), LCD Sensor. So these are much more than ı have I2C on STM32f407vg
2024-03-13 03:34 AM - edited 2024-03-13 03:59 AM
@yasinbjk50 wrote:The board ı am using is 32f407vg.
That's not a board - that's just a chip.
Is that STM32F407VG chip mounted on an ST board, or a 3rd-party board, or your own custom board?
@yasinbjk50 wrote:However the sensors are different from each other (rtc module, pulse sensor, lux sensor, lcd module)
Then they should all have different I2C Slave Addresses - yes?
@yasinbjk50 wrote:As ı understand, TCA9548A is used for connecting same sensors
Generally, yes - or, at least, devices which all have the same I2C Slave Address.
@yasinbjk50 wrote:Is it appropriate device for my project?
Probably not: all your sensors should have different I2C Slave Addresses - so you shouldn't need a multiplexer for that.
Unless you have some other specific reason for it?
@yasinbjk50 wrote:DS1307 (RTC module), BH1705(Light Sensor), MAX30100 (Pulse Sensor), LCD Sensor. So these are much more than ı have I2C on STM32f407vg
The datasheets for all these devices will tell you what I2C Slave Address(es) each one has.
(often devices have a choice of 2 or more addresses to minimise the risk of "collisions")
What is an "LCD Sensor"?
LCDs are usually output devices - so not "sensors" ...
:thinking_face:
@yasinbjk50 wrote:So these are much more than ı have I2C on STM32f407vg
Pardon?
The whole point of a bus is that it can be shared by multiple devices - I2C is a bus.
You can connect multiple devices to an I2C bus - it is the Slave Address which distinguishes them.
Example from Wikipedia:
Perhaps you need to read-up on the I2C bus:
https://en.wikipedia.org/wiki/I%C2%B2C
UM10204 2C-bus specification and user manual - this is the definitive specification of the I2C bus:
https://www.nxp.com/docs/en/user-guide/UM10204.pdf
There are many 3rd-party tutorials; eg,
2024-03-13 03:36 AM
And they all have same address ?????
Come on, this is I2C bus , can have > 100 chips on one bus . Just each has to have its own address.
2024-03-13 07:00 AM
The sensors have different addresses. I will read you shared. İt is good to know that I2C can have > 100 chips on one.
2024-03-13 07:01 AM
I will notice that thx.