2025-02-18 02:04 AM - last edited on 2025-02-18 03:15 AM by Peter BENSCH
Hi,
I'm trying to get the VL6180 Time-of-Flight (ToF) proximity sensor working with the SAM E54 Xplained Pro evaluation kit.
Hardware Setup:
Board: SAM E54 Xplained Pro
Sensor: ST VL6180 ToF Module
IDE: MPLAB X v6.10 (Linux x64)
Connection: I2C + GPIO
Current Status:
SERCOM3 is connected to SDA on PA2 and SDL on PA23
The external interrupt (GPIO 1) is connected on PB08
GPIO 0 is connected on PB09
Using the VL6180X API (v2.3.1)
Goal:
Get the VL6180 working via I2C
Operate the sensor in interrupt mode to read sensor data
I attempted to use the VL6180X API (v2.3.1), but it needs to be ported to the SAM E54. I'm struggling to understand:
Which parts of the API need modification for the SAM E54?
How to correctly implement I2C communication with the VL6180 using the API?
How to configure and handle interrupt-based operation on the SAM E54?
Are there any example projects or resources that could help with this setup?
Any help or guidance would be greatly appreciated! Thanks in advance.
2025-02-19 03:42 PM
Be a little careful here please. The VL6180 is going out of production. Last orders are in March. Not an issue if this is a college project, but please switch to the VL53L4CD if you plan on going into production.
Once you have applied power, and the XShut pin has been lifted, you should be able to communicate.
Being able to read the chip Id is your first goal.
As delivered our code just works - assuming of course you have a C compliler.
But there is an issue - we do not know how your I2C is programmed.
Therefor there is a program.c file that is basically empty.
It's your job to place the I2C read byte and write byte calls your MCU uses into this file.
Go to github and have a look around. Find a project that writes bytes and words to any sensor using this MCU.
Then 'borrow' that code an insert it into the RdByte functions that are in Platform.c
The functions you are going to need to fill out for your MCU are: