The OPT4001 device features a register COUNTER as part of the output registers which increments
for every successful measurement. This register can be read as part of the output
registers which helps the application to keep track of measurements. The 4 bit
counter starts at 0 on power-up and counts up to 15 after which the counter resets
back to 0 and continues to count up, which is particularly helpful in situations
like the following:
- Host or the controller needs
consecutive measurements. Utilizing the COUNTER register allows the controller to compare
samples and makes sure that the samples are in expected order without missing
intermediate counter values.
- As a safety feature where when
light level are not changing, the controller can make sure that the measurements
from OPT4001 are not stuck by comparing values of
register COUNTER between measurements. If the COUNTER values continue to change over samples, the
device is updating the output register with the most recent measurement of light
levels.