TSL2521 ALS/Flicker
ALS Result Data Format
Application Note
• PUBLIC
AN001042
• v1-01 • 2022-Jan-27
23
│ 14
Information
Setting als_msb_position to the right format is necessary to get a valid als_digital_saturation bit.
3.2
16-Bit Data Full Count Results in ALS_DATA Registers
In case the ALS results should be read over the
ALS_STATUS
and
ALS_DATA
x registers the 16-bit
full counts can be read out like in legacy devices without using the FIFO
– but without the Residual
counts, no matter if they are measured or not.
In this case the field als_scale in register
MEAS_MODE0
needs to be set to 0 like shown in Figure 11.
Figure 11:
ALS Results Presented in ALS_DATAx Registers as 16-Bit Word of Full Counts, No Residuals
The disadvantage of this method is the loss of the Residual counts and, additionally, it is difficult to
change to any method containing Residuals later since the number space is a different one without the
4 bits on LSB side.
3.3
20-Bit Data Result in ALS_DATA Registers Including 4-Bit
Residuals
It is possible to transfer the 16-bit full counts over the ALS_DATAx register and, additionally, the
Residual counts in case of a lower number of full counts
– this makes sense since the additional
resolution the Residual counts provide are helpful especially in low light conditions.
The field als_scale in register MEAS_MODE0 has to be set to the number of full counts MSB that
needs to be 0 so that the Residual counts are transferred instead on the LSB side, by default 4 since
we have 4 Residual bits. The MSB bits that are 0 are simply left out. To mark such a
result as “scaled”
the ALS_STATUS register contains a bit als_datax_scaled for every modulator that is set in this case
19 18 17 16 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
MSB
20 bit als_msb_position = 12 (default)
Full counts
Residuals
als_scale = 0
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
ALS_DATAx (16 bit):
Full counts
Internal format: