TSL2521 ALS/Flicker
ALS Result Data Format
Application Note
• PUBLIC
AN001042
• v1-01 • 2022-Jan-27
23
│ 15
as shown in Figure 12. The host takes the 16-bit number, checks the als_datax_scaled register and
–
because it is 1 - just adds 4 bits 0 on MSB side to get a 20-bit number.
Figure 12:
Scaled Data Transfer of ALS Data Including Residual Counts
The other case is shown in Figure 13: Not all 4 MSB bits of the 20-bit results are 0
– in this case only
the 16-bit full counts are transferred to the 16-bit ALS_DATAx register and als_datax_scaled is
cleared. The host reads out both the ALS_STATUS register and the ALS_DATAx registers. Bit
als_datax_scaled is checked by the host and since it is 0 the 16-bit full counts result in the
ALS_DATAx is shifted by 4 bits to the left or simply multiplied by 16 on host side to keep the data
consistent over the whole range and to stay in the same 20-bit number space as in the first case.
Figure 13:
Unscaled Data Transfer of ALS Data without Residual Counts
0
0
0
0
x
x
x
x
x
x
x
x
x
x
x
x
y
y
y
y
MSB
20 bit als_msb_position = 12 (default)
Full counts
Residuals
als_scale = 4
15 14 13 12 11 10 9
8
7
6
5
4
ALS_DATAx (16 bit):
Full counts
Internal format:
3
2
1
0
Residuals
als_datax_scaled:
1
0
0
0
0
x
x
x
x
x
x
x
x
x
x
x
x
y
y
y
y
Full counts
Residuals
Host interpretation (20 bit):
0
1
0
1
x
x
x
x
x
x
x
x
x
x
x
x
y
y
y
y
MSB
20 bit als_msb_position = 12 (default)
Full counts
Residuals
als_scale = 4
11 10 9
8
7
6
5
4
3
2
1
0
ALS_DATAx (16 bit):
Full counts
Internal format:
als_datax_scaled:
0
0
1
0
1
x
x
x
x
x
x
x
x
x
x
x
x
0
0
0
0
Full counts
added
Host interpretation (20 bit):
15 14 13 12