NOTE: Please read the bottom. There's a plot twist.
I'm reading three bytes and my NodeJS code reads 3, 192, 144
in decimal while my logic analyzer reads 0x03, 0xC0, 0x10
which translates to 3, 192, 16
.
Why is the last byte misread as 144
when it should in fact be read as 16
?
Additional info: This is on a RPi2B on device i2c@10 software i2c device, no pullups, straight from RPi to i2c device.
Here's a comparison between the NodeJS code readout and what i2catalyst shows based on the pulseview annotation export:
As you can see at some points the reads are REALLY OFF especially at address 69... What?!?! 🤔
Logic analyser
NodeJS readout
I've tried several i2c buses and they all result in incorrect reads.
I have also tried a level shifter that uses the slave system ground and 5v as reference. Still some incorrect readouts.
I have followed the schematics of the original devices and how they're connected to the i2c perfectly to the wire and still incorrect readouts.
Plot twist: Connecting an Arduino Mega 2560 directly to the i2c bus with internal pullups turned ON works perfectly fine. No level shifter, no external pullups, nothing. Just internal pullups and directly to the 5v i2c. Works great.
/boot/config.txt
file: pastebin.com/ArD4901v – vaid May 1 '19 at 4:38