TCS3404 TAOS [TEXAS ADVANCED OPTOELECTRONIC SOLUTIONS], TCS3404 Datasheet - Page 21

no-image

TCS3404

Manufacturer Part Number
TCS3404
Description
DIGITAL COLOR SENSORS
Manufacturer
TAOS [TEXAS ADVANCED OPTOELECTRONIC SOLUTIONS]
Datasheet
Basic Operation
// Read ADC Channels Using Read Word Protocol − RECOMMENDED
The LUMENOLOGY r Company
After applying V
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:
Address = 0x39
Command = 0x80
PowerUp = 0x03
//Wait for integration conversion
//Address the Ch1 lower data register and configure for Read Word
Command = 0xB0
//Reads two bytes from sequential registers 10h and 11h
//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel1 = 256 * DataHigh + DataLow
//Address the Ch2 lower data register and configure for Read Word
Command = 0xB2
//Reads two bytes from sequential registers 12h and 13h
//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel2 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte
//Address the Ch3 lower data register and configure for Read Word
Command = 0xB4
//Reads two bytes from sequential registers 14h and 15h
//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel3 = 256 * DataHigh + DataLow
//Address the Ch4 lower data register and configure for Read Word
Command = 0xB8
//Reads two bytes from sequential registers 16h and 17h
//Results are returned in DataLow and DataHigh variables
ReadWord (Address, Command, DataLow, DataHigh)
Channel4 = 256 * DataHigh + DataLow //Shift DataHigh to upper byte
DD
, the device will initially be in the power−down state. To operate the device, issue a command
APPLICATION INFORMATION: SOFTWARE
r
www.taosinc.com
//Power Up and Enable ADC
//Set Command bit and Word transaction
//Set Command bit and Word transaction
//Set Command bit and Word transaction
//Set Command bit and Word transaction
r
DIGITAL COLOR SENSORS
TCS3404, TCS3414
Copyright E 2011, TAOS Inc.
TAOS137A − APRIL 2011
21

Related parts for TCS3404