Skip to main content
BCoch
Senior
August 29, 2019
Solved

What's the address of the SYSALS__INTEGRATION_PERIOD register?

  • August 29, 2019
  • 1 reply
  • 772 views

Rev 7 of the VL6180X datasheet shows the SYSALS__INTEGRATION_PERIOD register at 0x040, however Version 2 of AN4545 changed the address of what presumably is the same register from 0x040 to 0x041. Which is it?

Thanks.

This topic has been closed for replies.
Best answer by John E KVAM

The SYSALS__INTEGRATION_PERIOD register is at 0x040 and it is a 16-bit address. (so 0x40 and 0x41).

The ST API uses:

status = VL6180x_WrWord(dev, SYSALS_INTEGRATION_PERIOD, SetIntegrationPeriod);

Where

#define SYSALS_INTEGRATION_PERIOD 0x040

In the app note they are only writing the value 0x63 - so they cheated and wrote 1 byte into the LSByte of the word.

Although this is a bit confusing and syntactly tacky, it is correct - sort of. Not a very good example.

Sorry about that.

1 reply

John E KVAM
John E KVAMBest answer
ST Employee
August 29, 2019

The SYSALS__INTEGRATION_PERIOD register is at 0x040 and it is a 16-bit address. (so 0x40 and 0x41).

The ST API uses:

status = VL6180x_WrWord(dev, SYSALS_INTEGRATION_PERIOD, SetIntegrationPeriod);

Where

#define SYSALS_INTEGRATION_PERIOD 0x040

In the app note they are only writing the value 0x63 - so they cheated and wrote 1 byte into the LSByte of the word.

Although this is a bit confusing and syntactly tacky, it is correct - sort of. Not a very good example.

Sorry about that.

BCoch
BCochAuthor
Senior
August 29, 2019

That makes sense. Thanks, John.