Issue reading from PECMAC6

Hi,

I’m attempting to read from Channels 1-6 on a 6 Channel PECMAC6 Device (PECMAC6XXA) using the following I2C command on a Pycom Lopy device.

i2c.writeto(0x2A, [146, 106, 1, 1, 6, 0, 0, 4])

and then reading from

i2c.readfrom(0x2A, 19) # Where 19 is the number of bytes requested.

However, I keep running into an OS Error when running this command? It works perfectly fine when I read from sensors 1-5 or 6-7 but it seems to have an issue when I try to read from more than 5 sensors in one read.

Has anyone come across this issue?

Thanks,

Alex

Hi Alex,
this seems like an i2c buffer size related issue. for example the i2c buffer size in raspberry pi is 32 bytes. so using pi you can read max 32 bytes at a time.
i am suspecting the i2c buffer size in pycom is 18 bytes.
the best way to read all 6 sensor is read 1-5 and then channel 6-6.

Thanks

Good thinking!

I’ll have a look into that and verify but it sounds like you are correct.

Thanks!

This appeared to be the issue!

Thanks!