1 Introduction to TSL256x The TSL2560 and TSL2561 are high-speed, low-power, wide-range, programmable and flexible configurations of light intensity digital conversion chips from TAOS. The chip can be widely used in the monitoring of various types of displays. The purpose is to provide the best display brightness and minimize power consumption under variable lighting conditions. It can also be used for street lighting control and security lighting. Many occasions. The main features of the chip are as follows: Programmable to set the upper and lower thresholds of the allowed light intensity, and when the actual illuminance exceeds the threshold, an interrupt signal is given; Digital output conforms to the standard SMBus (TSL2560) and I2C (TSL2561) bus protocols; Programmable control of analog gain and digital output time; 1.25 mm & TImes; 1.75 mm ultra-small package, in low power mode, consumes only 0.75 mW; Automatically suppresses illumination fluctuations of 50 Hz/60 Hz. 2 TSL256x pin function The TSL256x is available in two package styles: 6LEAD CHIPSCALE and 6LEAD TMB. The package form is different, and the corresponding illuminance calculation formula is different. The function of each pin is as follows: Pin 1 and Pin 3: Power pin and signal ground, respectively. Its operating voltage range is 2.7 ~ 3.5V. Pin 2: Device Access Address Select Pin. Due to the different pin levels, the device has 3 different access addresses. The correspondence between access addresses and levels is listed in Table 1. Pins 4 and 6: Clock signal and data lines for the I2C or SMBus bus. Pin 5: Interrupt signal output pin. The device outputs an interrupt signal when the light intensity exceeds the upper or lower threshold set by the user. 3 TSL256x internal structure and working principle The TSL256x is a second-generation ambient light intensity sensor whose internal structure is shown in Figure 2. Channel 0 and Channel 1 are two photodiodes, where channel 0 is sensitive to both visible and infrared light, while channel 1 is only sensitive to infrared light. The integral A/D converter integrates the current flowing through the photodiode and converts it into a digital quantity. After the conversion is completed, the conversion result is stored in the respective registers of the internal channel 0 and channel 1 of the chip. When an integration cycle is completed, the integral A/D converter will automatically begin the next integral conversion process. The microcontroller and TSL2560 can be implemented via the standard SMBus (System Management Bus) V1.1 or V2.0, while the TSL2561 can be accessed via the I2C bus protocol. Control of the TSL256x is achieved by reading and writing to its internal 16 registers. 4 TSL256x application design The TSL256x's access follows the standard SMBus and I2C protocols, making the chip's hardware and software design very simple. Although the read and write timings of these two protocols are similar, there are still differences. The TSL2561 chip is taken as an example to illustrate the practical application of the TSL256x light intensity sensor. 4.1 Hardware Design The TSL2561 can be accessed via the I2C bus, so the hardware interface circuitry is very simple. If the selected microcontroller has an I2C bus controller, connect the clock and data lines of the bus directly to the SCL and SDA of the I2C bus of the TSL2561; if there is no pull-up resistor inside the microcontroller, Then use 2 pull-up resistors to connect to the bus. If the microcontroller does not have an I2C bus controller, connect the SCL and SDA of the I2C bus of the TSL2561 to the normal I/O port; however, the timing of the I2C bus needs to be simulated to access the TSL2561 during programming, and the INT pin is connected to the micro control. The external interrupt of the device. 4.2 Software Design The microcontroller can read and write to the TSL2561 via the I2C bus protocol. When writing data, the device address is sent first, and then the data to be written is sent. The write operation of TSL2561 is as follows: First send a set of device address; then write the command code, the command code is to specify the address of the next write register 00h ~ 0fh and the way to write the register, is a byte, word or block (several words ) Write the unit for the unit; finally send the data to be written, according to the way the previous command code specifies the write register, the data to be written can be continuously sent, and the internal write register is automatically incremented by one. For the specific read and write timing of the I2C protocol, refer to related materials, and details are not described herein. Due to space limitations, some programs for TSL2561 read and write operations are given here: Unsigned char TSL2561_write_byte( unsigned char addr, unsigned char c) { Unsigned char status=0; Status=twi_start();//Start Status=twi_writebyte(TSL2561_ADDR|TSL2561_WR);//Write TSL2561 address Status=twi_writebyte(0x80|addr);//write command Status=twi_writebyte(c);//Write data Twi_stop( );//stop Delay_ms(10);//delay 10 ms Return 0; } Unsigned char TSL2561_read_byte( unsigned char addr, unsigned char *c) { Unsigned char status=0; Status= twi_start( );//Start Status=twi_writebyte(TSL2561_ADDR|TSL2561_WR);//Write TSL2561 address Status=twi_writebyte(0x80|addr);//write command Status=twi_start( );//Restart Status=twi_writebyte(TSL2561_ADDR|TSL2561_RD);//Write TSL2561 address Status=twi_readbyte(c,TW_NACK);//Write data Twi_stop( ); Delay_ms(10); Return 0; } When the integral A/D converter is converted, the corresponding values ​​CH0 and CH1 can be read from the channel 0 register and the channel 1 register, but in units of Lux (lumen), and also according to CH0 and CH1. For the TMB package, assuming the light intensity is E (in Lux), the formula is as follows: 1 0 E=0.030 4&TImes;CH0-0.062&TImes;CH0&TImes;(CH1/CH0)1/4 2 0.50 E=0.022 4×CH0-0.031×CH1 3 0.61 E=0.012 8×CH0-0.015 3×CH1 4 0.80 E=0.001 46×CH0-0.001 12×CH1 5 CH1/CH0》1.30 E=0 For the CHIPSCALE package, the calculation formula can be used to view the corresponding chip data. 5 Conclusion The TSL256x system for real-time monitoring of light intensity has the advantages of high precision, low cost and small size. The integrated A/D converter is integrated inside the chip and uses digital signal output, so the anti-interference ability is stronger than similar chips. The chip has been widely used in the field of light intensity monitoring and control. Product categories of Stylus Pen For Huawei, which is just for Huawei M5, M6, C5, Matebook E, other tablets can not be used. Pls check with your huawei tablet model before ordering. We have advanced production equipment, strong software and hardware development capabilities. We have the perfect after-sale service and technical support. Looking forward to our cooperation. Stylus Pen For Huawei,Surface Pen,Touch Pen,Touch Screen Pen Shenzhen Ruidian Technology CO., Ltd , https://www.wisonens.com