2019-08-29 09:58 AM
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.
Solved! Go to Solution.
2019-08-29 10:12 AM
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.
2019-08-29 10:12 AM
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.
2019-08-29 10:15 AM
That makes sense. Thanks, John.