CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

VL53L0X

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
beaker404



Joined: 24 Jul 2012
Posts: 163

View user's profile Send private message

VL53L0X
PostPosted: Wed Jul 25, 2018 8:58 am     Reply with quote

Looking at using the VL53L0X for a range project. Looks promising but seems complex to get simple range data out of. I have seen code posted, and a thread that talked about getting it up and running on a 18F chip. Anyone done more work with getting the VL53L0X to work with CCS and a PIC?

18F platform
MPLAB V 8.91.00.00
CCS PCM C Compiler, Version 5.064, xxxxx
Windows 10
Ttelmah



Joined: 11 Mar 2010
Posts: 19549

View user's profile Send private message

PostPosted: Wed Jul 25, 2018 11:40 am     Reply with quote

Go here:

<https://github.com/LILCMU/vl53l0x-ccs>
beaker404



Joined: 24 Jul 2012
Posts: 163

View user's profile Send private message

PostPosted: Thu Jul 26, 2018 1:36 pm     Reply with quote

yes, I saw that link and looked it over, was hoping where was a simpler way to do an evaluation on the sensor, par for the course, code like this I run across nowhere near builds for me. this is no exception.
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jul 26, 2018 1:49 pm     Reply with quote

While I haven't downloaded the datasheet for the sensor, it does appear to be rather complex compared to say an RTC device like the DS1307. However, the link supplies code that apparently works, so 99% of the work is already done for you !
As for 'evaluating' the device, you'll have to decide how to proceed as 'we' have no idea what your requirements are. I might only need functions 2,4,5 whereas you need functions 1, 5 and 22-25, so my evaluation would be meaningless to you.
Time to put a pot of coffee on, build some hardware, cut code, compile and test !
Jay
beaker404



Joined: 24 Jul 2012
Posts: 163

View user's profile Send private message

PostPosted: Thu Jul 26, 2018 2:09 pm     Reply with quote

Agreed, I have not outlined a plan that allows anyone to help, I am trying to figure out how much of the example has to be in play to make a minimal measurement.
I am getting an error for the i2c_start() call saying a comma is needed.
Ttelmah



Joined: 11 Mar 2010
Posts: 19549

View user's profile Send private message

PostPosted: Thu Jul 26, 2018 2:11 pm     Reply with quote

It is not a simple sensor. No just read a number and you have range. You have to do the calibration, and use the values from this to calculate the readings. That port is about as simple as it is likely to get, though it could be inproved by switching slightly more to CCS functions.
elcrcp



Joined: 11 Mar 2016
Posts: 62
Location: izmir / Turkey

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 1:04 pm     Reply with quote

I've used that sensor and the library and it works. That sensor indeed requires a lot of initialization lines and takes big amount of program memory, also needs some alterations on library with 16F series but works fine with 18F series.
Also take note of the summary section of library
Quote:
The library targets the PIC16F886 but it should work with any other PICs with more than 4K flash memory, including PIC18s and PIC24s.

_________________
There is nothing you can't do if you try
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group