cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L3CX with Atmega328pb Xplained Mini

castor
Associate

Hi,

I am using the VL53L3CX distance sensor for a project and I am wondering if it's possible to create my own library functions. The MCU I am using is the ATmega328PB XPlained Mini from Microchip, which only has 32KB of flash memory. The API library that I downloaded is way bigger than that, so I am wondering if I can just limit the API file to just a few functions:

  1. Data_Init
  2. StartMeasurement
  3. GetMeasurementDataReady
  4. GetMultiRangingData
  5. ClearInterruptAndStartMeasurement

I am able to create my own functions to do I2C read and write (I was able to get 0xEA and 0xAA to reference register 0x010F and 0x0110 respectively). My question is how can I setup the functions to get the I2C working? Would I have to go through all the registers (and if so, what are the registers), or would it be better to use a specific setup? Are there a specific file, headers, library that I would have to use that is less than 32KB?

I am also wondering if the VL53L0X is using the same registers as the VL53L3CX, I did a search on if anyone created a library suited for low memory MCU and this one looked promising: https://github.com/michael-betz/vl53l0x-non-arduino/tree/master

Could I use this for the VL53L3CX?

Forgive me for asking this question, but I am pretty new to this and it's my first time working with I2C and MCU. Thank you for taking the time to answer.

1 REPLY 1
Zhiyuan.Han
ST Employee

Hi Castor,

To get better accuracy and longer ranging ability, L3CX is using a new ranging data processing method, that's why the Flash size is much more than L0CX. actually, I don't have good idea to reduce the Flash size. as the ranging data needs post process functions, which inside API drivers, not the simple register read, write. 

And one more information is L0CX register is different with L3CX. 

 

Br

Zhiyuan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.