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

Very Noob question re. VL6180 driver [Solved]

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



Joined: 04 Dec 2011
Posts: 4

View user's profile Send private message

Very Noob question re. VL6180 driver [Solved]
PostPosted: Sun Feb 17, 2019 9:32 am     Reply with quote

Sorry if this is dumb question but ...

In the VL6180 drive (VL6180.C) there a bunch of I2C write to undocumented registers -
Code:
  ps_write_reg(0x0207, 0x01);
  ps_write_reg(0x0208, 0x01);
  ps_write_reg(0x0096, 0x00);
  ps_write_reg(0x0097, 0xfd);
  ps_write_reg(0x00e3, 0x00);
  ps_write_reg(0x00e4, 0x04);
  ps_write_reg(0x00e5, 0x02);
  ps_write_reg(0x00e6, 0x01);
  ps_write_reg(0x00e7, 0x03);
  ps_write_reg(0x00f5, 0x02);
  ps_write_reg(0x00d9, 0x05);
  ps_write_reg(0x00db, 0xce);
  ps_write_reg(0x00dc, 0x03);
  ps_write_reg(0x00dd, 0xf8);
  ps_write_reg(0x009f, 0x00);
  ps_write_reg(0x00a3, 0x3c);
  ps_write_reg(0x00b7, 0x00);
  ps_write_reg(0x00bb, 0x3c);
  ps_write_reg(0x00b2, 0x09);
  ps_write_reg(0x00ca, 0x09);
  ps_write_reg(0x0198, 0x01);
  ps_write_reg(0x01b0, 0x17);
  ps_write_reg(0x01ad, 0x00);
  ps_write_reg(0x00ff, 0x05);
  ps_write_reg(0x0100, 0x05);
  ps_write_reg(0x0199, 0x05);
  ps_write_reg(0x01a6, 0x1b);
  ps_write_reg(0x01ac, 0x3e);
  ps_write_reg(0x01a7, 0x1f);
  ps_write_reg(0x0030, 0x00);


as far as I can tell none of the registers are in the datasheet.

The routine, of which the above is part is called "init_proximity_sensor" so I guess it's initialisation, but why to unnamed registers?
temtronic



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

View user's profile Send private message

PostPosted: Sun Feb 17, 2019 9:59 am     Reply with quote

I'd contact the mfr of the VL6180 and get a proper datasheet for the device. I don't have that driver but I'll assume the device is a TOF ? Any 'init' routine would need to store KNOWN data into 'registers' for a device to operate in a known manner.
You might try 'googling' the device and one of the unnamed regstrs, see what comes up.
Contact the writer of the driver, as they know 'something' must be stored 'here' for the device to function...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Feb 17, 2019 10:34 am     Reply with quote

It's in the appnote on page 24:
https://cdn.sparkfun.com/datasheets/Sensors/Proximity/VL6180_ApplicationNote.pdf

If you find something missing in the main datasheet of a device, look for
an appnote. Usually that's where the info will be.
temtronic



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

View user's profile Send private message

PostPosted: Sun Feb 17, 2019 11:06 am     Reply with quote

nice....so THE datasheet makes NO mention of the INIT needed to be done ! arrgh, sure glad PIC's datasheets aren't missing THAT kind of information!!!

Warning ! the device address 0x29 is the SEVEN bit address, so you'll need to 'fudge it' to be PIC I2C 8 bit compatible.

Running PCM P's I2C scanner program would be a great 1st start !
ALSO

it's a 3 volt device, best run at 2.7-2.9 VDD...
atleast THAT spec is in the datasheet !

Jay
towlerg



Joined: 04 Dec 2011
Posts: 4

View user's profile Send private message

PostPosted: Sun Feb 17, 2019 11:08 am     Reply with quote

Thanks Temtronic and PCM programmer, I googled fairly hard but the app note eluded me. Perhaps I've lived a sheltered life, but I've never seen a device before that required an unexplained undocumented init code.

BTW I found the code in the drivers directory, it's part of the install.

Problem solved, it there a way to flag that against the thread?
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