AN576 Si11 4 X C ONTROL P ANEL A PPLICATION U SER ’ S G UIDE 1. Introduction The Si114x control panel application enables the user to configure an Si1140DK or an IRslider2EK board quickly and operate it in a way that is representative of the end application. The application enables ambient-light sensing and proximity detection. The only Si114x features not supported are interrupt-driven accesses and autonomous measurements. Instead, the application initiates forced measurement cycles asynchronously and performs statistical computations (average and standard deviation) on the measurement results. 2. Getting Started Upon startup, the user sees the following panel: The Dashboard tab groups the main controls and results the user will be using for configuration and measurement. The other tabs contain additional settings required for proximity, ambient light and auxiliary measurements. Rev. 0.3 1/15 Copyright © 2015 by Silicon Laboratories AN576 AN576 3. Connecting the Evaluation Board If a supported evaluation board is connected to a USB port prior to launching the application, its device code will appear in real time in the device-selection drop-down menu on the upper-left corner, as in the figure below. Other USB ports that appear in the menu, such as COM1, should be ignored. Select the board by its identifier (TS0000C0B9 in this example) and click on the Connect button. Once the evaluation board is connected to the application, the Si114x registers and parameters are read and displayed on the application controls. If the board was just powered, the Si114x will be configured to its power-on reset values. Refer to the Si114x data sheet for a complete list of the Si114x power-on reset values. 4. Measurement Channels Once the above step is completed successfully, the evaluation board is ready to perform measurements. Six measurement modes, called “channels,” are possible: Three proximity-detection channels, each of which may use any combination of up to three infrared LEDs A visible ambient-light channel An infrared ambient-light channel An internal “auxiliary” channel, typically used to monitor device temperature for precise offset control Each channel can be enabled or disabled independently, depending on the system requirements. The main proximity-measurement parameters, namely LED selection and current, can also be set in the Dashboard tab. All controls, when set by the user, are instantly written to the Si114x and read back to the GUI for verification. Refer to the Program Walk-Through section for a detailed description of control and result fields throughout the application. 5. Making Measurements Once the Si114x has been configured, measurements may be initiated by clicking on Measure Samples for a finite number of measurements, or on Measure Continuous for continuous measurements. Refer to “7.1.4. Making Accurate Lux Measurements” and "7.1.5. Making Proximity Measurements" on page 4 for details on performing those respective measurements. 6. Exiting the Program The application may be terminated by clicking on the Done button at the lower right-hand corner of the panel. 2 Rev. 0.3 AN576 7. Program Walk-Through The following sections describe the program in detail. 7.1. Dashboard Once the evaluation board is connected through the application, the Dashboard tab appears as shown below: 7.1.1. Interface Area The Interface area displays the contents of the various Si114x registers that help identify the part and verify proper connectivity. The I2C address shown is the global address (0). 7.1.2. Measurement Area The Measurement area contains the basic configuration settings that define the Si114x’s mode of operation. The proximity channels can also be reconfigured for ambient-light measurement, in which case all LED selections should be disabled, and the PS_ADC_MODE must be set to “Raw ADC” in the next tab. For each LED, a different current level can be programmed, but each LED is turned on at the same current level for all proximity channels that make use of it. 7.1.3. Result Area The ADC_OFFSET value is added to each measurement. It is needed to avoid very low readings to be occasionally reported as negative when noise is present. An uncompressed value of 256 is normally adequate, unless a larger system or ambient noise level warrants a higher value. For each channel that is enabled, instant measurement results are displayed in the Sample field, while the average and standard deviation are displayed in the Average and Sigma fields, respectively. Statistics are reset each time Measure Samples, Measure Continuous or Capture Dark is clicked. Rev. 0.3 3 AN576 7.1.4. Making Accurate Lux Measurements The Si114x is capable of accurate lux measurements even under dark product overlays, such as tinted plastics or dark ink silkscreened over toughened glass. Typically, those overlays appear dark but are fairly transparent to infrared light, thus enabling unobstructed proximity detection. However, accurate ambient-light estimation requires correction of the visible and infrared light measurements as seen through the overlay. Accurate lux measurements require a “dark” value for each channel for proper coefficient weighting. In an actual implementation, the dark values would be programmed empirically into the system software based on channel gain, ambient light noise, supply voltage, etc. However, in a prototyping environment, the most expedient way to obtain dark values is to cover the Si114x with dark material, such as black ESD foam, and click on the Capture Dark button. If a lux measurement is attempted prior to capturing a dark value, a warning appears and default dark values are used for the lux calculation. Lux measurements typically use the visible and small infrared photodiodes, available in the ALS Visible and ALS IR channels, respectively. While lux measurements are concerned only with visible light, the ALS IR channel is required to subtract any residual infrared response in the ALS visible channel. Proper weighting of the visible versus IR channel depends on the product overlay’s spectral characteristics. Whichever channel must be taken into account for lux calculations must be enabled with the appropriate (nonzero) coefficient. Refer to “AN523: Overlay Considerations for the Si114x Sensor” for coefficient selection based on product overlay. 7.1.5. Making Proximity Measurements 7.1.5.1. Typical Proximity Measurement Sequence Proximity of a target is detected by the Si114x comparing the photodiode current with the LED turned on to the photodiode current with the LED turned off, thus removing the offset caused by ambient light. Another kind of offset is still present because of optical leakage, i.e. the amount of light caused by direct coupling between the LED and the Si114x and by indirect coupling due to internal reflections. This offset is called the proximity baseline and must be calibrated before accurate proximity detection can occur. In an actual system, the baseline is either set in the factory or calculated dynamically, depending on system considerations. In a prototyping environment, the baseline is captured after configuring the proximity settings. After configuring the proximity channel or channels, the user must click on the “Capture baseline” button in the Dashboard with no detectable object in front of the Si114x. Ideally, a very dark surface, such as photographic focusing cloth, should be placed in front of the Si114x at several times the maximum intended detection distance. If that is not practical, leaving the Si114x with “nothing” in front is often sufficient. Once captured, the proximity baseline for each enabled channel is displayed in the corresponding data field in the result area of the Dashboard. If any proximity setting is subsequently changed, the baseline is reset to zero. After the baseline has been recorded, proximity measurements can be made by clicking either the “Measure Samples” button or the “Measure Continuous” button, depending on the type of measurement desired. Proximity counts, i.e. photodiode ADC counts with both ambient light and baseline offsets subtracted, are displayed for each enabled channel in the corresponding data field in the result area of the Dashboard. 7.1.5.2. Proximity-Related Presets A number of buttons are provided in the “Proximity-general” tab as shortcuts to configure the proximity channels for various kinds of proximity measurements. The results of clicking each button are shown in the following table. After a preset has been selected, the user is free to modify the Si114x settings to suit the exact requirements of the application. The preset values may also be modified for each button by editing the settings.ini text file, which resides in the same directory as the application's executable. 4 Rev. 0.3 PS1_ADCMUX, PS2_ADCMUX, PS3_ADCMUX Large IR photodiode Large IR photodiode Large IR photodiode Large IR photodiode Small IR photodiode Button Reset defaults Low light High sensitivity High signal Sunlight 1 1 1 4 1 PS_ADC_GAIN 15, 359 mA 15, 359 mA 15, 359 mA 13, 269 mA 13, 269 mA PS_LED1, PS_LED2, PS_LED3 Current (High) 10, 180 mA 7, 112 mA 4, 45 mA 3, 22.4 mA 3, 22.4 mA PS_LED1, PS_LED2, PS_LED3 Current (Low) High Range High Range Normal Range Normal Range Normal Range PS_RANGE 1 1 4 16 1 ALS_VIS_ ADC_GAIN High Range Normal Range Normal Range Normal Range Normal Range VIS_ RANGE Small IR Photodiode Large IR Photodiode Large IR Photodiode Large IR Photodiode Small IR Photodiode ALS_IR_A DCMUX 1 1 1 16 1 ALS_IR_ADC _GAIN High Range Normal Range Normal Range Normal Range Normal Range IR_RANGE Normal Proximity Normal Proximity Normal Proximity Normal Proximity Normal Proximity PS_ADC_MODE AN576 Rev. 0.3 5 AN576 7.2. Proximity Detection General Tab The common tab for the proximity-detection channels is shown below: Presets: Ten preset buttons are available to configure the Si114x for various situations. Refer to "7.1.5.2. Proximity-Related Presets" on page 4 for details. The PS_ADC_GAIN slider sets the sensitivity of the ADC used to measure proximity in power-of-two steps from 1 to 2048. Values of 128 or less are recommended. The LED “on” time is proportional to the gain. This must be taken into account when evaluating total power consumption and for selecting the LED resistor and capacitor. Refer to “AN498: Si114x Designer’s Guide” for more details on component selection. The PS_ADC_MODE selects whether a proximity measurement or a “Raw ADC” measurement is made. The “Raw ADC” mode is used when one of the proximity channels is used for ambient-light sensing. The PS_RANGE bit sets conversion for normal sensitivity for indoor operation or “High Range,” meaning sensitivity divided by 14.5, for operation under direct sunlight. The PS_ADC_REC normally does not need changing. Contact Silicon Labs for more details. 6 Rev. 0.3 AN576 7.3. PS1, PS2 and PS3 Tabs The settings specific to each proximity channel are accessible through the PS1, PS2 and PS3 tabs, respectively. Each proximity-detection channel has the same architecture and consistent naming conventions. The PS1 tab, as an example, is shown below: The schematic displays the data path for illustrative purposes. Parameters PS_ADC_REC, PS_ADC_GAIN and PS_RANGE are common to all three proximity channels and are set in the “Proximity—general” tab. Likewise parameters ADC_OFFSET and EN_PSn are set in the Dashboard tab. They are shown on the schematic as an indication of their effect on the measurement data path. The PSn_ADCMUX selects the input to the ADC. Proximity detection uses the large IR photodiode by default, but the small IR photodiode can be used for operation under direct sunlight. The PSn_DATA measurement results are mirrored back to the Dashboard tab in the corresponding Sample field, so that measurement results of all six channels can be seen on the same tab. Rev. 0.3 7 AN576 7.4. ALS_VIS Tab The visible ambient-light channel tab is shown below: The schematic displays the data path for illustrative purposes. Parameters ADC_OFFSET and EN_ALS_VIS are set in the Dashboard tab. They are shown on the schematic as an indication of their effect on the measurement data path. The ALS_VIS_ADC_GAIN slider sets the sensitivity of the ADC used to measure visible ambient light in power-oftwo steps from 1 to 2048. Values of 128 or less are recommended. The VIS_RANGE bit, when selected, sets conversion for “High Range,” meaning sensitivity divided by 14.5, for operation under direct sunlight. The ALS_VIS_DATA measurement results are mirrored back to the Dashboard tab in the corresponding Sample field, so that measurement results of all six channels can be seen on the same tab. The ALS_VIS_ADC_REC normally does not need changing. Contact Silicon Labs for more details. 8 Rev. 0.3 AN576 7.5. ALS_IR Tab The infrared ambient-light channel tab is shown below: The schematic displays the data path for illustrative purposes. Parameters ADC_OFFSET and EN_ALS_IR are set in the Dashboard tab. They are shown on the schematic as an indication of their effect on the measurement data path. The ALS_IR_ADC_GAIN slider sets the sensitivity of the ADC used to measure infrared ambient light in power-oftwo steps from 1 to 2048. Values of 128 or less are recommended. The IR_RANGE bit, when selected, sets conversion for “High Range,” meaning sensitivity divided by 14.5, for operation under direct sunlight. The ALS_IR_ADCMUX selects the input to the ADC. Ambient-light sensing normally uses the small IR photodiode, but the more sensitive large IR photodiode can also be used in some conditions. The ALS_IR_DATA measurement results are mirrored back to the Dashboard tab in the corresponding Sample field, so that measurement results of all six channels can be seen on the same tab. The ALS_IR_ADC_REC normally does not need changing. Contact Silicon Labs for more details. Rev. 0.3 9 AN576 7.6. AUX Tab The auxiliary channel’s tab is shown below: The schematic displays the data path for illustrative purposes. Parameters ADC_OFFSET and EN_AUX are set in the Dashboard tab. They are shown on the schematic as an indication of their effect on the measurement data path. The AUX_ADCMUX selects the input to the ADC. The most common use of the auxiliary channel is temperature monitoring for precise offset control. The AUX_DATA measurement results are mirrored back to the Dashboard tab in the corresponding Sample field, so that measurement results of all six channels can be seen on the same tab. 8. Getting Help Many of the application’s control and data fields contain Tool Tips, which act as context-dependent help. Those may be viewed by rolling the mouse cursor over the appropriate parts of the panel. After exploring the present document and trying the software, additional details regarding Si114x settings and theory of operation can easily be found in the product data sheet. Contact Silicon Labs technical support if further help is needed. 10 Rev. 0.3 AN576 DOCUMENT CHANGE LIST Revision 0.1 to Revision 0.2 Added proximity baseline and baseline-subtracted proximity data field in Dashboard screenshot. Added explanation to proximity measurements. Added explanation to proximity presets. Changed recommended ADC gain values to agree with current data sheet revision. Corrected a schematic error in IR_ALS tab screenshot. Revision 0.2 to Revision 0.3 Updated Dashboard screenshots to reflect new placement of interface elements. Rev. 0.3 11 Smart. Connected. Energy-Friendly Products Quality Support and Community www.silabs.com/products www.silabs.com/quality community.silabs.com Disclaimer Silicon Laboratories intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Laboratories products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Laboratories reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Laboratories shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products must not be used within any Life Support System without the specific written consent of Silicon Laboratories. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Laboratories products are generally not intended for military applications. Silicon Laboratories products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. Trademark Information Silicon Laboratories Inc., Silicon Laboratories, Silicon Labs, SiLabs and the Silicon Labs logo, CMEMS®, EFM, EFM32, EFR, Energy Micro, Energy Micro logo and combinations thereof, "the world’s most energy friendly microcontrollers", Ember®, EZLink®, EZMac®, EZRadio®, EZRadioPRO®, DSPLL®, ISOmodem ®, Precision32®, ProSLIC®, SiPHY®, USBXpress® and others are trademarks or registered trademarks of Silicon Laboratories Inc. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders. Silicon Laboratories Inc. 400 West Cesar Chavez Austin, TX 78701 USA http://www.silabs.com