VL6180X range and ambient light sensor quick setup guide. Main components Proximity and ambient light sensing (ALS) module

Similar documents
SPC5-FLASHER. Flash management tool for SPC56xx family. Description. Features

Single LNB supply and control IC DiSEqC 1.X compliant with EXTM based on the LNBH29 in a QFN16 (4x4) Description

AN3332 Application note

UM1676 User manual. Getting started with.net Micro Framework on the STM32F429 Discovery kit. Introduction

EN: This Datasheet is presented by the m anufacturer. Please v isit our website for pricing and availability at ore.hu.

LM337. Three-terminal adjustable negative voltage regulators. Features. Description

UM1613 User manual. 16-pin smartcard interface ST8034P demonstration board. Introduction

M24LRxx/CR95HF application software installation guide

Description. Table 1. Device summary

Description. Table 1. Device summary. Order code Temperature range Package Packaging Marking

STTH1R04-Y. Automotive ultrafast recovery diode. Features. Description

UA741. General-purpose single operational amplifier. Features. Applications. Description. N DIP8 (plastic package)

STEVAL-IEG001V2. Smart real-time vehicle tracking system. Features

EVL185W-LEDTV. 185 W power supply with PFC and standby supply for LED TV based on the L6564, L6599A and Viper27L. Features.

AN2604 Application note

BD241A BD241C. NPN power transistors. Features. Applications. Description. NPN transistors. Audio, general purpose switching and amplifier transistors

ULN2801A, ULN2802A, ULN2803A, ULN2804A

TN0023 Technical note

BD238. Low voltage PNP power transistor. Features. Applications. Description. Low saturation voltage PNP transistor

Table 1. Absolute maximum ratings (T amb = 25 C) Symbol Parameter Value Unit. ISO C = 330 pf, R = 330 Ω : Contact discharge Air discharge

DDSL01. Secondary protection for DSL lines. Features. Description

AN4156 Application note

SPC5-CRYP-LIB. SPC5 Software Cryptography Library. Description. Features. SHA-512 Random engine based on DRBG-AES-128

AN2680 Application note

Description. Table 1. Device summary. Order codes. TO-220 (single gauge) TO-220 (double gauge) D²PAK (tape and reel) TO-220FP

AN3110 Application note

ST High voltage fast-switching NPN power transistor. Features. Applications. Description

TDA W CAR RADIO AUDIO AMPLIFIER

AN3353 Application note

AN3155 Application note

2STBN15D100. Low voltage NPN power Darlington transistor. Features. Application. Description

AN3354 Application note

AN2389 Application note

AN4108 Application note

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

UM1790 User manual. Getting started with STM32L053 discovery kit software development tools. Introduction

Description SO-8. series. Furthermore, in the 8-pin configuration Very low-dropout voltage (0.2 V typ.)

LM135-LM235-LM335. Precision temperature sensors. Features. Description

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

AN3998 Application note

AN2824 Application note

AN4368 Application note

ST19NP18-TPM-I2C. Trusted Platform Module (TPM) with I²C Interface. Features

ULN2001, ULN2002 ULN2003, ULN2004

BD135 - BD136 BD139 - BD140

AN3265 Application note

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

ETP01-xx21. Protection for Ethernet lines. Features. Description. Applications. Benefits. Complies with the following standards

BZW50. Transil, transient voltage surge suppressor (TVS) Features. Description

DSL01-xxxSC5. Secondary protection for DSL lines. Features. Description. Applications. Benefits. Complies with the following standards

ESDLIN1524BJ. Transil, transient voltage surge suppressor diode for ESD protection. Features. Description SOD323

AN4128 Application note

LM134-LM234-LM334. Three terminal adjustable current sources. Features. Description

MC Low noise quad operational amplifier. Features. Description

Description. IO and RF AGC. ASIC controller and power management. Carrier recovery loop. GPIO switch matrix. Lock indicator and monitoring DVBS2 FEC

How To Write To An Eeprom Memory On A Flash Memory On An Iphone Or Ipro Memory On Microsoft Flash Memory (Eeprom) On A Microsoft Microsoft Powerbook (Ai) 2.2.2

AN2866 Application note

STTH2R06. High efficiency ultrafast diode. Features. Description

STTH110. High voltage ultrafast rectifier. Description. Features

Order code Temperature range Package Packaging

UM0985 User manual. Developing your STM32VLDISCOVERY application using the IAR Embedded Workbench software. Introduction

MC34063AB, MC34063AC, MC34063EB, MC34063EC

AN2557 Application note

AN3359 Application note

L78MxxAB L78MxxAC. Precision 500 ma regulators. Features. Description

L6234. Three phase motor driver. Features. Description

TDA2004R W stereo amplifier for car radio. Features. Description

AN2703 Application note

AN3252 Application note

AN2760 Application note

P6KE. Transil, transient voltage surge suppressor (TVS) Features. Description. Complies with the following standards

STP60NF06. N-channel 60V Ω - 60A TO-220 STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

STP60NF06FP. N-channel 60V Ω - 30A TO-220FP STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

AN3270 Application note

STN3NF06L. N-channel 60 V, 0.07 Ω, 4 A, SOT-223 STripFET II Power MOSFET. Features. Application. Description

AN1819 APPLICATION NOTE Bad Block Management in Single Level Cell NAND Flash Memories

AN3990 Application note

AN3327 Application note

VN5R003H-E. 3 mω reverse battery protection switch. Features. Description. Application

AN820 APPLICATION NOTE INPUT/OUTPUT PROTECTION FOR AUTOMOTIVE COMPUTER

STDP2600. Advanced HDMI to DisplayPort (dual mode) converter. Features. Applications

AN974 APPLICATION NOTE

AN1754 APPLICATION NOTE

AN3211 Application note

STCS A max constant current LED driver. Features. Applications. Description

BTW N. 50 A 1200 V non insulated SCR thyristor. Description. Features. Applications

VN05N. High side smart power solid state relay PENTAWATT. Features. Description

STP55NF06L STB55NF06L - STB55NF06L-1

Obsolete Product(s) - Obsolete Product(s)

STCS1A. 1.5 A max constant current LED driver. Features. Applications. Description

LM2901. Low-power quad voltage comparator. Features. Description

STTH3R02QRL. Ultrafast recovery diode. Main product characteristics. Features and benefits. Description. Order codes DO-15 STTH3R02Q DO-201AD STTH3R02

STGB10NB37LZ STGP10NB37LZ

AN4427 Application note

AN2146 APPLICATION NOTE

STLM20. Ultra-low current 2.4 V precision analog temperature sensor. Features. Applications

Description. Table 1. Device summary. Order code Temperature range Package Packing Marking

STDP2690. Advanced DisplayPort to DisplayPort (dual mode) converter. Features. Applications

VN03. ISO high side smart power solid state relay PENTAWATT. Features. Description.

Transcription:

DT0037 Design tip VL6180X range and ambient light sensor quick setup guide By Colin Ramrattan Main components VL6180X Proximity and ambient light sensing (ALS) module Purpose and benefits The purpose of this document is to guide customers who would like to know the following: (1) how to connect the VL6180X to HOST processor and (2) the minimum settings/register writes required to receive range and ambient light sensor (ALS) measurements out of the VL6180X. It is assumed that customers who use this document are familiar with coding practices, the I 2 C standard and have the technical knowledge to understand the VL6180X datasheet. Figure 1. VL6180X device Overview The VL6180X contains both an ambient light sensor (ALS) and a proximity measurement sensor. This document will guide the user on how to connect the VL6180X to a suitable HOST processor present the power up sequencing of the VL6180X. Then a simple July 2014 DT0037 Rev 1 1/9

description of how to setup the VL6180X to perform range and ALS measurements will be given. Appendix 1 provides the required register writes to enable the appropriate tuning for the VL6180X. Application Schematic The VL6180X is a 12-pin module that is contained in a convenient 4.8mm x 2.8mm x 1mm LGA package. A simple application schematic is shown below in Figure 2. This is taken directly from the VL6180X datasheet. Figure 2. VL6180X typical application schematic The pull-up resistors on the GPIO pins are important to the VL6180X operation. For example, GPIO0 is considered an enable pin during boot up of the device and if not pulled up will not allow the device to start. Power-Up Sequencing The VL6180X requires a stable 2.8V power supply for AVDD_VCSEL and AVDD power supply inputs. The VL6180X requires power to be applied to AVDD_VCSEL pin before or at the same time as power is applied to AVDD pin. There is no limit to how early the AVDD_VCSEL power can be applied before AVDD power is applied July 2014 DT0037 Rev 1 2/9

Figure 3. VL6180X ranging and ALS software flow July 2014 DT0037 Rev 1 3/9

Software Design The VL6180X communicates through an I 2 C interface to the HOST processor. It is assumed that the end customer has experience with the I 2 C communication standard. At power up, the VL6180X will be ready to respond to I 2 C communication 1ms after power is applied. It is assumed that the power applied is within the limits specified in the VL6180X datasheet. The minimal settings that should be applied to the VL6180X are summarized below in Figure 3. The software flow shown in Figure3 above applies to a minimal set of settings to allow the VL6180X to perform a single shot range or single shot ambient light measurement. To describe each step with further detail, the steps in Figure 3 have been numbered. Each corresponding number is described below. 1. Applying power to the VL6180X is as simple as applying 2.8V to the VDDA and VDDA_VCSEL pins. It is important to take note of the power up sequencing described in this document. 2. Changing the GPIO0 to logic 1 allows the device to come out of reset. 3. Device boots in 1ms so the HOST should wait this minimum amount of time before communicating with the VL6180X. 4. Register 0x0016 is described as the SYSTEM FRESH_OUT_OF_RESET register. If the value in SYSTEM FRESH_OUT_OF_RESET is 0x01 then the VL6180X is in idle mode and working as expected. If the SYSTEM FRESH_OUT_OF_RESET register is any other value, reset the device by applying logic 0 to GPIO0. This will return you to step 2. 5. Register 0x0016 is described as the SYSTEM FRESH_OUT_OF_RESET flag. Writing a 0 to bit[0] allows it to be used for debug purposes. 6. Apply the tuning settings as shown in Appendix 1. This is mandatory after every boot of the VL6180X. 7. The user should choose either the range function and continue to step 8 or the ALS function and continue to step 12. 8. Register 0x0014 is described as the SYSTEM INTERRUPT_CONFIG_GPIO. By setting bits [2:0] to 0b100, this enables the range function interrupt within the device, not externally on the GPIO1 or GPIO0 pins. 9. Register 0x0018 is described as the SYSRANGE START register. Writing a 1 to bit[0] starts a single shot range measurement. July 2014 DT0037 Rev 1 4/9

10. Register 0x004F is described as the RESULT INTERRUPT_STATUS_GPIO. This register does not poll the GPIO pins directly. Reading a value of 0b100 from bits[2:0] means that a range measurement is complete and the VL6180X is ready for another command. Reading a value of 0b000 means the device is still busy with the current measurement. 11. Register 0x0062 is described as the RESULT RANGE_VAL register. The value read from this register is in millimeter units. 12. Register 0x0014 is described as the SYSTEM INTERRUPT_CONFIG_GPIO. By setting bits [5:3] to 0b100, this enables the ALS function interrupt within the device, not externally on the GPIO1 or GPIO0 pins. 13. Register 0x0040 is described as the SYSALS INTEGRATION_PERIOD register. This is a two byte register that is set to 50ms in this example. It is important to note that a value of 0x00 in register 0x0040 means 1ms integration time. As a result, the value required in millisecond should be subtracted by a value of 1. 14. Register 0x0038 is described as the SYSALS START register. Writing a 1 to bit[0] starts a single shot ALS measurement. 15. Register 0x004F is described as the RESULT INTERRUPT_STATUS_GPIO. This register does not poll the GPIO pins directly. Reading a value of 0b100 from bits[5:3] means that a ALS measurement is complete and the VL6180X is ready for another command. 16. Register 0x0050 is described as the RESULT ALS_VAL register. This is a 2 byte register and the value read is in Lux/count. The user must then apply the calibration count/lux value and divide by the ALS gain value to achieve the appropriate Lux value. See the examples section for more details. 17. Register 0x0015 is described as the SYSTEM INTERRUPT_CLEAR register and writing 0b111 to bits[2:0] will clear the interrupt status. This will ensure that the correct range or ALS measurement is read back to the HOST processor. Range Measurement Example If the device is setup as shown in Figure 3 the following example below gives an output example of what should be read from the device. Assuming there is a piece of white or gray material located at 50mm above the device and a single shot measurement is started, the example below shows how to interpret the value read. When single shot measurement is complete, the value is read from the RESULT RANGE_VAL register (0x0062) = 0x32. Converting this hex value to decimal, the resulting value is 50mm. July 2014 DT0037 Rev 1 5/9

ALS Measurement Example If the device is setup as shown in Figure 3 the following example below gives an output example of what should be read from the device. Assuming there the device is in a 200lux environment, by starting a single shot ambient light measurement, the example below shows how to interpret the value read. When ambient light measurement is complete, the value is read from the RESULT ALS_VAL register (0x0050) = 0x01 (high byte) and read from 0x0051 = 0x38 (low byte).the values read should be concatenated together giving a values of 0x0138. By converting this hex value to decimal, the resulting value is 312. Then this value should be multiplied by the ALS calibration value, 0.32 count/lux is the default value, multiplied by 100 and then divided by the gain and then divided by the ALS integration time. The equation is shown below: 312 * [ALS calibration value] * 100/ ([ALS gain] * [ALS Integration time]) = 312 * 0.32 * 100 / (1 * 50) = 199.68 Lux. The example above uses the default calibration value of the VL6180X from ST Microelectronics. If there is cover glass used on top of the VL6180X, the ALS calibration value shall be recalculated by the end user to ensure the proper lux measurement. July 2014 DT0037 Rev 1 6/9

Appendix 1: VL6180X Tuning Settings The list of commands below are the appropriate tuning settings that should be applied to the VL6180X module. These settings should be applied in this order with no substitutions. The commands below are applied top to bottom and then the next column over to the right, top to bottom. The commands are given in the following format: Writebyte(Register_Address, Value to Write) WriteByte(0x0207, 0x01); WriteByte(0x0208, 0x01); WriteByte(0x0133, 0x01); WriteByte(0x0096, 0x00); WriteByte(0x0097, 0xFD); WriteByte(0x00e3, 0x00); WriteByte(0x00e4, 0x04); WriteByte(0x00e5, 0x02); WriteByte(0x00e6, 0x01); WriteByte(0x00e7, 0x03); WriteByte(0x00f5, 0x02); WriteByte(0x00D9, 0x05); WriteByte(0x00DB, 0xCE); WriteByte(0x00DC, 0x03); WriteByte(0x00DD, 0xF8); WriteByte(0x009f, 0x00); WriteByte(0x00a3, 0x3c); WriteByte(0x00b7, 0x00); WriteByte(0x00bb, 0x3c); WriteByte(0x00b2, 0x09); WriteByte(0x00ca, 0x09); WriteByte(0x0198, 0x01); WriteByte(0x01b0, 0x17); WriteByte(0x01ad, 0x00); WriteByte(0x00FF, 0x05); WriteByte(0x0100, 0x05); WriteByte(0x0199, 0x05); WriteByte(0x0109, 0x07); WriteByte(0x010a, 0x30); WriteByte(0x003f, 0x46); WriteByte(0x01a6, 0x1b); WriteByte(0x01ac, 0x3e); WriteByte(0x01a7, 0x1f); WriteByte(0x0103, 0x01); WriteByte(0x0030, 0x00); WriteByte(0x001b, 0x0A); WriteByte(0x003e, 0x0A); WriteByte(0x0131, 0x04); WriteByte(0x0011, 0x10); WriteByte(0x0014, 0x24); WriteByte(0x0031, 0xFF); WriteByte(0x00d2, 0x01); WriteByte(0x00f2, 0x01); July 2014 DT0037 Rev 1 7/9

Support material Related design support material MOB-EK2-180-01/1 Product/ system evaluation board Documentation Datasheet: VL6180X - Proximity and ambient light sensing (ALS) module Revision history Date Version Changes 9-July-2014 1 Initial release July 2014 DT0037 Rev 1 8/9

Please Read Carefully Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2014 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America July 2014 DT0037 Rev 1 9/9