setting up i2c master with an ltc 4151

Post and discuss new components that you have created.
Post Reply
davidkilshaw2
Posts: 7
http://meble-kuchenne.info.pl
Joined: Fri Oct 01, 2021 4:35 pm
Has thanked: 1 time

setting up i2c master with an ltc 4151

Post by davidkilshaw2 »

Im trying to use an ltc 4151 current and voltage monitor with the i2c master macro in flowcode.

To say the least im struggleing a bit here.

IS there an example of how this has been done previous?

The device is set to I2C Address DE and there are a number of registers that can be accessed.

I cannot see if the device is even talking to the 4151 never mind the registers of the device.

Ive looked through the wiki and find the examples a little lacking.

If anyone has one this and could sent a link to a file that work i would be grateful

Regards

User avatar
p.erasmus
Valued Contributor
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: setting up i2c master with an ltc 4151

Post by p.erasmus »

davidkilshaw2 wrote:
Tue Oct 12, 2021 10:58 am
Im trying to use an ltc 4151 current and voltage monitor with the i2c master macro in flowcode.

I cannot see if the device is even talking to the 4151 never mind the registers of the device.
There are 3 ways to work with I2C or for that matter with serial communications
(1) Use Logic Analyser to see what you are writing and reading from the bus
(2) an Oscilliscope with decoder protocols
(3) use a Arduino UNO or any Matrix Scada device with Comms simulation you can see the traces and register values in FC debugger windows

Out of experience I would advise you to follow the LTC I2C protocol exactly otherwise the Device will not ACK the write /read operations and you will not get any responses

P3.jpg
P3.jpg (87.8 KiB) Viewed 2370 times
can you post your FC chart that the guys can try to help but as said you need some tool to see what you are doing


Hope this help you in some way :D
Regards Peter - QME Electronics

davidkilshaw2
Posts: 7
Joined: Fri Oct 01, 2021 4:35 pm
Has thanked: 1 time

Re: setting up i2c master with an ltc 4151

Post by davidkilshaw2 »

the issue was the I2C was set to channel 1 not software. When changed all was sorted. BTW what is the difference between software and digital 1

User avatar
p.erasmus
Valued Contributor
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: setting up i2c master with an ltc 4151

Post by p.erasmus »

Hi,

The software parameter use a software generated clock and I2C communications it normally use a lot of processor power the Channel1 /2 ect use the I2C Hardware module and is in general the better option to use .

I am surprised the the HW option does not work and the Software does . Can you post your flowchart with the settings you use when using Channel 1
and also what micro are you using becuase if you would use the Normal byte transactions on a ARM or ESP then it will not work you have to use trancation calls in stead.

So what I am saying is that if you use byte transaction on a ARM /ESP32 it will only work when you select Software option if you select ChannelX then you have to use the Trancation macros for I2C read and writes .
Regards Peter - QME Electronics

Post Reply