English
Language : 

TCS3404_11 Datasheet, PDF (24/41 Pages) ams AG – DIGITAL COLOR SENSORS
TCS3404, TCS3414
DIGITAL COLOR SENSORS
APPLICATION INFORMATION: SOFTWARE
TAOS137A − APRIL 2011
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.
lid // Set up Timing Register
//Low Gain (1x), integration time of 12ms (default value)
Address = 0x39
Command = 0x81
//Timing Register
Data = 0x02
a WriteByte(Address, Command, Data)
v //Low Gain (1x), integration time of 101ms
Command = 0x81
//Timing Register
ill Data = 0x01
WriteByte(Address, Command, Data)
t //Low Gain (1x), integration time of 12ms
Data = 0x00
G s WriteByte(Address, Command, Data)
//High Gain (16x), integration time of 101ms
A t Command = 0x81
//Timing Register
Data = 0x01
s n WriteByte(Address, Command, Data)
Command = 0x87
//Gain Control Register
e Data = 0x20
m t WriteByte(Address, Command, Data)
//Read data registers (see Basic Operation example)
a n //Perform Manual Integration of 50 us
o //Set up for manual integration
Command = 0x80
c Data = 0x01
WriteByte(Address, Command, Data)
//Disable ADC_EN
l Command = 0x81
Data = 0x10
a WriteByte(Address, Command, Data)
//Set manual integration
ic Command = 0x80
Data = 0x03
WriteByte(Address, Command, Data)
//Enable ADC_EN and begin integration
n //Integrate for 50ms
Sleep (50)
//Wait for 50ms
h //Stop integrating
c Command 0x80
Data = 0x01
TeWriteByte(Address, Command, Data)
//Disable ADC_EN and stop integration
//Read data registers (see Basic Operation example)
The LUMENOLOGY r Company
r
r
www.taosinc.com
Copyright E 2011, TAOS Inc.
23