code stops

Hello, I seriously think that there is the possibility for some other issues with this setup (memory ....)!?

My setup uses a ToF VL53L1X and an 0.96" OLED (Adafruit_GFX.h, Adafruit_SSD1306.h and VL53L1X.h libraries) a Nano V3.0 host and a 400 kHz I2C bus intended to communicate with the two devices. By them selves they work fine.

I add code stepwise to verify the functionality and I use the serial monitor to basically output the same info as to the OLED.

A version with minimal functionality using both devices works fine and it did also without the mod described below. However very consistently when adding display.* code (OLED writings) it stops executing.

To combat the level issue above I disabled the internal pullup's with; digitalWrite(SDA, LOW), digitalWrite(SCL, LOW); and connected them externally to 3.3V via 10k resistors. With this mod...

  • ...it was possible to run the code (enabled display.* writings) a few times before it stopped executing. Without the mod it never executed! The mod had some effect but didnt solve the whole problem!
  • ...it never displays anything on the OLED. Works fine with the minimum code.
  • ...a variable intended to be displayed on OLED aswell serial gets messed up. No problems when display.* code is disabled.

Any thoughts?

Cheers /ripan

@ripan

TOPIC SPLIT
PLEASE DO NOT HIJACK / NECRO POST !

Could you take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

How long are the wires on the I2C bus between the sensor, display and Arduino board?

Have you tried lower value (stronger) pullups?

Have you tried lower frequency (100Hz) I2C bus?

Post your code. Read the how get the most out of this forum sticky to see how to properly post code. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code in code tags.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.