I2C can not read more than 20 data in one time

Any bugs you encounter with Flowcode should be discussed here.
BenR
Matrix Staff
Posts: 1952
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: I2C can not read more than 20 data in one time

Post by BenR »

Hello,

I have hopefully now found and fixed the problem and increased the cap from 20 to 32768 which should hopefully be plenty.

Also applied to SPI and UART based components.

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: I2C can not read more than 20 data in one time

Post by Xbiotec »

thx a lot to all who help on this topic
Seb

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: I2C can not read more than 20 data in one time

Post by Xbiotec »

hi,
Is it possible to write 2 values to 2 different address with only one transaction write ?
for example: write 0x2F to 0xF4 address then Write 0x24 to 0xF5 address
thx for your prompt reply
Seb

mnfisher
Valued Contributor
Posts: 1628
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: I2C can not read more than 20 data in one time

Post by mnfisher »

Glad the i2c read now working..

I don't think you can do two writes in this way - i2c needs a start and stop event - and then the second device could be written too - again needs a start event etc..

Probably need to Initialize the first transaction - write to 1st device then a second transaction initialize (which just sets the device address) before writing to the second.

Martin

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: I2C can not read more than 20 data in one time

Post by Xbiotec »

Is it possible to write 2 values to 2 different address with only one transaction write ?
for example: write 0x2F to 0xF4 address then Write 0x24 to 0xF5 address
I'm talking for same device but at 2 different register address
Seb

mnfisher
Valued Contributor
Posts: 1628
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: I2C can not read more than 20 data in one time

Post by mnfisher »

Depends on the device in that case - but again I'd doubt it - unless the addresses are consecutive.
Many devices allow multiple writes in a single operation - send an array of data and it will be written to consecutive addresses. However, if you want to write to two distinct separate addresses then the device will expect another start address sequence. The new address would be treated as data if included in a single block. See the datasheet for the device you are using.

No need to call transaction initialize again though.

Martin

Xbiotec
Posts: 217
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: I2C can not read more than 20 data in one time

Post by Xbiotec »

hi,
It tried I²C multiple byte write (not auto-incremented) and it work well.
Capture d’écran 2022-02-09 082417.jpg
Capture d’écran 2022-02-09 082417.jpg (33.14 KiB) Viewed 5546 times
address 1 to write is the 1st byte of AddressToRW and data is the 2nd byte
address 2 to write is the 3rd byte of AddressToRW and data is the 4th byte

auto-increment is not working with my device
Seb

mnfisher
Valued Contributor
Posts: 1628
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: I2C can not read more than 20 data in one time

Post by mnfisher »

That's good..

If the device allows then it will work...

Martin

Post Reply