1

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 image

NodeJS readout

image

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.

asked May 1, 2019 at 3:51
10
  • I know Rpi python, Arduino C++, I2C. and I have a 4 channel scope. I don't know node.js and I don't know logic analyzer. I just installed node Red and wish to get some example code to start learning. If you can list the C++ and node.js code, I will try to study the code and translate it to Rpi python. Question - you said you tried several I2C buses. Are they demux or software bit bang? I tried both and found problems with both. :( Commented May 1, 2019 at 4:08
  • So you successfully set up Rpi I2C buses 3, and 4? I just tried it yesterday and found it did not work. So I gave up. See featured questions number 3. BTW no hurry at all to show me any node.js code, I am more interested to set up Rpi I2C buses 3 and 4. Commented May 1, 2019 at 4:20
  • I'll have to think about giving my code away due to the lack of hardware on your side. I'm trying to communicate with old music studio gear that has no support so unless you have the same 90's studio gear that I have, I don't know how my code could be to any use for you. Commented May 1, 2019 at 4:36
  • About multiple i2c buses, they are software i2c set up on the rpi, here's a pastebin of the i2c part of my /boot/config.txt file: pastebin.com/ArD4901v Commented May 1, 2019 at 4:38
  • The buses range from 3 to 10, so 8 new buses Commented May 1, 2019 at 4:39

1 Answer 1

2

Problem solved by bridging GND and 3v on the RPi with a 1uF capacitor.

While using a logic analyzer I saw random very short spikes which caused bit flips.

I posted another question asking what the cause of the spikes might be and eventually came across an Arduino thread that suggested to bridge GND and 3v.

This fixed all problems.

answered May 2, 2019 at 17:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.