datasheetbank_Logo
Технический паспорт Поисковая и бесплатно техническое описание Скачать

TSL2569CS Просмотр технического описания (PDF) - austriamicrosystems AG

Номер в каталоге
Компоненты Описание
Список матч
TSL2569CS
AmsAG
austriamicrosystems AG AmsAG
TSL2569CS Datasheet PDF : 37 Pages
First Prev 21 22 23 24 25 26 27 28 29 30 Next Last
TSL2568, TSL2569
LIGHT-TO-DIGITAL CONVERTER
TAOS091D − DECEMBER 2008
APPLICATION INFORMATION: SOFTWARE
The following example pseudo code illustrates the configuration of an SMB Alert style interrupt when the light
intensity changes 20% from the current value, and persists for 3 conversion cycles:
// Read current light level
Address = 0x39
//Slave addr also 0x29 or 0x49
Command = 0xAC
//Set Command bit and Word bit
ReadWord (Address, Command, DataLow, DataHigh)
Channel0 = (256 * DataHigh) + DataLow
//Calculate upper and lower thresholds
lid T_Upper = Channel0 + (0.2 * Channel0)
T_Lower = Channel0 – (0.2 * Channel0)
//Write the lower threshold register
a Command = 0xA2
//Addr lower threshold reg, set Word Bit
WriteWord (Address, Command, T_Lower.LoByte, T_Lower.HiByte)
v //Write the upper threshold register
ill Command = 0xA4
//Addr upper threshold reg, set Word bit
WriteWord (Address, Command, T_Upper.LoByte, T_Upper.HiByte)
//Enable interrupt
t Command = 0x86
G Data = 0x23
s WriteByte(Address, Command, Data)
//Address interrupt register
//SMBAlert style, PERSIST = 3
A t In order to generate an interrupt on demand during system test or debug, a test mode (INTR = 11) can be used.
The following example illustrates how to generate an interrupt on demand:
s n // Generate an interrupt
e Address = 0x39
m t Command = 0x86
Data = 0x30
a n WriteByte(Address, Command, Data)
//Slave addr also 0x29 or 0x49
//Address Interrupt register
//Test interrupt
Technical co //Interrupt line should now be low
Copyright E 2008, TAOS Inc.
20
r
www.taosinc.com
The LUMENOLOGY r Company
r

Share Link: 

datasheetbank.com [ Privacy Policy ] [ Request Datasheet ] [ Contact Us ]