They are tolerant only to 2.8 V
For example this one

Wiring Diagram for VL6180 Breakout and 3.3v Pro-Mini
that you can find in the second link of your first post.
Since the promini is the 3.3V version, values are the same for the STM32 board
such a connection possible if not soldered the resistors on the PRO MINI.
And how it on STM32 ?
In general, on STM32 boards there are no resistors mounted on non-reserved IO pins.
I’m doing a direct connection of pins SCL and SDA ? but what about the maximum voltage 2,8 V ?
[acronis – Tue Jun 27, 2017 2:36 pm] –
I’m doing a direct connection of pins SCL and SDA ?
Yes.
![BreakoutAnnotated[1].png](https://sparklogic.ru/wp-content/uploads/2019/11/img_5de2c5d203971.png)
- BreakoutAnnotated[1].png (189.96 KiB) Viewed 1041 times
Perhaps you can drop 3.3v to 2.7 with 2 diodes in series
This library works fine on STM32.
My sensor is a VL53L0XV2 and doesnt seem to work with that lib ![]()
I will try this lib
https://github.com/pololu/vl53l0x-arduino
Edit.
That lib didnt compile, I probably need to add some functions to Wire as the compiler didnt know how to handle a Wire.write being passed a 32 bit int
I did quick hack in the library but it only seems to work for values < 1024
Also I don’t get any value below 45.
And I don’t think the number the lib is outputting is mm
https://github.com/adafruit/Adafruit_VL53L0X
and loaded the only one example: it compiles.
I used a core that has some months, 8 April 2017.
Since there is a thread about VL53L0X I posted there too.
How do You got VL6180 working with Adafruit? I am using stm32f103 “Bluebill” with ST-Link. I know it compiles, but in the setup there is vl.begin(). If I delete this my other code works, if I don’t nothing works (blink test and ssd1306 oled). If I tested with oled, then in setup oled code works until vl.begin() is called, after that oled freezes.
STM32F103, uploaded with ST-Link, Serial monitor over usb – 893 counts(72Mhz), 882 counts(48Mhz)
Arduino Nano, uploaded with usb, Serial monitor over usb – 980 counts
Arduino Mega, uploaded with usb, Serial monitor over usb – 1033 counts
VL6180 sensor is 30mm away from black surface
test code:
#include <Wire.h>
#include "Adafruit_VL6180X.h"
Adafruit_VL6180X vl = Adafruit_VL6180X();
void setup() {
Serial.begin(115200);
// wait for serial port to open on native usb devices
while (!Serial) {
delay(1);
}
Serial.println("Adafruit VL6180x test!");
if (! vl.begin()) {
Serial.println("Failed to find sensor");
while (1);
}
Serial.println("Sensor found!");
}
void loop() {
unsigned long startCounting = millis();
int count = 0;
while (millis() - startCounting <= 10000)
{
if (vl.readRange())
{
count++;
}
}
Serial.println(count);
}
It seems that in function read8() line 246 is missing a Wire.available() check which is there in function read16() line 267.
So it may happen that readRange() returns an invalid value 0 (before any data is received from the sensor), that is why your sketch is not counting.
This could also explain why different platform gives different results, because each of them runs with different speed.
F1 seems can be the quickest, so it misses the most bytes.
[stevestrong – Wed Dec 06, 2017 12:58 pm] –
It may be an issue with the Adafruit lib.
It seems that in function read8() line 246 is missing a Wire.available() check which is there in function read16() line 267.
So it may happen that readRange() returns an invalid value 0 (before any data is received from the sensor), that is why your sketch is not counting.
This could also explain why different platform gives different results, because each of them runs with different speed.
F1 seems can be the quickest, so it misses the most bytes.
I also tested F4. The VL6180 works with STM32GENERIC PB6 and PB7
STM32F407, uploaded with ST-Link, Serial monitor over usb – 898 counts
I bought these stm32 units for quicker sensor reading
. But my main problem will be running vl6180 and ssd1306 oled together and I can’t get them to work together. I will try this tomorrow on F4.
[stevestrong – Thu Dec 07, 2017 9:23 am] –
Have you tried to insert the line as I indicated above?
Yes, and it didn’t make a change


