![Osram ams TSL2521 Manual Download Page 14](http://html1.mh-extra.com/html/osram/ams-tsl2521/ams-tsl2521_manual_1656404014.webp)
TSL2521 ALS/Flicker
ALS Result Data Format
Application Note
• PUBLIC
AN001042
• v1-01 • 2022-Jan-27
23
│ 13
3
ALS Result Data Format
3.1
Internal Data Format
Internally the ALS result is stored in a 32-bit word. The 4 LSB bits are always reserved for residual
counts, no matter if they are measured or not
– if not, they are set to 0. If there are less Residuals bits
chosen or measured than 4 there are still 4 bits reserved in the ALS result format - the ones on the
LSB side that are not measured are set to 0.
Since sample_time and als_nr_samples are both 11-bit wide fields the maximum bit width of the full
counts is 22-bit, adding 4 bits for Residual counts on LSB side equals a maximum ALS result bit width
of 26-bit. The real dynamic range depends mainly on the actual settings of sample_time and
als_nr_samples and in most applications it is not that high. The field als_msb_position in register
MEAS_MODE1
moves the MSB inside the 32-bit result register starting from bit 31 to the selected bit.
As shown in Figure 10 the maximum result width of 26-bit including 4-bit Residual counts requires
als_msb_position to be set to 6. In most applications the second shown format of 24-bit is a good
setting since it requires only 3 Bytes on the FIFO per channel and still offers a very large dynamic
range.
Figure 10:
Internal ALS Result Format Depending on als_msb_position
The third shown format in Figure 10 with als_msb_position at 12 is the default setting, it results in a
20-bit result containing 4-bit Residual width and 16-bit width for full counts. Apart from the Residual
counts this is the same bit width for ALS results as on legacy devices like TCS3707 and with a later
described trick it can be transferred over the
ALS_DATA
x registers in case a FIFO transfer is not
wanted.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
MSB
26 bit als_msb_position = 6
Full counts
Residuals
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
MSB
24 bit als_msb_position = 8
Full counts
Residuals
31 30 29 28 27 26 25 24 23 22 21 20 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