cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing two VL53L0x ToF sensors with an ATmega328p in AVR C

ev.1
Associate

Hello,

I've got a question.

I'm trying to interface two VL53L0x ToF sensors with an ATmega328p board. This worked fine in the arduino IDE with the beautiful Adafruit library. Unfortunately this library does not work in AVR C so I'm trying to create the whole start up sequence and everything on my own.

This has proven to be very difficult however. I have found the API and some other libraries but I can't get them to work.

Does anyone have experience with AVR C and I2C?

2 REPLIES 2
John E KVAM
ST Employee

This sensor and your processor have been around a while. Give GitHub a try. And if you don't find the VL53L0X you can subsitute the i2C interface for any of the VL53L sensors.

I'm sure someone has done it - and proudly posted their work.

Of course if you find something that helps, you are kind of honor bound to return the favor if you can.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

Hi John,

Thank you for your reply.

I have looked around on the internet for inspiration and I have found three or four different libraries. But I have not been able to get them to work with the ATmega328p. I suspect that I have to set the correct registers and things like that but I've not been able to find the necessary information to do so.

So that's why I decided to make a post to this forum. Maybe I have overlooked some GitHub repository or a previous forum post but I can't find the information necessary to complete my project.

If you're interested in the libraries I've found here are some links:

https://github.com/lamik/VL53L0X_API_STM32_HAL/tree/master/Drivers/VL53L0X

https://github.com/pololu/vl53l0x-arduino

https://github.com/bitbank2/VL53L0X

https://github.com/yetifrisstlama/vl53l0x-non-arduino

Here's the datasheet for the VL53L0X, it might make looking up information a bit more convenient for you.

https://www.st.com/resource/en/datasheet/vl53l0x.pdf