Page 2 of 2
Re: I2C can not read more than 20 data in one time
Posted: Mon Feb 07, 2022 12:42 pm
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.
Re: I2C can not read more than 20 data in one time
Posted: Mon Feb 07, 2022 1:09 pm
by Xbiotec
thx a lot to all who help on this topic
Re: I2C can not read more than 20 data in one time
Posted: Mon Feb 07, 2022 4:11 pm
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
Re: I2C can not read more than 20 data in one time
Posted: Mon Feb 07, 2022 6:09 pm
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
Re: I2C can not read more than 20 data in one time
Posted: Tue Feb 08, 2022 7:33 am
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
Re: I2C can not read more than 20 data in one time
Posted: Tue Feb 08, 2022 8:24 am
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
Re: I2C can not read more than 20 data in one time
Posted: Wed Feb 09, 2022 7:25 am
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 (33.14 KiB) Viewed 5550 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
Re: I2C can not read more than 20 data in one time
Posted: Wed Feb 09, 2022 7:39 am
by mnfisher
That's good..
If the device allows then it will work...
Martin