![Osram ams TSL2521 Manual Download Page 17](http://html1.mh-extra.com/html/osram/ams-tsl2521/ams-tsl2521_manual_1656404017.webp)
TSL2521 ALS/Flicker
ALS Result Data Format
Application Note
• PUBLIC
AN001042
• v1-01 • 2022-Jan-27
23
│ 16
Using this kind of ALS result format gives both the dynamic range of the ALS legacy devices and the
advantage of the residual measurement in lower light situations while keeping the 16-bit register width.
Additionally, it is possible to use this both with Residual measurement enabled or disabled, the
number space is consistent in this case. Even changing to 24-bit measurement over the FIFO keeps
the data consistency.
Information
For both methods using
ALS_DATA
x registers it is mandatory to read out
ALS_STATUS
firstly and
the
ALS_DATA
x registers immediately afterwards. It is recommended to do this in one I
2
C block
read including the ALS_STATUS2 register since the latter contains the als_datax_gain_status fields
that are necessary for the lux equation as well. This way it is guaranteed by design that all
ALS_DATA
x results are from the same integration cycle.
3.4
24-Bit ALS Result Data Transferred Via FIFO
Using a higher dynamic range than 20-bit is only possible using the FIFO transfer of ALS results.
Since the FIFO is mainly used for flicker data writing of flicker data takes precedence over the writing
of ALS data. Therefore it is
– again – recommended, to keep ALS measurement and flicker
measurement in different steps of the sequencer. If this is not possible the bit do_als_final_processing
in register
CFG1
has to be set. This delays the writing of ALS data until all flicker data is written, after
that the ALS data is written to the FIFO.
The format of the ALS data is chosen in field mod_als_fifo_data_format in register
CFG2
. 24-bit format
is recommended since it saves one byte per chosen modulator result and gives a high dynamic range,
nevertheless, 32-bit format is possible too, whereas 16-bit format uses the same format options as
explained in the previous chapters about transferring the results via
ALS_DATA
x.
The fields mod_als_fifo_datax_write_enable in registers
MOD_FIFO_DATA_CFG
x define whether the
corresponding ALS modulator result will be pushed to the FIFO or not. The data is pushed in low byte
first order starting at the first sequencer step and the lowest chosen modulator number.
Field mod_fifo_als_status_write_enable in register
MEAS_MODE0
needs to be set in order to get the
3 status registers
ALS_STATUS
,
ALS_STATUS2
, and
ALS_STATUS3
(reserved) pushed to the
FIFO in that order after the selected ALS modulator results of one sequencer step. These status
registers contain analog saturation information as well as gain information and are needed for lux
equation calculations.
3.5
Saturation and Maximum Value of ALS Result
There are three conditions that cause an invalid ALS result, two of them can be noticed by dedicated
flags and/or result codes, one needs to be handled by host software.