TSL2562, TSL2563
LOW-VOLTAGE
LIGHT-TO-DIGITAL CONVERTER
TAOS066N − AUGUST 2010
19
The LUMENOLOGY r Company
r
r
Copyright E 2010, TAOS Inc.
www.taosinc.com
APPLICATION INFORMATION: SOFTWARE
Basic Operation
After applying V
DD
, the device will initially be in the power-down state. To operate the device, issue a command
to access the CONTROL register followed by the data value 03h to power up the device. At this point, both ADC
channels will begin a conversion at the default integration time of 400 ms. After 400 ms, the conversion results
will be available in the DATA0 and DATA1 registers. Use the following pseudo code to read the data registers:
// Read ADC Channels Using Read Word Protocol − RECOMMENDED
Address = 0x39 //Slave addr – also 0x29 or 0x49
//Address the Ch0 lower data register and configure for Read Word
Command = 0xAC //Set Command bit and Word bit
//Reads two bytes from sequential registers 0x0C and 0x0D
//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel0 = 256 * DataHigh + DataLow
//Address the Ch1 lower data register and configure for Read Word
Command = 0xAE //Set bit fields 7 and 5
//Reads two bytes from sequential registers 0x0E and 0x0F
//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel1 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte
// Read ADC Channels Using Read Byte Protocol
Address = 0x39 //Slave addr − also 0x29 or 0x49
Command = 0x8C //Address the Ch0 lower data register
ReadByte (Address, Command, DataLow) //Result returned in DataLow
Command = 0x8D //Address the Ch0 upper data register
ReadByte (Address, Command, DataHigh) //Result returned in DataHigh
Channel0 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte
Command = 0x8E //Address the Ch1 lower data register
ReadByte (Address, Command, DataLow) //Result returned in DataLow
Command = 0x8F //Address the Ch1 upper data register
ReadByte (Address, Command, DataHigh) //Result returned in DataHigh
Channel1 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte
TSL2562, TSL2563
LOW-VOLTAGE
LIGHT-TO-DIGITAL CONVERTER
TAOS066N − AUGUST 2010
20
r
r
Copyright E 2010, TAOS Inc.
The LUMENOLOGY r Company
www.taosinc.com
APPLICATION INFORMATION: SOFTWARE
Configuring the Timing Register
The command, timing, and control registers are initialized to default values on power up. Setting these registers
to the desired values would be part of a normal initialization or setup procedure. In addition, to maximize the
performance of the device under various conditions, the integration time and gain may be changed often during
operation. The following pseudo code illustrates a procedure for setting up the timing register for various
options:
// Set up Timing Register
//Low Gain (1x), integration time of 402ms (default value)
Address = 0x39
Command = 0x81
Data = 0x02
WriteByte(Address, Command, Data)
//Low Gain (1x), integration time of 101ms
Data = 0x01
WriteByte(Address, Command, Data)
//Low Gain (1x), integration time of 13.7ms
Data = 0x00
WriteByte(Address, Command, Data)
//High Gain (16x), integration time of 101ms
Data = 0x11
WriteByte(Address, Command, Data)
//Read data registers (see Basic Operation example)
//Perform Manual Integration
//Set up for manual integration with Gain of 1x
Data = 0x03
//Set manual integration mode – device stops converting
WriteByte(Address, Command, Data)
//Begin integration period
Data = 0x0B
WriteByte(Address, Command, Data)
//Integrate for 50ms
Sleep (50) //Wait for 50ms
//Stop integrating
Data = 0x03
WriteByte(Address, Command, Data)
//Read data registers (see Basic Operation example)
TSL2562, TSL2563
LOW-VOLTAGE
LIGHT-TO-DIGITAL CONVERTER
TAOS066N − AUGUST 2010
21
The LUMENOLOGY r Company
r
r
Copyright E 2010, TAOS Inc.
www.taosinc.com
APPLICATION INFORMATION: SOFTWARE
Interrupts
The interrupt feature of the TSL256x device simplifies and improves system efficiency by eliminating the need
to poll the sensor for a light intensity value. Interrupt styles are determined by the INTR field in the Interrupt
Register. The interrupt feature may be disabled by writing a field value of 00h to the Interrupt Control Register
so that polling can be performed.
The versatility of the interrupt feature provides many options for interrupt configuration and usage. The primary
purpose of the interrupt function is to provide a meaningful change in light intensity. However, it also be used
as an end-of-conversion signal. The concept of a meaningful change can be defined by the user both in terms
of light intensity and time, or persistence, of that change in intensity. The TSL256x device implements two
16-bit-wide interrupt threshold registers that allow the user to define a threshold above and below the current
light level. An interrupt will then be generated when the value of a conversion exceeds either of these limits. For
simplicity of programming, the threshold comparison is accomplished only with Channel 0. This simplifies
calculation of thresholds that are based, for example, on a percent of the current light level. It is adequate to
use only one channel when calculating light intensity differences since, for a given light source, the channel 0
and channel 1 values are linearly proportional to each other and thus both values scale linearly with light
intensity.
To further control when an interrupt occurs, the TSL256x device provides an interrupt persistence feature. This
feature allows the user to specify a number of conversion cycles for which a light intensity exceeding either
interrupt threshold must persist before actually generating an interrupt. This can be used to prevent transient
changes in light intensity from generating an unwanted interrupt. With a value of 1, an interrupt occurs
immediately whenever either threshold is exceeded. With values of N, where N can range from 2 to 15, N
consecutive conversions must result in values outside the interrupt window for an interrupt to be generated. For
example, if N is equal to 10 and the integration time is 402 ms, then an interrupt will not be generated unless
the light level persists for more than 4 seconds outside the threshold.
Two different interrupt styles are available: Level and SMBus Alert. The difference between these two interrupt
styles is how they are cleared. Both result in the interrupt line going active low and remaining low until the
interrupt is cleared. A level style interrupt is cleared by setting the CLEAR bit (bit 6) in the COMMAND register.
The SMBus Alert style interrupt is cleared by an Alert Response as described in the Interrupt Control Register
section and SMBus specification.
To configure the interrupt as an end-of-conversion signal, the interrupt PERSIST field is set to 0. Either Level
or SMBus Alert style can be used. An interrupt will be generated upon completion of each conversion. The
interrupt threshold registers are ignored. The following example illustrates the configuration of a level interrupt:
// Set up end−of−conversion interrupt, Level style
Address = 0x39 //Slave addr also 0x29 or 0x49
Command = 0x86 //Address Interrupt Register
Data = 0x10 //Level style, every ADC cycle
WriteByte(Address, Command, Data)

TSL2563FN

Mfr. #:
Manufacturer:
ams
Description:
Light to Digital Converters Ambient Light Sensor Light to Digital
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union