English
Language : 

TCS3404_11 Datasheet, PDF (22/41 Pages) ams AG – DIGITAL COLOR SENSORS
TCS3404, TCS3414
DIGITAL COLOR SENSORS
APPLICATION INFORMATION: SOFTWARE
TAOS137A − APRIL 2011
Basic Operation
After applying VDD, 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 the control register to set ADC_EN and POWER
to power up the device. At this point, all four ADC channels will begin a conversion at the default integration time
of 12 ms. After 12 ms, the conversion results will be available in ADC Channel Data Registers (10h through 17h).
The following pseudo code illustrates a procedure for reading the TCS3404/14 device using Word and Byte
transactions:
lid // Read ADC Channels Using Read Word Protocol − RECOMMENDED
Address = 0x39
Command = 0x80
a PowerUp = 0x03
//Power Up and Enable ADC
//Wait for integration conversion
v //Address the Ch1 lower data register and configure for Read Word
Command = 0xB0
//Set Command bit and Word transaction
ill //Reads two bytes from sequential registers 10h and 11h
//Results are returned in DataLow and DataHigh variables
t ReadWord (Address, Command, DataLow, DataHigh)
Channel1 = 256 * DataHigh + DataLow
G s //Address the Ch2 lower data register and configure for Read Word
Command = 0xB2
//Set Command bit and Word transaction
A t //Reads two bytes from sequential registers 12h and 13h
s n //Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
e Channel2 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte
m t //Address the Ch3 lower data register and configure for Read Word
Command = 0xB4
//Set Command bit and Word transaction
a n //Reads two bytes from sequential registers 14h and 15h
o //Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
c Channel3 = 256 * DataHigh + DataLow
//Address the Ch4 lower data register and configure for Read Word
l Command = 0xB8
//Set Command bit and Word transaction
a //Reads two bytes from sequential registers 16h and 17h
//Results are returned in DataLow and DataHigh variables
ic ReadWord (Address, Command, DataLow, DataHigh)
Techn Channel4 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte
The LUMENOLOGY r Company
r
r
www.taosinc.com
Copyright E 2011, TAOS Inc.
21