Hello
I want to connect two equal sensors with I2C_MASTER communication in the same PIC to be read by the same Display; I found the PIC18F26J11. . . I see that this PIC has 2 communication ports I2C_MASTER (CHANEL1 AND SOFTWARE).
Can someone please guide me if it is possible to connect those 2 sensors before buying.
Thanks
Enrique
CONNECT 2 SENSOR I2C_MASTER AT THE SAME PIC
Moderator: Benj
-
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: CONNECT 2 SENSOR I2C_MASTER AT THE SAME PIC
Hello,
Let me see if I'm reading this correctly.
You would have a single PIC device with a connected display operating as the Master to two sensor devices. Yes this should work fine if either both sensors have different I2C addresses or they are on seperate I2C channel pins.
Another thought I had was if there were two masters operating on the same sensor. This might get more tricky to get right.
Let me see if I'm reading this correctly.
You would have a single PIC device with a connected display operating as the Master to two sensor devices. Yes this should work fine if either both sensors have different I2C addresses or they are on seperate I2C channel pins.
Another thought I had was if there were two masters operating on the same sensor. This might get more tricky to get right.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
Re: CONNECT 2 SENSOR I2C_MASTER AT THE SAME PIC
Hello Benj,
Ok, so they are 2 identical sensors with the same address connected to a PIC; I found a PIC16F1847 has two I2C_master ports (CHANNEL 1 B1 B4 and CHANNEL 2 B2 B5) and the LCDI2C display connected to I2C SOFTWARE A1 A2.
Theoretically possible to do this?
Thank You Benj
Ok, so they are 2 identical sensors with the same address connected to a PIC; I found a PIC16F1847 has two I2C_master ports (CHANNEL 1 B1 B4 and CHANNEL 2 B2 B5) and the LCDI2C display connected to I2C SOFTWARE A1 A2.
Theoretically possible to do this?
Thank You Benj
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
Re: CONNECT 2 SENSOR I2C_MASTER AT THE SAME PIC
Hi electron
You are on the right way.
To choose a pic, there is an online tool. There you can select:
8Bit Pic and 3pcs i2c and you will not found even one. If you reduce to 2pcs i2C you will found a lot.
or if you select:
16Bit and 3pcs i2c, you will found a lot
There is a thing about the tool. It shows you just new/popular pic. If you like to see all (your favorit PIC16F1847) you have to click ShowALLProducts
regards
Stefan
https://www.microchip.com/ParamChartSea ... nchID=1005
You are on the right way.
To choose a pic, there is an online tool. There you can select:
8Bit Pic and 3pcs i2c and you will not found even one. If you reduce to 2pcs i2C you will found a lot.
or if you select:
16Bit and 3pcs i2c, you will found a lot
There is a thing about the tool. It shows you just new/popular pic. If you like to see all (your favorit PIC16F1847) you have to click ShowALLProducts
regards
Stefan
https://www.microchip.com/ParamChartSea ... nchID=1005
-
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: CONNECT 2 SENSOR I2C_MASTER AT THE SAME PIC
As long as each sensor has it's own I2C pins then it should work fine.
You can always use software I2C if you don't want to move to a device with two I2C peripherals. The software mode is fairly robust and works well though probably not quite as fast as the dedicated hardware.
You can always use software I2C if you don't want to move to a device with two I2C peripherals. The software mode is fairly robust and works well though probably not quite as fast as the dedicated hardware.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 323
- Joined: Sat Jan 12, 2008 2:08 am
- Has thanked: 106 times
- Been thanked: 48 times