DLP(R) NIRscanTM Nano EVM User's Guide User's Guide Literature Number: DLPU030B June 2015 - Revised July 2015 Contents Preface ........................................................................................................................................ 6 1 DLP NIRscan Nano Overview 1.1 1.2 2 Getting Started ................................................................................................................... 18 2.1 3 6 A B C 2 NIRscan Nano GUI......................................................................................................... 3.1.1 Scanning a Sample ............................................................................................... 3.1.2 Displaying Previous Scans ...................................................................................... 3.1.3 Transferring Scans Stored in microSD Card .................................................................. 3.1.4 Utilities .............................................................................................................. 20 22 27 28 29 DLP NIRscan Nano Hardware............................................................................................... 31 .................................................................................. DLP NIRscan Nano Software................................................................................................ 5.1 Overview..................................................................................................................... 5.1.1 TI RTOS ............................................................................................................ 5.1.2 TivaWare ........................................................................................................... 5.1.3 USB Driver ......................................................................................................... 5.1.4 SDSPI Driver ...................................................................................................... 5.1.5 Bluetopia Stack .................................................................................................... 5.1.6 DLP Spectrum Library ............................................................................................ 5.1.7 DLP Spectrum Library Workflow ................................................................................ 5.2 Software System Overview ............................................................................................... 5.3 Bluetooth Client App Workflow ........................................................................................... 5.3.1 Bluetooth Client Establishing a Connection.................................................................... 5.3.2 Bluetooth Client GATT Profiles .................................................................................. iOS App............................................................................................................................. 6.1 NanoScan iOS App ........................................................................................................ Installing the DLP NIRscan Nano Software ............................................................................ A.1 DLP NIRscan Nano Software Installation ............................................................................... Required Tools to Compile Tiva Software .............................................................................. B.1 Tiva Tools Installation...................................................................................................... B.1.1 Code Composer Studio Installation ............................................................................. B.1.2 Updating TI-RTOS ................................................................................................ How to Compile Tiva Source Code ....................................................................................... C.1 Tiva Libraries Compilation ................................................................................................ C.1.1 Tiva driverlib Compilation ........................................................................................ 4.1 5 Operating Modes ........................................................................................................... 18 2.1.1 USB Connection ................................................................................................... 18 2.1.2 Bluetooth Connection ............................................................................................. 19 Operating the DLP NIRscan Nano EVM ................................................................................. 20 3.1 4 ................................................................................................ 8 Introduction ................................................................................................................... 8 What is the DLP NIRscan Nano EVM? ................................................................................... 8 1.2.1 Optical Engine ....................................................................................................... 9 1.2.2 DLP NIRscan Nano Electronics ................................................................................. 12 1.2.3 Connections ........................................................................................................ 14 External Power Supply Requirements Contents 31 35 35 35 36 36 36 36 37 37 39 40 40 41 45 45 48 48 49 49 49 49 51 51 51 DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated www.ti.com C.2 C.3 D Tiva EEPROM .............................................................................................................. 54 DLP NIRscan Nano Connectors............................................................................................ 55 F.1 F.2 F.3 F.4 F.5 G NIRscan Nano GUI......................................................................................................... 53 D.1.1 Compiling the DLP Spectrum Library ........................................................................... 53 D.1.2 Compiling NIRscan Nano GUI ................................................................................... 53 Tiva EEPROM Contents ....................................................................................................... 54 E.1 F 51 51 51 52 Required Tools to Compile NIRscan Nano GUI....................................................................... 53 D.1 E C.1.2 Tiva usblib Library ................................................................................................. C.1.3 DLP Spectrum Library ............................................................................................ Tiva Main Source ........................................................................................................... Project Settings ............................................................................................................. Battery Connector .......................................................................................................... Battery Thermistor Connector ............................................................................................ Expansion Connector ...................................................................................................... JTAG Connector ............................................................................................................ Trigger Connector .......................................................................................................... 55 55 55 56 56 DLP NIRscan Nano Command Description ............................................................................ 58 G.1 Command Handler Supported Commands ............................................................................. 58 H DLP NIRscan Nano USB Communications ............................................................................. 62 I DLP NIRscan Nano Bluetooth Communications ..................................................................... 65 I.1 I.2 Bluetooth Communications ............................................................................................... 65 I.1.1 GATT Supported Services ....................................................................................... 65 Bluetooth Packets .......................................................................................................... 71 Revision B History ....................................................................................................................... 72 Revision A History ....................................................................................................................... 72 DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Contents Copyright (c) 2015, Texas Instruments Incorporated 3 www.ti.com List of Figures DLP NIRscan Nano Evaluation Module 1-1. DLP NIRscan Nano Block Diagram ....................................................................................... 9 1-2. DLP NIRscan Nano Optical Engine ...................................................................................... 10 1-3. DLP NIRscan Nano Dimensions ......................................................................................... 11 1-4. DLP NIRscan Connectors (Rear View) .................................................................................. 14 1-5. DLP NIRscan Connectors (Front View) ................................................................................. 15 1-6. DLP NIRscan Nano Button Locations ................................................................................... 16 1-7. DLP NIRscan Nano LED Locations ...................................................................................... 17 3-1. DLP NIRscanNano GUI Information Screen ............................................................................ 21 3-2. DLP NIRscanNano GUI Scan Screen ................................................................................... 22 3-3. DLP NIRscanNano GUI Scan Configuration Dialog ................................................................... 24 3-4. DLP NIRscan Nano GUI Scan Select Menu ............................................................................ 25 3-5. Absorbance Spectrum of Aspirin ......................................................................................... 26 3-6. Displaying Previous Scans ................................................................................................ 27 3-7. Number of Scans Detected on microSD Card.......................................................................... 28 3-8. 3 Scans Transferred from microSD Card ............................................................................... 29 3-9. DLP NIRscan Nano GUI Uitlities Screen ................................................................................ 30 4-1. DLP NIRscan Nano Power Block Diagram ............................................................................. 32 4-2. DLP NIRscan Nano Tiva Connections 4-3. DLP NIRscan Nano Tiva Connections to DLPC150 Controller Board .............................................. 34 5-1. ............................................................................. ................................................... DLP Spectrum Library Decode Scan Results Workflow .............................................................. DLP Spectrum Library Compute Reference Workflow ................................................................ DLP Spectrum Library Compute and Display Reflectance Workflow ............................................... DLP Spectrum Library Compute and Display Absorbance ........................................................... DLP NIRscan Nano Software Block Diagram .......................................................................... Bluetooth Low Energy Connection Workflow ........................................................................... GATT Calibration Service Workflow ..................................................................................... GATT Scan Configuration Service Workflow ........................................................................... GATT Scan Data Service Workflow ..................................................................................... GATT Scan Data Service Workflow to Display an Existing Scan or Performing a New Scan ................... NanoScan Main Screen ................................................................................................... NanoScan Scan Screen ................................................................................................... NanoScan Scan Plot Screen ............................................................................................. USB HID Protocol .......................................................................................................... 5-2. 5-3. 5-4. 5-5. 5-6. 5-7. 5-8. 5-9. 5-10. 5-11. 5-12. 6-1. 6-2. 6-3. H-1. 4 .................................................................................. 1. .................................................................................. 6 33 DLP NIRscan Nano Software Architecture 35 DLP Spectrum Library View Configuration Information Workflow 37 List of Figures 38 38 38 39 40 40 41 42 43 44 45 46 47 62 DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated www.ti.com List of Tables 1-1. DLP NIRscan Nano EVM Specifications ................................................................................ 11 1-2. DLP NIRscan Nano Electronics .......................................................................................... 13 1-3. DLP NIRscan Nano Connectors.......................................................................................... 14 1-4. DLP NIRscan Nano LED Indicators...................................................................................... 17 3-1. Typical Scan Configuration Parameters ................................................................................. 23 E-1. Tiva EEPROM .............................................................................................................. 54 F-1. Battery Power Connector (Tiva J6) ...................................................................................... 55 F-2. Battery Thermistor Connector (Tiva J7) ................................................................................. 55 F-3. Expansion Connector (Tiva J3)........................................................................................... 56 F-4. ARM Cortex 10-pin JTAG Connector (Tiva J4) F-5. G-1. I-1. I-2. I-3. I-4. I-5. I-6. I-7. ........................................................................ Trigger Connector (DLPC150 J500) ..................................................................................... DLP NIRscan Nano Supported Commands ............................................................................ Device Information Service (DIS) ........................................................................................ Battery Service (BAS) ..................................................................................................... GATT General Information Service ...................................................................................... GATT Date and Time Service ............................................................................................ GATT Calibration Information Service ................................................................................... GATT Scan Configuration Information Service ......................................................................... GATT Scan Data Information Service ................................................................................... DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback List of Tables Copyright (c) 2015, Texas Instruments Incorporated 56 57 58 66 66 67 68 68 69 69 5 Preface DLPU030B - June 2015 - Revised July 2015 Read This First About This Guide The DLP(R) NIRscanTM Nano EVM is a third-party implementation of the next generation DLP reference design to enable faster development cycles for mobile spectrometer applications. This guide is an introductory document for the DLP NIRscan Nano EVM that provides an overview of the system and the system software. Figure 1. DLP NIRscan Nano Evaluation Module NIRscan, Tiva, TivaWare, SimpleLink, Code Composer Studio are trademarks of Texas Instruments. DLP is a registered trademark of Texas Instruments. ARM is a registered trademark of ARM Limited. Apple, iPhone, iPad are registered trademarks of Apple Inc. Bluetooth is a registered trademark of Bluetooth SIG. Windows is a registered trademark of Microsoft Corporation. All other trademarks are the property of their respective owners. 6 Read This First DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Related Documentation from TI www.ti.com Related Documentation from TI * * * * * * * * * * DLP2010NIR data sheet: DLP 0.2 WVGA Near-Infrared DMD, DLPS059 DLPC150 data sheet: DLPC150 DLP Digital Controller for Advanced Light Control, DLPS048 DLPC150 programmer's guide: DLPC150 Programmer's Guide User's Guide, DLPU031 DLP design guide: DLP Spectrometer Design Considerations, DLPA049 TivaTM TM4C1297 data sheet: Tiva TM4C1297NCZAD Microcontroller Data Sheet SPMS435 TivaWareTM USB library: TivaWare USB Library User's Guide, SPMU297 TivaWareTM peripheral driver library: TivaWare Peripheral Driver Library User's Guide, SPMU298 TI-RTOS 2.10: TI-RTOS 2.10 User's Guide, SPRUHD4 CC2564MODN data sheet:CC2564MODN Bluetooth(R) Host Controller Interface Module, SWRS160 ADS1255 data sheet:Very Low Noise, 24-Bit Analog-to-Digital Converter Data Sheet, SBAS288 If You Need Assistance Search the DLP and MEMS TI E2E Community Support forums. Search the TM4C Microcontrollers TI E2E Community Support forums. Search the Bluetooth(R) CC256x TI E2E Community Support forums. Search the SimpleLinkTM Bluetooth(R) CC256x Wiki. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Read This First Copyright (c) 2015, Texas Instruments Incorporated 7 Chapter 1 DLPU030B - June 2015 - Revised July 2015 DLP NIRscan Nano Overview 1.1 Introduction The DLP(R) NIRscan NanoTM EVM is a complete evaluation module to design a high performance, affordable near-infrared portable spectrometer. This flexible tool contains everything a designer needs to start developing a DLP-based spectrometer right out of the box. DLP technology enables handheld spectral analyzers for use in the food, pharmaceutical, oil and gas, medical, security, and other emerging industries to deliver lab performance levels in the field. The EVM contains the DLP2010NIR digital micromirror device, DLPC150 digital controller, and DLPA2005 integrated power management components. This technology brings together a set of components providing an efficient and compelling spectroscopy system solution for: * Portable process analyzers * Ultra-mobile spectrometer The new DLP2010NIR DMD is optimized for operation at wavelengths between 700 and 2500 nm. The DLP NIRscan Nano EVM is one possible implementation of this new DLP technology, operating from 900 to 1700 nm. 1.2 What is the DLP NIRscan Nano EVM? The DLP NIRscan Nano EVM is a complete NIR spectrometer EVM using DLP technology. The EVM package includes: * Near-infrared optomechanical spectrometer engine optimized for 900 to 1700 nm wavelength range: - Reflective illumination module with two integrated infrared lamps - 1.69-mm x 0.25-mm input slit - Collimating lenses - 885-nm long wavepass filter - Reflective diffraction grating - Focusing lenses - DLP2010NIR DMD (0.2-inch WVGA, 854 x 480 orthogonal pixel, NIR optimized) - Collection optics - 1-mm single-pixel InGaAs non-cooled detector * Electronics subsystem with the electronics consisting of four boards: - Microcontroller board * Tiva TM4C1297 microprocessor for system control operating at 120 MHz * 32MB SDRAM for pattern storage * Power management with Lithium-polymer or Lithium-ion battery charging circuits using bq24250 * CC2564MODN Bluetooth Low Energy module for Bluetooth 4.0 connectivity * USB micro connector for USB connectivity * microSD card slot for external data storage * HDC1000 humidity and temperature sensor - DLP controller board * DLPC150 DLP controller * DLPA2005 integrated power management circuit for DMD and DLP controller supplies 8 DLP NIRscan Nano Overview DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated What is the DLP NIRscan Nano EVM? www.ti.com * Constant current lamp driver based on OPA567 and monitored by INA213 - Detector board * Low-noise differential amplifier circuit * ADS1255 30 kSPS analog-to-digital converter (ADC) with SPI * TMP006 thermopile sensor for detector and ambient temperature measurement * 1-mm non-cooled Hamamatsu G12180-010A InGaAs photodiode - DMD board * DLP2010NIR near-infrared digital micromirror device Figure 1-1 shows the NIRscan Nano hardware block diagram. Microcontroller Board ARM 10pin header SSSI3 Microprocessor TM4C129 UART4 Exp Conn SSI0 USB Power USB Slave I2C9 charging Scan/BT Pair EPI0 SDRAM AS4C16M16S (32MB) I2C6 Hum & Temp Sensor HDC1000 SSI1 SSI2 I2C2 Sample Reflective Module I2C7 24bit RGB DLP Controller Board Flash SPI Battery Charger Buttons On/Off Scan GPIOs JTAG On/Off UART3 Bluetooth LEDs Bluetooth CC2564MODN I2C Triggers DMD Board 24bit RGB LVDS D D NIR DM 010 2 LP 24-bit ADC ADS1255 DLP Controller DLPC150 PMIC DLPA2005 DMD Flex Power Management TPS63036 TPS81256 TPS82671 TPS386596 TPS22904 SPI SPI Ctrl Ctrl ng ati Gr Amplifier OPA2376 IR Temp TMP006 InGaAs Detector Thermistor BQ24250 Amp OPA350 2.5V Ref *Thermistor Not Included REF5025 T Detector Board Li-Polymer Battery* SENS Lamp Driver *Battery Not Included TPS81256 INA213 LEGEND Logic Processor Power Interface ADC/DAC RF/IF Clocks Amplifier Others OPA567 Figure 1-1. DLP NIRscan Nano Block Diagram 1.2.1 Optical Engine The DLP NIRscan Nano EVM spectrometer optical engine is mounted on top of the electronics subsystem. The configuration is a post-dispersive architecture with a removable reflectance sample module. The reflectance module includes two lens-end broadband tungsten filament lamps. In this specific implementation, depicted in Figure 1-2, a sample is placed against the sapphire front window of the reflectance head. During a scan, the sample absorbs a specific amount of NIR light and diffusely reflects the non-absorbed light into the system. The amount of light absorbed at each wavelength is dependent on the molecular makeup of the material, and is specific to that material, a chemical fingerprint. The light diffusely reflected from the sample is gathered by the collection lens and focused into the optical engine DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Overview Copyright (c) 2015, Texas Instruments Incorporated 9 What is the DLP NIRscan Nano EVM? www.ti.com through the input slit. The slit size is chosen to balance wavelength resolution with SNR of the spectrometer. This spectrometer uses a 25-m wide by 1.69-mm tall slit. The light that passes through the slit is collimated by the first set of lenses, passes through an 885-nm long wavepass filter, and then strikes a reflective grating. This grating, in combination with the focusing lens, disperses the light into its constituent wavelengths. The focusing lenses form an image of the slit at the DLP2010NIR DMD. Different wavelengths of this slit image are spread horizontally across the DLP2010NIR DMD. The optical system images 900-nm wavelengths to one end of the DMD and 1700-nm to the other end, with all other wavelengths dispersed in between. When specific DMD columns are selected as on, or tilted to the +17 position, the energy reflected by the selected columns is directed through the collection optics to the single pixel InGaAs detector. All other DMD columns selected as off, or tilted to the -17 position, diverts the unselected wavelengths away from the detector optical path so as not to interfere with the selected wavelength measurement. The DLP NIRscan Nano reflectance module operates by illuminating the sample under test at an angle so that specular reflections are not collected, while gathering and focusing diffuse reflections to the slit. The illuminating lamps are designated as lens-end lamps because the front end of the glass bulb is formed into a lens that directs more light from the filament to the sample test region. The collection lens gathers collimated light from a 2.5-mm diameter region at the sample window. The size of the collection region was matched to the nominal illumination spot size created by the lens-end lamps. This requires that the sample be placed directly against the sapphire window, where the two angled light source paths intersect the collection vision cone of the lens. If the sample is shifted farther away from the window, the sample may not receive enough illumination for the system to perform an accurate scan. Collimating Lenses Wavepass Filter Grating Focusing Lenses Detector Detect or Boa Slit rd Collection Lenses m La ard p Lamp o DMD B DLP C ontrolle r Board oard rB ntrolle o c o r Mic Illumination Module Sample Window Figure 1-2. DLP NIRscan Nano Optical Engine The optical engine footprint drives the size of the DLP NIRscan Nano EVM. The NIRscan Nano EVM measures approximately 62-mm long, 58-mm wide, and 36-mm tall as shown in Figure 1-3. 10 DLP NIRscan Nano Overview DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated What is the DLP NIRscan Nano EVM? www.ti.com 36 mm 58 mm 62 mm Figure 1-3. DLP NIRscan Nano Dimensions Table 1-1 lists the specifications of the DLP NIRscan Nano EVM. Table 1-1. DLP NIRscan Nano EVM Specifications PARAMETER Supported wavelengths MIN TYP 900 Optical resolution 10 Lamp power 1.4 DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback MAX UNIT 1700 nm 12 nm W DLP NIRscan Nano Overview Copyright (c) 2015, Texas Instruments Incorporated 11 What is the DLP NIRscan Nano EVM? www.ti.com 1.2.2 DLP NIRscan Nano Electronics The DLP NIRscan Nano EVM contains the following four boards: * Microcontroller board: The Microcontroller board is the largest board in the DLP NIRscan Nano EVM. This board includes the following: - Tiva TM4C1297 microcontroller: The Tiva processor controls the whole system. The Tiva runs the TI realtime operating system (RTOS), the Bluetopia stack, and the spectroscopy software. When it receives a scan command through USB, Bluetooth, or through pressing the scan button, the Tiva streams through its LCD interface a set of unique wavelength specific patterns to the DLPC150 for display on the DMD while synchronizing the sampling of the spectrometer's ADC. An external 32MB SDRAM allows for additional code storage and stores the pattern buffer streamed to the DLPC150. - External interfaces: The Microcontroller board provides two main interfaces to the outside world: USB and Bluetooth Low Energy. To leverage the DLP NIRscan EVM platform for new product development using the Tiva processor, the microcontroller board also contains a Tiva debug JTAG port, which can be used with Code Composer StudioTM emulation software and XDS100, XDS200, or XDS560 emulators. The Microcontroller board also includes and expansion connector with SPI, UART, and GPIO capability for connection to external systems. - Battery charging circuits: An optional 3.7-V Lithium-Ion or Lithium-Polymer can be added to power the system. The on-board power management circuits of the bq24250 device take power from USB and simultaneously charge the battery if its voltage is below 4.2 V at up to 1-A charge current. The bq24250 also monitors an optional thermistor for battery temperature monitoring during charge. - microSD card connector: The microSD card connector allows additional storage for scan data when the system is not connected to a PC nor iOS device. - HDC1000 humidity and temperature sensor: Measures the humidity and temperature of the system. These values are captured with each scan. * DLP controller board: The DLPC150 controller board is the second largest board in the DLP NIRscan Nano EVM. This board includes the following: - DLPC150 controller: The DLPC150 receives the pattern data from the Tiva TM4C1297 processor over a 24-bit RGB bus. The DLPC150 decodes the pattern information and converts the information into the correct format for the DLP2010NIR DMD. The DLPC150 controls and synchronizes all the DMD signals, thereby directing each individual mirror to its desired state. - DLPA2005 PMIC: The DLPA2005 is a power management IC that controls all the supplies to the DLP2010NIR DMD and the DMD interface portion of the DLPC150 supplies. - Lamp driver circuit: To provide constant current to the near-infrared lamps, a OPA567 based power amplifier circuit regulates the current to the lamps to 280 mA at 5 V based on the voltage across a sense resistor monitored by the INA213 current shunt monitor. * Detector board: The detector board includes the following: - Transimpedance low-noise amplifier: Amplifies the signal form the InGaAs detector to the ADC. - ADS1255 ADC: Converts the amplified signal of the InGaAs detector into a 24-bit value for Tiva processing. - TMP006 thermopile sensor: Measures the InGaAs detector temperature and ambient temperature of the system. These values are captured with each scan. - 1-mm non-cooled Hamamatsu G12180-010A InGaAs photodiode * DMD board: The DMD board includes the DLP near-infrared digital micromirror. The DLP NIRscan Nano electronics contain many devices manufactured by Texas Instruments. Table 1-2 lists the main parts and their functions. 12 DLP NIRscan Nano Overview DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated What is the DLP NIRscan Nano EVM? www.ti.com Table 1-2. DLP NIRscan Nano Electronics Device Electronic Subsystem Electronics Type TM4C1297 bq24250 Microprocessor Cortex-M4 microprocessor operating at 120 MHz with integrated 1MB flash, 256K SRAM, and USB 2.0 interface. Battery charger Single cell Lithium-Ion or Lithium-Polymer battery charger with up to 1-A charge current from USB. Battery is charged in four phases: trickle charge, precharge, constant current, and constant voltage. In all charge phases, an optional battery pack thermistor monitors the battery temperature for safe charging. Bluetooth Low Energy Single chip Bluetooth 4.1 Low Energy subsystem module with host controller on-board antenna. interface module CC2465MODN HDC1000 Description Microcontroller board Sensor Low power, high accuracy temperature and humidity sensor with 14-bit resolution. TPS63036 High-efficiency buck-boost converter in wafer chip scale package supplies 3.3 V. TPS81256 High-efficiency step-up converter in microSIP package supplies 5.0 V for analog circuits. Power management TPS82671 High-efficiency step-down converter in microSIP package supplies 1.8 V. TPS386596 Quad reset supervisor TPS22904 Load switch supplies 1.8 V for Bluetooth circuits. DLPC150 DLPA2005 DLP DLP controller board DLP power management DLP digital controller for advanced light control. The Tiva microprocessor in conjunction with the DLPC150 controls individual DLP2010NIR micromirrors to reflect specific wavelengths of light to a single point InGaAs detector. DLP power management integrated circuit that powers the DLP 1.8-V, 10-V, 18-V, and -14-V supplies. High efficiency step-up converter in microSIP package that supplies the 5 V for the lamp driver TPS81256 Power management OPA567 Power amplifier 2-A power amplifier that supplies 280-mA lamp current. INA213 Analog monitor Voltage output, current-shunt monitor that monitors lamp current. ADS1255 Analog Very-low-noise 24-bit analog-to-digital converter. Converts the analog output of the InGaAs detector into a 24-bit digital value. REF5025 Power management Low-noise, very-low-drift, precision voltage reference that provides the 2.5-V reference for the transimpedance amplifier. OPA2376 Detector board Precision amplifier OPA350 TMP006 DLP2010NIR Sensor DMD board DLP Low-noise precision operational amplifier. Used as a transimpedance amplifier for the InGaAs detector. High-speed operation amplifier that buffers the 2.5-V reference voltage of the transimpedance amplifier. Infrared thermopile sensor that measures ambient and detector temperature DLP near-infrared digital micromirror DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Overview Copyright (c) 2015, Texas Instruments Incorporated 13 What is the DLP NIRscan Nano EVM? www.ti.com 1.2.3 Connections Table 1-3 lists the DLP NIRscan Nano connectors with its locations shown in Figure 1-4 and Figure 1-5. Table 1-3. DLP NIRscan Nano Connectors BOARD SCHEMATIC LABEL Microcontroller board DESCRIPTION J1 Micro-USB connector: Provides power and PC connectivity with HID commands J2 Detector board interface: Provides Tiva's SSI1 connection to ADS1255 and Tiva's I2C7 to TMP006 J3 Expansion connector: Provides TIva's UART4 or SSI0 interface to external device. UART4 is used as Tiva's console output for debugging information J4 JTAG connector: ARM Cortex 10-pin emulation (XDS100, XDS200, or XDS560) connection J6 Lithium-Ion or Lithium-Polymer battery connection J7 Battery thermistor connection J500 Trigger connector. This connector is covered by the top cover. Access to this connector requires to removal of the Microcontroller and DLP controller boards from the optical engine J501 Lamp photodetector connector J503 Lamp power connector DLP controller board Lamp microSD Lamp Photodetector Detector USB Battery Thermistor Battery Figure 1-4. DLP NIRscan Connectors (Rear View) 14 DLP NIRscan Nano Overview DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated What is the DLP NIRscan Nano EVM? www.ti.com JTAG Expansion Figure 1-5. DLP NIRscan Connectors (Front View) DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Overview Copyright (c) 2015, Texas Instruments Incorporated 15 What is the DLP NIRscan Nano EVM? 1.2.3.1 www.ti.com Buttons The DLP NIRscan Nano EVM includes three buttons: * Wake button: - When the system is in standby, pressing the Wake button will wake the system from hibernation mode. - Upon wake up, the green LED will pulse on and off. * Scan/Bluetooth button: - When pressed and released, the system performs a scan. During a scan, the yellow LED is illuminated and the lamps will turn on for the duration of the scan. - When pressed, held for more than 3 seconds, and then released, the Bluetooth subsystem powers up and advertises a connection. While a Bluetooth Low Energy connection is advertised, the blue LED will turn on. When a Bluetooth Low Energy connection is active, the blue LED will pulse off and on. The pulsing may coincide with the green LED or may pulse opposite to the green LED pulses. * Reset button: - Pressing the Reset button will initiate a hardware reset of the NIRscan Nano system. Sample Window Scan / Bluetooth Button Reset Button Wake Button Figure 1-6. DLP NIRscan Nano Button Locations 16 DLP NIRscan Nano Overview DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated What is the DLP NIRscan Nano EVM? www.ti.com 1.2.3.1.1 LEDs The DLP NIRscan Nano EVM includes four LEDs to indicate activity as shown in Table 1-4. Table 1-4. DLP NIRscan Nano LED Indicators LED Green CONDITION DESCRIPTION Pulse on and off, once a second Indicates system is powered and active ON Bluetooth circuits are active and advertizing Pulse on and off, once a second Bluetooth Low Energy connection has been established Blue Yellow ON Scan is being performed Red ON System is charging a battery Battery Charging LED Scan LED Bluetooth LED Power On LED Figure 1-7. DLP NIRscan Nano LED Locations DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Overview Copyright (c) 2015, Texas Instruments Incorporated 17 Chapter 2 DLPU030B - June 2015 - Revised July 2015 Getting Started 2.1 Operating Modes The DLP NIRscan Nano supports the following modes of operation: * USB connection: A Windows(R) application with a graphical user interface (GUI), running on a PC with the Windows 7 or 8 operating system, controls the system. Control includes scan initiation, parameter settings, and data download. The PC GUI displays the intensity or absorbance of the scan. The PC powers the NIRscan Nano through the USB cable. * Bluetooth connection: An iOS app (available from KS Technologies through the Apple(R) App StoreSM) running on an iPhone(R) or iPad(R) with iOS 7.1 or later operating system controls the system. Control includes scan initiation, parameter settings, and downloading data. The iOS app displays the intensity or absorbance of the scan. A USB cable or optional battery powers the NIRscan Nano. * Standalone: The NIRscan Nano can be preconfigured through the PC GUI or Bluetooth iOS app. Scans are invoked through the Scan button and data is stored on the on-board SDRAM or microSD card. The stored scan data can be later downloaded to a host PC through USB or Bluetooth connection. 2.1.1 USB Connection When a USB cable is inserted into the DLP NIRscan NanoJ1 micro-USB connector (see Figure 1-4), the system powers up from the PC's USB VBUS 5-V supply, and the power-on LED pulses to indicate the system is operational and ready for a command. The PC GUI will show as connected after the DLP NIRscan Nano enumerates through USB. 2.1.1.1 NIRscan Nano GUI The DLP NIRscan Nano software includes a QT-based PC GUI called NIRscanNanoGUI.exe. This GUI requires the following dynamic link libraries (DLLs) to reside in the same directory as the executable file: * hidapi.dll -- USB human interface device (HID) class communication driver * icudt53.dll -- Qt Creator v5.3 Unicode library * icuin53.dll -- Qt Creator v5.3 Unicode library * icuuc53.dll -- Qt Creator v5.3 Unicode library * libgcc_sdw2-1.dll -- GCC library * libstdc++6.dll -- Standard C++ library * libwinpthread-1.dll -- Pthreads for Windows library * Qt5Core.dll -- Qt Core class library * Qt5Gui.dll -- Qt Graphical User Interface class library * Qt5Svg.dll -- Qt Scalable vector graphics class library * Qt5Widgets.dll -- Qt Widgets class library * platforms/qwindows.dll -- Platform plugin for Windows applications * lmdfu.dll -- Tiva USB device firmware upgrade * lmusb.dll -- Tiva USB driver The Qt windeployqt executable will list all the DLLs necessary by a Qt application. 18 Getting Started DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Operating Modes www.ti.com 2.1.2 Bluetooth Connection To connect to the DLP NIRscan Nano, the Bluetooth circuits must first be powered. The following steps activate the Bluetooth circuits: 1. Press the Scan/Bluetooth button and hold it for more than 3 seconds to power the Bluetooth circuits. 2. After the Bluetooth circuits are powered and active, the blue LED turns on and the DLP NIRscan Nano advertises its presence through Bluetooth. 3. Run the iOS App and click the Scan button at the top-right of the screen. This will establish a connection with the DLP NIRscan Nano. The Bluetooth icon on the top-right of the screen will flash. 4. After the DLP NIRscan Nano establishes connection, the blue LED will pulse to indicate that the connection was successful. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Getting Started Copyright (c) 2015, Texas Instruments Incorporated 19 Chapter 3 DLPU030B - June 2015 - Revised July 2015 Operating the DLP NIRscan Nano EVM 3.1 NIRscan Nano GUI Upon execution of the NIRscanNanoGUI.exe, the software checks for the DLP NIRscan Nano EVM enumerating through USB and displays the information screen shown in Figure 3-1. The GUI is divided into two sections: * The top section displays the connected state of the DLP NIRscan Nano EVM on the top-right side. It also has four buttons: - Information: Changes the bottom portion of the GUI to display version information, and links to online resources. - Scan: Changes the bottom portion of the GUI to display spectrum plots and controls for scan configurations and parameters. - Utilities: Changes the bottom portion of the GUI to display sensor information and to synchronize data and time with PC, ADC PGA settings, and firmware upgrades. - Connected Status Button: Once a DLP NIRscan Nano enumerates, the icon in the connected status button will change from a gray indicator light with a "Not Connected" message to a green indicator light with a "Connected" message. Pressing this button has no effect. Disconnecting the DLP NIRscan Nano, powering down the device, or resetting the DLP NIRscan Nano will toggle the state of this button. * The lower section displays information related to the three main operational modes: information, scan, and utilities. 20 Operating the DLP NIRscan Nano EVM DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated NIRscan Nano GUI www.ti.com Figure 3-1. DLP NIRscanNano GUI Information Screen The information screen displays: * Version information, including the version number of the Tiva and DLPC150 firmware, as well as the GUI software version number. * EVM image, which displays the locations of the buttons and their functionality. * Links to online resources, including Texas Instruments DLP brochures, white papers, and application notes on spectroscopy with DLP technology. For support, users can search TI's E2E Community. The TI E2E icon includes a link to direct users to the Texas Instruments DLP E2E forums. * Presence of microSD card by clicking the Refresh button. Under this button, the "Import all Unread scan Data" buttons transfer any scan data residing on the microSD card to the PC. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Operating the DLP NIRscan Nano EVM Copyright (c) 2015, Texas Instruments Incorporated 21 NIRscan Nano GUI www.ti.com 3.1.1 Scanning a Sample The Scan button at the top of the NIRscan Nano GUI displays spectrum plots and controls scan configurations and parameters, as shown in Figure 3-2. Figure 3-2. DLP NIRscanNano GUI Scan Screen A scan configuration must be created to scan a sample. (See Figure 3-3 for the Scan Configuration dialog screen.) A scan configuration specifies the following parameters of a scan: * Wavelength range: Start and End wavelengths (in nm) or spectral range of interest for the scan. The minimum wavelength is 900 nm and the maximum wavelength is 1700 nm. * Width in nm: This number must be greater than 8 nm and corresponds to the desired smallest wavelength content that you want to resolve in a scan. The DLP NIRscan Nano optical resolution is 10 nm, so values less than 10 nm result in lower signal intensity. * Number of patterns: This number defines how many wavelength points are captured across the defined spectral range. Depending on the previous setting, the GUI computes the maximum number of patterns and indicates them as the "Max Limit." * Number of scans to average: This is the repeated back-to-back scans that are averaged together. Typical scan configuration parameters for four type of scans that resolve wavelength content in 20-, 15-, 10-, and 8-nm, are shown in Table 3-1. 22 Operating the DLP NIRscan Nano EVM DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated NIRscan Nano GUI www.ti.com Table 3-1. Typical Scan Configuration Parameters SCAN CONFIGURATION PARAMETERS Wavelength range 20-nm CONTENT 15-nm CONTENT 10-nm CONTENT 900 to 1700 nm 900 to 1700 nm 900 to 1700 nm 8-nm CONTENT 900 to 1700 nm 900 to 1700 nm Width in nm 20 15 10 8 8 Number of patterns 80 108 160 225 248 Oversampling 2 2 2 2.25 2.48 Number of scans to average 18 12 8 to 9 6 5 The following steps create a scan configuration: 1. Click the "New/Edit/Export/Import" button in the Scan control box to invoke the Scan Configuration dialog box. 2. The Scan Configuration dialog box shown in Figure 3-3 has three sections: * The top-left section displays previous scan configurations saved to the PC. * The top-right section displays the scan configurations saved on the DLP NIRscan Nano EVM. * The bottom section displays the scan configuration parameters of the selected PC or DLP NIRscan Nano EVM stored scan configuration. 3. Click the New button in the top-left section of the Scan Configuration dialog. Then, type the desired spectral range between 900 and 1700 nm. 4. Select the width in nm that corresponds to the smallest wavelength content that you want to resolve. 5. Enter the desired number of wavelength points captured across the spectral range. 6. Enter the number of scans to average for corresponding back-to-back scans to average. 7. Enter a configuration name and click Save. 8. Close the Scan Configuration dialog by clicking OK. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Operating the DLP NIRscan Nano EVM Copyright (c) 2015, Texas Instruments Incorporated 23 NIRscan Nano GUI www.ti.com Figure 3-3. DLP NIRscanNano GUI Scan Configuration Dialog 24 Operating the DLP NIRscan Nano EVM DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated NIRscan Nano GUI www.ti.com After a scan configuration is defined, it appears under the Select Scan drop-down menu, as shown in Figure 3-4. Figure 3-4. DLP NIRscan Nano GUI Scan Select Menu DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Operating the DLP NIRscan Nano EVM Copyright (c) 2015, Texas Instruments Incorporated 25 NIRscan Nano GUI www.ti.com After a scan configuration is selected with the drop-down, define a reference by scanning a reflective reference standard. Then, click the Set as Reference button. After these steps, scanning any sample will allow the plot of absorbance as shown in Figure 3-5. Figure 3-5. Absorbance Spectrum of Aspirin 26 Operating the DLP NIRscan Nano EVM DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated NIRscan Nano GUI www.ti.com 3.1.2 Displaying Previous Scans To display previous scans, click the Scans button under the Texas Instruments logo. A sub-window will pop up displaying the previous scans stored in the PC. The files are stored with the name of the scan configuration appended with the date and time of the scan. To plot a file as shown in Figure 3-6, select one of the files and click the Display Spectrum button. Click the Hide button to hide this subwindow. Figure 3-6. Displaying Previous Scans DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Operating the DLP NIRscan Nano EVM Copyright (c) 2015, Texas Instruments Incorporated 27 NIRscan Nano GUI www.ti.com 3.1.3 Transferring Scans Stored in microSD Card Whenever scans are taken by pressing the Scan button on the microprocessor board, the scans are stored on microSD card, if one is present. To transfer the stored scan on microSD: * On the Information Tab, under microSD card, click the Refresh button. * This will read all the scans stored on the microSD card, and will report the number of scans detected after "No. of unread scan Data", as shown in Figure 3-7. * On the Scan tab, click the Scans button in the upper-right corner to display the previous scans. Scans transferred from the microSD card will be listed with filenames starting with "scan" followed by a four digit number, as shown in Figure 3-8. Figure 3-7. Number of Scans Detected on microSD Card 28 Operating the DLP NIRscan Nano EVM DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated NIRscan Nano GUI www.ti.com Figure 3-8. 3 Scans Transferred from microSD Card 3.1.4 Utilities The DLP NIRscanNano GUI includes a Utilities screen, as shown in Figure 3-9, that displays: * Sensor data: - Battery voltage, if a Lithium-Ion or Lithium polymer single cell battery is connected to J6 connector. - Ambient temperature read by the TMP006 in the Detector Board. - Detector temperature read by the TMP006 in the Detector Board. - Ambient humidity read by the HDC1000 in the Microcontroller Board. - HDC temperature read by the HDC1000 in the Microcontroller Board. - Tiva internal temperature read by the Tiva internal sensor in the microcontroller board. * Tiva's hibernation module date and time. Pressing the "Sync Data/Time" button will read the PC's date and time and store it in the Tiva hibernation module's date and time registers. * DLPC150 Firmware update tool. - To update the DLPC150 firmware, click the Browse button to search for the DLPC150 firmware file (for example, C:\ti\DLPR150PROM_1.0.0.img). - Then, click the Update DLPC150 Firmware button. The firmware will be flashed to the board while DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Operating the DLP NIRscan Nano EVM Copyright (c) 2015, Texas Instruments Incorporated 29 NIRscan Nano GUI * * www.ti.com the progress bar indicates the update process. Tiva Firmware update tool. - To update the Tiva firmware, click the Browse button to search for the Tiva firmware file (for example, C:\ti\DLPNIRscanNanoSoftware_1.0.0\Binaries\NIRscanNano.bin). - Then, click the Update TIVA Firmware button. The firmware will be flashed on the Tiva internal Flash while the progress bar indicates the update process. Detector board's ADS1255 PGA setting. Figure 3-9. DLP NIRscan Nano GUI Uitlities Screen 30 Operating the DLP NIRscan Nano EVM DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Chapter 4 DLPU030B - June 2015 - Revised July 2015 DLP NIRscan Nano Hardware 4.1 External Power Supply Requirements The DLP NIRscan Nano is powered from either a battery or a USB cable. The power requirements are: * USB Cable: - Voltage: 4.75 to 5.25 V - Current Maximum: 560 mA when operating and 1 A when charging - Cable: 3 ft, USB A male to micro-USB B male (cable not included) - Digi-Key Part Number: Q853-ND - Manufacturer: Qualtek - Part Number: 3025010-03 * Battery: (Not Included) - Single-Cell Lithium-Polymer UL certified battery * Voltage: 3.7 V * Capacity: 1700 mA * Manufacturer: Tenergy * Part Number: 103450 NOTE: Only connect Tenergy 103450 Lithium Polymer UL certified battery or equivalent UL certified battery that meets: maximum charge current of 1A or more, maximum charging voltage of 4.23V or higher, battery over voltage protection at 4.305V or higher, and battery under voltage lockout at 2.5V or less. If a battery is connected to the NIRscan Nano, a thermistor is required to safely charge the battery and monitor its temperature. The battery thermistor requirements are: * Battery Thermistor: (Not Included) - 10-k NTC thermistor * Manufacturer: Murata * Part number: NXRT15XH103FA1B040 * Digi-Key part number: 490-7167-ND Figure 4-1 shows a block diagram of the power circuits. The main power input is the external battery and USB connector. The bq24250 includes a single-cell battery charger and a highly efficient DC-DC converter to regulate the system voltage at 3.52 V. With an optional thermistor, the bq24250 monitors the temperature of the battery during charging. Note that a thermistor is required to charge the battery. The battery charger is set to supply up to a 1-A current during charging. The rest of the devices regulate power to the subsystem as follows: * The DLPA2005 in the DLP controller board regulates the power to the DLP2010NIR and DLPC150. * The TPS82671 in the microcontroller board regulates the 1.8-V supply used by the Bluetooth subsystem CC2564MODN. To conserve power, a TPS22904 load switch turns off the 1.8-V supply to the Bluetooth subsystem when not in used. * The TPS630636 in the microcontroller board supplies the main 3.3 V for the microprocessor and interface inputs and outputs to DLPC150, CC2564MODN, and Tiva microprocessor. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Hardware Copyright (c) 2015, Texas Instruments Incorporated 31 External Power Supply Requirements www.ti.com * The TPS81256 in the microcontroller board regulates the 5-V supply of the analog-to-digital converter (ADS1255), transimpedance amplifiers circuits (OPA350 and OPA2276), and 2.5-V reference voltage (REF5025) used in the detector board. * A second TPS81256 in the DLP controller board regulates the 5-V supply for the lamp driver (OPA567 and INA213). The lamp driver drives two parallel lamps at 5 V and 280 mA. Each lamp is rated to a maximum 140 mA at 5 V. * The TPS386596 serves as reset supervisor to hold the system in reset whiles all the supplies reach operational conditions. An external reset button issues a reset when the system has reached operational conditions. For detailed connections of these devices, refer to the DLP NIRscan Nano schematics. DLPA2005 Tiva PJ7 VLED LS PROJ_ON VINC VDDLP12 VDD_PLL VINL BQ24250 IN 274k 107k VINR SW4 VINM VCORE RESETZ INTZ P1P1V VDD_PLLM (6 mA) VDD_PLLD (6 mA) LS_OUT VRST VBIAS VOFS P1P8V_SW RESETZ PARKZ VCC18 (12.62 mA) VINA LS_IN VDPM (4.36V) Tiva PJ7 PROJ_ON ILM (1A) 150 VIN SYS TPS82671 (600 mA) VCC_FLSH (1.0 mA) VCC_INTF (1.5 mA) CC2564MODN P1P8V TPS22904 VOUT1 EN VIN Tiva PB2 3.53 - 4.2V ISET (1A) VOUT1 VDD_IN (41.2 mA) P1P8V_BT VDD_IO (1 mA) EN -14V DLP2010NIR 249 18V BAT + BAT TEMP TS BAT Conn DLPC150 PROJ_ON VDD (252.9 mA) TPS63036 (500 mA) LDO VIN 10V EN STAT (34.7mA) VDDI (9.4mA) VRESET (2 mA) VBIAS (0.4 mA) VOFFSET (1.7 mA) P3P3V VOUT1 VDD TPS386596 (Reset Sup) BAT 1.5K 28.7K EN logic charging 10K TM4C129 SENSE1 SENSE2 VBAT SENSE3 VDDA VDD (117 mA) VDDC 2.5uF VIN RESETZ RESETZ 95.3K SENSE4 Emergency Shutdown Logic to allow sufficient time for DLPA2005 to issue a Fast Park PROJ_ON RESETz INTz SYSPWR 10K VIN EN logic MRZ 100K TPS81256 (400 mA) EN logic VOUT1 ADS1255 DVDD (2 mA) RESETZ AVDD (50 mA) P5P0V EN OPA350 EN EN = SYSPWR (~PROJ _ON + ~RESETz + INTz) PROJ_ON VIN LS VOUT1 REF5025 OPA567 TPS81256 VIN (1.2 mA) VOUT1 VCC (300 mA) VCC (8.5 mA) V+ OPA2376 V+ EN VCC (1 mA) Legend Tiva PD2 LS OUT EN V- V- Power Management 0.1 DLP chipset DLP INA213 OUT V+ Analog ININ+ Figure 4-1. DLP NIRscan Nano Power Block Diagram Figure 4-2 shows the Tiva connections to the components on the microprocessor board and detector board. The Tiva uses a 16-MHz external crystal as input to its on-board PLL to run the Tiva system at 120 MHz. A 32-kHz crystal supplies the clock to the Tiva's hibernation module and Bluetooth circuits. An external 32MB of SDRAM stores the patterns that are streamed to the DLPC150 through the Tiva's LCD interface. Tiva communicates to the HDC1000 and TMP006 sensors through its I2C6 and I2C7 peripherals. Both sensors generate a DRDY signal when a new value is available. This DRDY signals interrupt Tiva when a new value is available through PP7 for HDC1000 and PP6 for TMP006. Tiva's UART3 communicates with the CC2564MODN for Bluetooth transfers. The UART3 defaults to a 115200 baud transfer rate. Tiva's PH5 enables the Bluetooth circuits. Tiva interfaces to the microSD card through 32 DLP NIRscan Nano Hardware DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated External Power Supply Requirements www.ti.com SSI3 in SPI mode. Tiva's SSI1 interfaces to the ADS1255. The ADS1255 also generates a DRDY signal when conversion is completed interrupting the Tiva processor through PP2. Tiva generates a synchronization signal to the ADS1255 through PH6 to start an ADC conversion when a pattern is displayed by the DLP2010NIR. To monitor the battery charger bq24250, PQ5 serves as a Tiva interrupt and commands are sent through I2C9. PQ0, PQ1, and PQ2 allow Tiva to override default bq24250 parameters. The Wake and Scan buttons are connected to Tiva's WAKE and PQ3 pins. To measure battery voltage, TIva enables an analog MOSFET switch with PD5 to connect the battery to Tiva's ADC7 and perform a voltage measurement. An expansion headers supports a combination of Tiva SSI0 and UART4 pins. PF5, PH7, PL4 controls the green, blue, and yellow LED, respectively. TM4C1297 BQ24250 Charging STAT EN1 EN2 CEZ PQ1 (O) PQ0 (O) PQ2 (O) INT PQ5 (I) PA0/I2C9SCL PA1/I2C9SDA SCL SDA Battery Monitor BAT_V_SW SENSE_EN microSD CLK DIN DOUT CS CARD_DET PD4/AIN7 PD5 (O) PF3/SSI3CLK PF1/SSI3XDAT0 PF0/SSI3XDAT1 PF2/SSI3FSS PQ4 (I) USB USB0_VBUS USB_ID USB_DP USB_DM PB1/USB0VBUS PB0/USB0ID PL6/USBDP PL7/USB0DM OSC1 16MHz OSC0 32.768KHz HDC1000 PB6/I2C6SCL PB7/I2C6SDA PP7 (I) SCL SDA DRDY PK5/EPI0S31 PN3/EPI0S30 PN2/EPI0S29 PB3/EPI0S28 PL3/EPI0S19 PL2/EPI0S18 PL1/EPI0S17 PL0/EPI0S16 PM0/EPI0S15 PM1/EPI0S14 PM2/EPI0S13 PM3/EPI0S12 PG0/EPI0S11 PG1/EPI0S10 PA7/EPI0S9 PA6/EPI0S8 PC4/EPI0S7 PC5/EPI0S6 PC6/EPI0S5 PC7/EPI0S4 PH3/EPI0S3 PH2/EPI0S2 PH1/EPI0S1 PH0/EPI0S0 CLK AS4C16M16 CKE CSz WEz RASz CASz DQMH DQML D15 BA1/D14 BA0/D13 A12/D12 A11/D11 A10/D10 A9/D9 A8/D8 A7/D7 A6/D6 A5/D5 A4/D4 A3/D3 A2/D2 A1/D1 A0/D0 ADS1255 CC2564MODN SLOW_CLK_IN BT_ANT HCI_CTS HCI_RX HCI_TX HCI_RTS nSUTD 10K LS PP3/RTCCLK LS PP4/U3RTS PJ1/U3TX PJ0/U3RX PP5/U3CTS LS PH5 (O) PB5/SSI1CLK PE4/SSI1XDAT0 (TX) PE5/SSI1XDAT1 (RX) PB4/SSI1FSS PH6 (O) PP2 (I) SCLK DIN DOUT CSZ SYNC DRDY TMP006 JTAG Header PC0/TCK PC1/TMS PC2/TDI PC3/TDO RESETZ Reset Expansion Header PA2/SSI0CLK/U4RX PA3/SSI0FSS/U4TX PA4/SSI0DAT0 PA5/SSI0DAT1 PK2/U4RTS PK3/U4CTS PD0/I2C7SCL PD1/I2C7SDA PP6 (I) PF5 (O) PH7 (O) PL4 (O) WAKEz (I) PQ3 (I) SCL SDA DRDRY Power Bluetooth Scan Wake Scan/BT Figure 4-2. DLP NIRscan Nano Tiva Connections DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Hardware Copyright (c) 2015, Texas Instruments Incorporated 33 External Power Supply Requirements www.ti.com Figure 4-3 shows the Tiva connections to the DLPC150 controller board. Tiva powers up the DLP subsystem through PJ7. The TIva's LCD interface is connected to the DLPC150 Parallel Port interface. Through this interface 24 patterns are transmitted per frame. DLPC150 sends two interrupts to the Tiva to indicate when a pattern is exposed (TRIG_OUT_2) and when a new frame begins (TRIG_OUT_1). For DLPC150 firmware updates, the Tiva con write to the DLPC150 serial flash through its SSI2 peripheral when the DLP subsystem is powered down. Tiva's PD2 controls the lamp. A lamp photodiode is measured by the DLPA2005 when a scan occurs. The value of the photodiode is transmitted to the DLPC150 and then to the Tiva. This photodiode measures the lamp intensity. DLPA2005 TM4C1297 PQ6 (I) LS RESETZ PJ7_O PROJ_ON OPA567 OUT LS EN DLPC150 PD2/I2C8SCL PP0 (I) PP1 (I) PD3 (O) LS PD2/I2C2SCL PG3/I2C2SDA IIC0_SCL IIC0_SDA PQ7 (I) PE0 (O) PE1 (O) PJ6/LCDAC PR0/LCDCP PR1/LCDFP PR2/LCDLP PR4/LCDDATA00 PR5/LCDDATA01 PF7/LCDDATA02 PR3/LCDDATA03 PR6/LCDDATA04 PR7/LCDDATA05 PS4/LCDDATA06 PS5/LCDDATA07 PS6/LCDDATA08 PS7/LCDDATA09 PT0/LCDDATA10 PT1/LCDDATA11 PN7/LCDDATA12 PN6/LCDDATA13 PJ2/LCDDATA14 PJ3/LCDDATA15 PJ4/LCDDATA16 PJ5/LCDDATA17 PT2/LCDDATA18 PT3/LCDDATA19 PS0/LCDDATA20 PS1/LCDDATA21 PS2/LCDDATA22 PS3/LCDDATA23 PG7/SSI2CLK PG5/SSI2XDAT0 (TX) PG4/SSI2XDAT1 (RX) PG6/SSI2FSS TRIG_OUT_2 TRIG_OUT_! TRIG_IN_1 HOST_IRQ Logic PROJ_ON RESETZ PARKZ GPIO_3 (CS) GPIO_2 (DOUT) GPIO_1 (CLK) GPIO_0 (DIN) LED_SEL DATEN_CMD CMP_PWM PCLK CMP_OUT VSYNC_WE GPIO10/RC_CHARGE HSYNC_CS PDATA3 PDATA4 PDATA5 PDATA6 PDATA7 DMD Control PDATA10 DMD Sub-LVDS PDATA11 PDATA12 PDATA13 PDATA14 PDATA15 PDATA19 PDATA20 PDATA21 PDATA22 PDATA23 PDATA2 PDATA18 PDATA1 PDATA9 PDATA17 PDATA0 PDATA8 PDATA16 SN74LVC2G125 SN74LVC1G125 RESETZ INTZ SPI_CSZ SPI_DIN SPI_CLK SPI_DOUT LED_SEL PWM_IN CMP_OUT SENS1 Photodiode SENS2 VOFS VBIAS VRST LS_OUT 0.2" TRP VDD DMD Control DMD Sub-LVDS VDDI VRESET VBIAS VOFFSET PLL_REFCLK 24MHz SPI0 SPI Flash SPI_CLK SPI_RX SPI_TX SPI_CS RESETZ Figure 4-3. DLP NIRscan Nano Tiva Connections to DLPC150 Controller Board 34 DLP NIRscan Nano Hardware DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Chapter 5 DLPU030B - June 2015 - Revised July 2015 DLP NIRscan Nano Software 5.1 Overview The DLP NIRscan Nano's Tiva microprocessor is the system's main control processor. The Tiva handles button presses, commands and data transfers over USB or Bluetooth, controls the DLP subsystem, streams the patterns to select specific wavelengths, captures data from InGaAs detector, activates lamps, and stores data in the microSD card. Due to the realtime nature of the system, the Tiva software includes TI-RTOS that coordinates tasks while handling realtime interrupts and semaphores. Low-level drivers for Tiva's USB, GPIO, EPI, I2C, LCD, SPI, and UART peripherals are handled by TivaWare libraries and routines. The Bluetopia Stack handles Bluetooth communications. DLP Spectrum Library handles pattern generation and data transformation from raw scan data to a wavelength spectrum. A command handler interprets commands from USB or Bluetooth and starts the tasks needed to execute the commands. The main application initializes the system and waits for commands from USB and Bluetooth. The overall software architecture depicting these components is shown in Figure 5-1. Tiva TM4C1297 Main Application Scan Handler DLP Spectrum Library Command Handler FAT File System TMP006 Handler USB Driver SDSPI Driver HDC1000 Handler GAP GATT Attribute Protocol L2CAP Bluetopia Stack HID Protocol CC2564MODN HCI TivaWare (Peripheral Library) HCI Link Controller RF TI RTOS Figure 5-1. DLP NIRscan Nano Software Architecture 5.1.1 TI RTOS TI RTOS is a scalable, real-time operating system that handles scheduling and synchronization of tasks, interrupts, includes a limited set of drivers, and provides hardware abstraction layer to ease application software development. The TI RTOS also includes the FAT file system (FATFs) module to store data in the microSD card. The TI RTOS drivers used by DLP NIRscan Nano are: * I2C: driver used for Tiva communication with DLPC150, TMP006, and HDC100. * SDSPI: SPI driver for Tiva communication with SDcard. * USBMSCHFatFS: driver for USB mass storage class. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Software Copyright (c) 2015, Texas Instruments Incorporated 35 Overview www.ti.com 5.1.2 TivaWare TivaWare is a set of drivers for accessing the Tiva peripherals. DLP NIRscan Nano uses the following TivaWare drivers: * UART: Driver for Tiva interface with CC2564MODN * USB: Driver for HID transfers between Tiva and PC. The USB drivers handles Tiva's USB interrupts * SPI: Driver for Tiva interface with ADS1255 * ADC: Driver to control Tiva ADC peripheral * GPIO: Driver to control Tiva GPIO pins * LCD: Driver to interface Tiva with DLPC150 parallel port 5.1.3 USB Driver USB Communication to the DLP NIRscan Nano uses the HID class. Tiva enumerates as a slave USB 2.0 high power device. Appendix G lists the commands supported through USB. 5.1.4 SDSPI Driver To store data on the microSD card, Tiva's SSI3 peripheral communicates with the microSD card using SPI mode (SDSPI). Tiva stores data on the microSD card using the file allocation table (FAT) file system. 5.1.5 Bluetopia Stack The DLP NIRscan Nano wirelessly communicates using Bluetooth Low Energy (BLE) version 4.0. The Bluetooth communication is handled by the TI Bluetopia stack and the Cc2564MODN. The TI Bluetopia stack and CC2564MODN implement a fully certified Bluetooth 4.0 specification. The BLE wireless communication uses two main profiles for discovery and communication with a remote host: * GAP: Generic Access Profile for basic discovery and establishing connections. * GATT: Generic Attribute Profile for commands and data transfer. The DLP NIRscan Nano supports Bluetooth version 4.0 specification. When Bluetooth subsystem is activated, the DLP NIRscan Nano broadcasts its availability while a smartphone, tablet or PC acts as an observer. Once connected, the DLP NIRscan Nano acts as a server for the GATT profile while the smartphone, tablet, or PC acts as a client. The DLP NIRscan Nano Bluetooth GATT Profile supports the following services: * Battery Service (BAS) to provide battery charge capacity. * Device Information Service (DIS) to provide manufacturer name, model number, serial number, hardware revision, spectrum library revision, and Tiva software revision. * GATT General Information Service to provide temperature, humidity, status, hours of use, lamp hours, and battery recharge cycles. * GATT Date and Time Service to synchronize date and time information between smartphone, tablet, or PC to the Tiva's realtime clock. * GATT Calibration Service to provide calibration coefficients. * GATT Scan Configuration Service to provide stored configurations and scan configuration data. * GATT Scan Data Service to initiate scan, clear scan data, and return stored scan data. The Tiva processor handles these profiles and uses the logical link control and adaptation protocol (L2CAP) to pass packets through a host controller interface (HCI). The Tiva's UART3 peripheral communicates with the CC2564MODN HCI module. The CC2564MODN transmits these packets to the client device. 36 DLP NIRscan Nano Software DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Overview www.ti.com 5.1.6 DLP Spectrum Library The DLP spectrum library is a collection of C-language routines that provide the fundamental pieces to use a DLP system in a spectroscopy application. The DLP spectrum library is resolution and host processor independent, allowing the routines to be used with different DMD resolutions and processor systems. The routine sources are shared by the Tiva code, the GUI code, and the iOS App. The DLP Spectrum Library are classified into three main categories: * Scan: Performing a column or Hadamard scan by: - Generating the appropriate full-frame DMD patterns based on a specific scan configuration. - Computing reflectance and absorbance data form the intensity data during a scan. - Handling serialization and deserialization of scan configuration and scan data. * Calibration: Calibrating a system at the factory by: - Finding peaks from a scan of a calibrated lamp. - Finding the full width half maximum of specific peaks data of a calibration scan. - Computing the calibration coefficients for a system. * Utilities: Utilities to handle: - Conversion between DMD mirror column position to a calibrated wavelength or wave number, and vice versa. - Spectrum data calculations, such as: absorbance, reflectance, and spectrum comparisons. - Matrix operations. - Binary pattern packing. The DLP NIRscan Nano utilizes a previously-created scan configuration (through the GUI or stored on the NIRscan Nano) to perform a scan. This scan configuration is created on the NIRscanNanoGUI and transferred to the system in serialized fashion. The system's Tiva processor deserializes this data and generates a set of full-frame DMD patterns based on the scan configuration and the factory-stored calibration data. Then, the Tiva turns on the lamps and streams the full-frame DMD patterns to perform a scan. Tiva collects several data points for each pattern from the detector's ADC conversion. This data is stored in a structure, and is then serialized and transferred to the PC through USB or Bluetooth. The NIRscanNanoGUI or the iOS App deserializes this scan data, interprets it using the DLP Spectrum Library, and plots the resulting spectrum. 5.1.7 DLP Spectrum Library Workflow The following sections show the use of the DLP Spectrum Library workflow to read scan configuration information, decode scan data, and compute reference, absorbance, and reflectance. 5.1.7.1 Scan Configuration Workflow The DLP Spectrum Library routine to interpret scan configuration information is dlpspec_scan_read_configuration(). This routine takes as input the serialized scan configuration transferred through USB or Bluetooth and deserializes to extract all the scan configuration information. Figure 5-2 shows the typical workflow to view configuration information. The white input box denotes USB scan configuration data, while the blue input box denotes Bluetooth scan configuration data. Configuration Buffer Size dlpspec_scan_read_configuration() Cast to scanConfig struct Access properties directly Configuration Figure 5-2. DLP Spectrum Library View Configuration Information Workflow DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Software Copyright (c) 2015, Texas Instruments Incorporated 37 Overview 5.1.7.2 www.ti.com Decode Scan Workflow The DLP Spectrum Library routine to interpret scan data is dlp_scan_interpret(). This routine takes as input the serialized scan data transferred through USB or Bluetooth and deserializes and extracts the intensities of each wavelength in a scan. Figure 5-3 shows the typical workflow to decode scan data. The white input box denotes USB scan data, while the blue input box denotes Bluetooth scan data. Allocate scanResults struct pointer Scan Data Buffer Size dlpspec_scan_interpret() scanResults struct (sample scan) Access properties directly, could display raw intensity if desired Scan Data Figure 5-3. DLP Spectrum Library Decode Scan Results Workflow 5.1.7.3 Compute Reference Workflow The DLP Spectrum Library routine to compute reference is dlp_scan_interpReference(). This routine takes as input the serialized reference calibration data stored on the DLP NIRscan Nano and transmitted through Bluetooth or the stored reference on the PC transmitted through USB and computes the reference intensities for each wavelength in a scan. Figure 5-4 shows the typical workflow to compute the reference. The white input box denotes USB reference data, while the blue input box denotes Bluetooth reference calibration data. Allocate scanResults struct pointer Scan Results struct (sample scan) scanResults struct (reference) dlpspec_scan_interpReference() Reference Calibration Data Figure 5-4. DLP Spectrum Library Compute Reference Workflow 5.1.7.4 Compute and Display Reflectance Workflow The DLP Spectrum Library computes the reflectance of a scan based on the scan intensities divided by the reference scan. Figure 5-5 shows the typical workflow to compute the reflectance. scanResults struct (reference) Intensity client specific. Reflectance = sample / reference Reflectance Plot Reflectance Intensity scanResults struct (sample scan) Wavelength Figure 5-5. DLP Spectrum Library Compute and Display Reflectance Workflow 38 DLP NIRscan Nano Software DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Software System Overview www.ti.com 5.1.7.5 Compute and Display Absorbance Workflow The DLP Spectrum Library computes the absorbance of a scan based on the negative of the logarithm (based 10) of the reflectance. Figure 5-6 shows the typical workflow to compute the reflectance. scanResults struct (reference) Intensity client specific. Absorbance = -log10(Reflectance) Absorbance Plot Absorbance Intensity Wavelength scanResults struct Figure 5-6. DLP Spectrum Library Compute and Display Absorbance 5.2 Software System Overview The DLP NIRscan Nano software uses a sets of tasks, hardware interrupts, and semaphores to coordinate the efforts needed to interpret USB or Bluetooth commands, respond to button presses, scan an object, and capture the InGaAs detector values. Figure 5-7 shows a high-level block diagram of the software elements of the system. The DLP NIRscan Nano system includes the following hardware interrupt handlers to respond to hardware events: * Button Interrupt Handler: Responds to Scan/Bluetooth button presses and Wake button presses. * Trigger Interrupt Handler: Synchronizes and keeps track of the pattern displayed during a scan. Two interrupts from the DLPC150 (ihFrameTrigger and ihPatternTrigger) indicate when a pattern has been displayed, when 24 patterns have completed the display, and when the DLPC150 buffer needs to be reloaded with new patterns. This handler also captures data from the ADS1255 when a pattern is displayed. It uses the ADS1255 DRDY signal to trigger the read of the just-converted value. * Display Interrupt Handler: Controls the Tiva LCD peripheral and its frame buffer that resides in external SDRAM. The frame buffer streams 24 patterns per frame to the DLPC150. The following tasks handle specific portions of the system: * USB driver: This task is part of the TivaWare USB driver and handles all USB HID transactions. The data from USB transactions is passed to the command handler task to interpret and respond to a specific set of USB commands described in Appendix G . * Bluetooth Stack: This task handles Bluetooth communication with a mobile application through the implementation of GATT profile in the Bluetopia Stack. Several semaphores control the operation: - BLEStartSem: Power-up the Bluetooth circuits and initializes the Bluetooth Stack. - BLEEndSem: Powers-down the Bluetooth circuits and gracefully closes the Bluetooth Stack. - BLECmdRecd: Coordinates the reception and processing of GATT profiles and notifies Command Handler of a new command to be processed. - BLECmdCom: Handles the response to a BLE Client's read and notify requests. - BLENotifySem: Handles the asynchronous notifications to a BLE Client's notification subscriptions. * Command Handler: Interfaces the USB and Bluetooth tasks, interprets commands, and starts the sensor read task and the scanning tasks. * Scan Handler: Controls power to the subsystems necessary to perform a scan (ADS1255, Lamp, DLPC150), manages the pattern streamed to the DLPC150, and reads sensor information during a scan. Two semaphores control the start of the scan (scanSem) and the end of a scan (endscanSem). * TMP Handler: Manages the temperature readings from the TMP006. * HDC Handler: Manages humidity and temperature readings form the HDC1000. * microSD Handler: Controls reading and writing data to the microSD card through a FAT32 file system. A semaphore (sdSem) triggers data access to the microSD card. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Software Copyright (c) 2015, Texas Instruments Incorporated 39 Bluetooth Client App Workflow * www.ti.com Idle Task: Manages the blinking of the LED and UART console transmissions to the expansion connector. GUI Display INT Handler SDRAM ihLCD HID Packets microSD Handler endscanSem USB Driver Trigger INT Handler DLPC150 ihFrameTrigger ihPatternTrigger sdSem Scan Handler ihUSB ihDRDY ADS1255 BLEStartSem scanSem BLEEndSem BLENotifySem Command Handler tmp006Sem BLECmdComp Bluetooth Stack TMP Handler TMP006 hwiTMPDRDY BLECmdRecd hdc1000Sem UART HDC Handler HDC1000 hwiHDCDRDY Idle Button INT Handler CC2564MODN LEDs BLE GATT Atrributes UART hwiSELButton hwiWAKEButton Buttons Interrupts Scan/BT Sempahore Wake Tasks Mobile App Interrupt Handler Hardware Figure 5-7. DLP NIRscan Nano Software Block Diagram 5.3 Bluetooth Client App Workflow The following sections describe a suggested workflow for the Bluetooth Client to connect and transfer data. 5.3.1 Bluetooth Client Establishing a Connection The Bluetooth Client searches for the DLP NIRscan Nano using the GAP for discovery. Once the Bluetooth Client detects a DLP NIRscan Nano, the Bluetooth Client reads the DLP NIRscan Nano advertized packets, establishing a connection. Figure 5-8 describes this process. Yes Bluetooth Client searches for DLP NIRscan Nano BLE device found? Read advertised packets Does advertised packet have local name attribute = NIRscanNano? Yes Establish connection No Yes No No BLE device found? Figure 5-8. Bluetooth Low Energy Connection Workflow 40 DLP NIRscan Nano Software DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Bluetooth Client App Workflow www.ti.com 5.3.2 Bluetooth Client GATT Profiles Once the Bluetooth Client establishes a connection with the DLP NIRscan Nano, the supported GATT profile is enumerated. DLP NIRscan Nano uses standard Bluetooth Low Energy services for Device Information (DIS) and Battery (BAS). The rest of the data transfer is through the custom GATT services and characteristics in the following sections. In the following workflow figures, blue denotes a GATT service characteristic, while red denotes a DLP Spectrum library routine. 5.3.2.1 Bluetooth Client GATT General Information Service Once the GATT General Information Service is enumerated, the Bluetooth Client can prompt DLP NIRscan Nano to read temperature and humidity values. The Bluetooth Client can set a threshold for temperature and humidity and then subscribe to the temperature and humidity threshold notification. The Bluetooth Client can also read a device and error status and then subscribe to the device and error status notifications. 5.3.2.2 Bluetooth Client GATT Date and Time Service Once the GATT Date and Time Service is enumerated, the Bluetooth Client can write the data and time values to the DLP NIRscan Nano. It is recommended that the Bluetooth Client sets the date and time every time a connection is established, so the scan data has the correct date and time stamp. 5.3.2.3 Bluetooth Client GATT Calibration Service Once the GATT Calibration Service is enumerated, the Bluetooth Client can prompt DLP NIRscan Nano to download spectrum calibration coefficients, reference calibration coefficients, and reference calibration matrix. These parameters are unique for each DLP NIRscan Nano and are required for spectrum intensity, reflectance, and absorbance plots. These parameters must to be downloaded whenever a new DLP NIRscan Nano is connected to a Bluetooth Client and before a scan is performed. To download these parameters, the Bluetooth Client must follow these steps: * Subscribe to the notification of the characteristic UUID that returns the corresponding coefficient. * Issue a request for the coefficient and wait for the notification to read the corresponding coefficient. * Once a notification is received, then the Bluetooth Client reads the serialized multiple packets from DLP NIRscan Nano. Figure 5-9 shows the workflow for this service. Yes GATT Calibration Service enumerated? Subscribe to Return Spectrum Calibration Coefficients notification Write to Request Spectrum Calibration Coefficients DLP NIRscan Nano returns spectrum calibration coefficeints in serialized data format Subscribe to Return Reference Calibration Coefficients notification Write to Request Spectrum Calibration Matrix Subscribe to Request Reference Calibration Matrix notification DLP NIRscan Nano returns reference calibration coefficients in serialized data format Write to Request Reference Calibration Coefficients No DLP NIRscan Nano returns reference calibration matrix in serialized data format Figure 5-9. GATT Calibration Service Workflow DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Software Copyright (c) 2015, Texas Instruments Incorporated 41 Bluetooth Client App Workflow 5.3.2.4 www.ti.com Bluetooth Client GATT Scan Configuration Service Once the GATT Scan Configuration Service is enumerated, the Bluetooth Client can prompt DLP NIRscan Nano to download stored scan configurations. These parameters must to be downloaded whenever a new DLP NIRscan Nano is connected to a Bluetooth Client and before a scan is initiated. To read the stored scan configuration, the Bluetooth Client must perform the following steps: * Read the number of stored configurations. * Subscribe to the notification of the characteristic that returns stored configuration list. * Issue a request for stored configuration list and wait for the notification to read the stored configuration list. * Subscribe to the notification of the characteristic that returns scan configuration data. * Read each scan configuration data by writing the scan configuration ID to the characteristic that returns the scan configuration data, wait for the notification, and then read the serialized scan configuration data returned. The DLP Spectrum Library provides a routine to interpret this serialized data: dlpspec_deserialize. Repeat this step for each stored scan configuration. * Set the active scan configuration by writing to the scan configuration ID to the active scan configuration characteristic. Figure 5-10 depicts the workflow for this service. Yes GATT Scan Configuration Service enumerated? Read Number of Stored Configurations DLP NIRscan Nano returns the number of stored scan configurations Subscribe to Return Stored Configurations List notification Write to Request Stored Configuration List DLP NIRscan Nano returns requested scan configuration in serialized data format Write scan configuration ID to Return Scan Configuration Data Subscribe to Return Scan Configuration Data notification DLP NIRscan Nano returns stored configurations No Deserialize data using DLP Spectrum Library dlpspec_deserialize No Read all stored scan configurations? Yes Write to Active Scan Configuration to set an active configuration for future scans Figure 5-10. GATT Scan Configuration Service Workflow 5.3.2.5 Bluetooth Client GATT Scan Data Service Once the GATT Scan Data Service is enumerated, the Bluetooth Client can prompt DLP NIRscan Nano to download stored scan data or perform a scan. To read the stored scan data, the Bluetooth Client must perform the following steps: * Read the number of stored scans. * Subscribe to the notification of the characteristic that returns stored scan indices list. * Issue a request to read stored configuration list, wait for the notification to read the stored configuration list. 42 DLP NIRscan Nano Software DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Bluetooth Client App Workflow www.ti.com * * Subscribe to the notifications of the characteristics to return scan name, scan type, and scan date/time, and to request packet format version. Issue requests for scan name, scan type, scan date/time, and packet format version. Then wait for the notifications to read scan name, scan type, scan date/time, and packet format version. Repeat the last two steps for each stored scan. To perform a scan, the Bluetooth Client must perform the following steps: * To display an existing scan: - If the scan information is not available, subscribe to the notification of the characteristic to return serialized scan data structure. - Issue a request to read serialized scan data structure and wait for the notification to read the scan data structure. The DLP Spectrum Library provides a routine to interpret this serialized data: dlpspec_scan_interpret. * To initiate a scan: - Subscribe to the notification of the characteristics to start scan. - Issue a request to start scan and wait for the notification that indicates the scan completed. - Subscribe to the notifications of the characteristics to return scan name, scan type, and scan date/time, and to request packet format version. - Issue requests for scan name, scan type, scan date/time, and packet format version. Then wait for the notifications to read scan name, scan type, scan date/time, and packet format version. - Subscribe to the notification of the characteristic to return serialized scan data structure. - Issue a request to read serialized scan data structure and wait for the notification to read the scan data structure. The DLP Spectrum Library provides a routine to interpret this serialized data: dlpspec_scan_interpret. * To delete stored scan data: - Subscribe to the notification of the characteristic to clear scan. - Issue a request to clear scan and wait for the notification that indicates the clear scan completed. Figure 5-11 and Figure 5-12 show the workflow for this service. Yes Subscribe to Stored Scan Indices List notification Read Number of Stored Scans GATT Scan Data Service enumerated? Write to Request Stored Configuration List DLP NIRscan Nano returns the list of stored scans No Write to Return Scan Type with parameter scan index Write to Return Scan Name with parameter scan index Subscribe to Return Packet Format Version notification Subscribe to Return Scan Date/Time notification Subscribe to Return Scan Type notification Subscribe to Return Scan Name No Write to Return Scan Date/Time with parameter scan index Write to Return Packet Format Version with parameter scan index Read all stored scan information? Yes List scans Figure 5-11. GATT Scan Data Service Workflow DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Software Copyright (c) 2015, Texas Instruments Incorporated 43 Bluetooth Client App Workflow Bluetooth Client selects a stored scan www.ti.com Scan details available? No Subscribe to Return Serialized Scan Data Structure notification Write to Request Serialized Scan Data Structure DLP NIRscan Nano returns scan data Interpret data using DLP Spectrum Library dlpspec_scan_interpret Yes Perform a scan Subscribe to Start Scan notification Write to Start Scan with parameter store scan in microSD card Subscribe to Return Scan Type notification Erase scan from DLP NIRscan Nano? Display Spectrum Yes Write to Return Scan Name with parameter scan index Subscribe to Return Packet Format Version notification Subscribe to Return Scan Date/Time notification Subscribe to Clear Scan notification Write to Return Scan Type with parameter scan index Write to Return Scan Date/Time with parameter scan index Write to Return Packet Format Version with parameter scan index Write to Clear Scan with parameter scan ID Figure 5-12. GATT Scan Data Service Workflow to Display an Existing Scan or Performing a New Scan 44 DLP NIRscan Nano Software DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Chapter 6 DLPU030B - June 2015 - Revised July 2015 iOS App 6.1 NanoScan iOS App KS Technologies has developed an example iOS app that controls the DLP NIRscan Nano EVM. This app is available for download through the Apple App Store free of charge. This app supports BLE iOS devices: iPhone 4S or later and iPad 3 or later with iOS 7.1 or later. After running the NanoScan iOS App, the main screen shown in Figure 6-1 lists the previous scans performed with the NIRscan Nano EVM. To connect to a NIRscan Nano EVM, enable the Bluetooth by pressing and holding the scan button on the EVM for more than three seconds. The blue LED will light up to indicate that the Bluetooth circuits are powered and actively scanning. Press Scan on the top-right corner of the iOS App to initiate a connection. The Bluetooth icon in the top-right corner of the iPhone screen will blink as the connection is established. The NIRscan Nano EVM blue LED will pulse to indicate that a BLE connection was established. Then, the reference and calibration data is downloaded from the EVM. When that is completed, the Start Scan button will be activated. Delete Stored Scan Data Search Stored Scans Connect to NIRscan Nano and show Scan Window Tap to display stored scans Support Links and Information Settings Figure 6-1. NanoScan Main Screen Pressing the Configure button in the top-right corner of the NanoScan main screen opens the Configuration screen. The Configuration screen displays four buttons: * Device Information: This button uses the following service: - GATT General Information Service to request Manufacture, Model Number, Serial Number, Hardware revision, Tiva firmware version, and Spectrum Library revision. * Device Status: This button uses the following services: - Battery Service to prompt for the Battery voltage. The battery is reported in percentage capacity with 0%, 5%, 20%, 40%, 60%, and 80%. - GATT General Information Service to request temperature, humidity, device and error status, and also set threshold for temperature and humidity notifications. - GATT General Information Service to report device and error status. * Scan Configurations: This button uses the following service: - GATT Scan Configuration Information Service to display stored scan configurations on the DLP NIRscan Nano. The user can select which stored scan configuration will be used in future scans. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback iOS App Copyright (c) 2015, Texas Instruments Incorporated 45 NanoScan iOS App * www.ti.com Stored Scan Data: This button uses the following service: - GATT Scan Data Information Service to retrieve stored scan data from the microSD card. Before starting a scan, the user can set a filename prefix, can elect to also save the scan data on the microSD card, and can choose a default for future scans from the stored scan configurations, as shown in Figure 6-2. Pressing the Start Scan button will start a scan with the selected scan configuration. Once the scan completes, the scan data is transmitted from the NIRScan Nano and plotted. The user can choose to plot absorbance, reflectance, or raw intensity values by tapping on the corresponding button under the plot area. Return to Main Screen Configuration Screen Enter a filename prefix for scan data Select spectrum plot type Enable to save scan to microSD card Select stored scan configurations Start a Scan Figure 6-2. NanoScan Scan Screen 46 iOS App DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated NanoScan iOS App www.ti.com Figure 6-3 shows an example plot of absorbance for sugar. Figure 6-3. NanoScan Scan Plot Screen DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback iOS App Copyright (c) 2015, Texas Instruments Incorporated 47 Appendix A DLPU030B - June 2015 - Revised July 2015 Installing the DLP NIRscan Nano Software A.1 DLP NIRscan Nano Software Installation The NIRscan Nano software is broken into several packages: * DLPNIRscanNanoGUI-1.0.3-windows-installer.exe - This is the PC program that communicates with the DLP NIRscan Nano through USB. - This program installs the PC GUI NIRscanNanoGUI.exe under the default directory: C:\Program Files\Texas Instruments\NIRscanNanoGUI_1.0.2\Binaries - It also install the sources under the default directory: C:\ti\NIRscanNanoGUI\Sources * DLPNIRscanNanoSoftware-windows-installer.exe - This program installs the Tiva binary firmware file under the default directory: C:\ti\DLPNIRscanNanoSoftware_1.0.0\Binaries\NIRscanNano.bin - It also installs the sources under the default directory: C:\ti\DLPNIRscanNanoSoftware_1.0.0\Sources - This installer includes the TI-RTOS 2.10.1.38 and the Device Firmware Update (DFU) drivers for Tiva. The DFU drivers allow updating the Tiva firmware through USB. If your CCS installation already has TI-RTOS 2.10.1.38, you can skip installing this TI-RTOS package. * DLPSpectrumLibrary-1.0.0-windows-installer.exe - This program installs the DLP Spectrum Library. This library code is shared with the PC GUI, Tiva software, and iOS App. The source files are under the default directory: C:\ti\DLPSpectrumLibrary_1.0.0\src. * DLPR150PROM-1.0.0-windows-installer.exe - This program installs the DLPC150 firmware binary (DLPR150PROM_1.0.0.img) under the default directory: C:\ti\DLPR150PROM_1.0.0 To install the software, run these installer executables and follow the on-screen prompts. 48 Installing the DLP NIRscan Nano Software Copyright (c) 2015, Texas Instruments Incorporated DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Appendix B DLPU030B - June 2015 - Revised July 2015 Required Tools to Compile Tiva Software B.1 Tiva Tools Installation To * * * compile the DLP NIRscan Nano Tiva code, the following tools and software packages are required: Code Composer Studio (CCS) Integrated Development Environment (IDE) version 6.0.1 TI-RTOS version 2.10.1.38 TI ARM Compiler version 5.2.4 B.1.1 Code Composer Studio Installation To 1. 2. 3. 4. 5. 6. 7. 8. 9. install, follow these steps: Download the latest Windows or Linux version of the CCS IDE for TM4x ARM MCU. Execute the download file: c_setup_win32.exe Accept the License Agreement. Click Next. Select the installation location and click Next. C:\ti is the default installation location. If you are running anti-virus software, you will be warned that it is recommended to temporarily disable real-time scanning before proceeding with installation. The installer will prompt for processor support. Ensure that under 32-bit ARM MCUs, Tiva C Series Support and TI ARM Compiler are checked. Click Next. Select the appropriate Debug Probes or Emulators. Tiva C Series are supported by XDS100, XDS200, and XDS560 Debug Probes from TI, Spectrum Digital or Blackhawk. * For more information on supported Debug Probes, visit the Tiva Tools & Software page. * For emulation information visit the TI Emulation Wiki. * For more information on JTAG connectors and adapters visit the XDS Target Connection Guide. If prompted for apps, there is no need to select any apps. After the installation is complete, update CCS by following the steps in Section B.1.2. B.1.2 Updating TI-RTOS The current Tiva Firmware build uses TI-RTOS for TivaC 2.10.1.38. NOTE: Do not use TI-RTOS for TivaC 2.12.1.33 since the TI-RTOS drivers are different. If you have an older installation of TI-RTOS, update TI-RTOS with the following steps after launching Code Composer Studio: 1. Select CCS APP Center from the View Menu. 2. Type "Tiva" in the search box. 3. Update TI-RTOS for TivaC, if offered to update it. To update it, press the select button beneath the TIRTOS for TivaC icon and then click on the install software icon to the left of the search box under the App Center logo. TI-RTOS for TivaC 2.10.1.38 is found at this link. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Required Tools to Compile Tiva Software Copyright (c) 2015, Texas Instruments Incorporated 49 Tiva Tools Installation www.ti.com B.1.2.1 Updating TI ARM Compiler To 1. 2. 3. update the TI ARM Compiler, follow these steps after launching Code Composer Studio: Select CCS APP Center from the View Menu. Type "compiler" in the search box. Update TI ARM(R) Compiler, if offered to update it. To update it, press the select button beneath the TI ARM Compiler icon and then click on the install software icon to the left of the search box under the App Center logo. 4. Update TI ARM Compiler for TivaC. 50 Required Tools to Compile Tiva Software Copyright (c) 2015, Texas Instruments Incorporated DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Appendix C DLPU030B - June 2015 - Revised July 2015 How to Compile Tiva Source Code C.1 Tiva Libraries Compilation The DLP NIRscan Nano Tiva software uses two libraries from the TivaWare package: Tiva driverlib and Tiva usblib. It also uses a third library: DLP Spectrum Library. These libraries must be compiled under CCS before building the DLP NIRscan Nano software. C.1.1 Tiva driverlib Compilation To 1. 2. 3. compile the TivaWare driverlib library, follow these steps: Import the driverlib library by selecting Import from the File Menu. In the new Import dialog window, select CCS Projects under C/C++ folder and click Next. Find the location of the TivaWare driverlib project by browsing to the directory C:\ti\tirtos_tivac_2_10_01_38\products\TivaWare_C_Series-2.1.0.12573c\driverlib and click OK. 4. Compile this newly added driverlib project by selecting Clean from the Project Menu. Ensure that driverlib project is checked and select "Build only the selected project" and then click OK. C.1.2 Tiva usblib Library To 1. 2. 3. compile the TivaWare usblib library, follow these steps: Import the usblib library by selecting Import from the File Menu. In the new Import dialog window, select CCS Projects under C/C++ folder and click next. Find the location of the TivaWare usblib project by browsing to the directory C:\ti\tirtos_tivac_2_10_01_38\products\TivaWare_C_Series-2.1.0.12573c\usblib and then click OK. 4. Compile this newly added usblib project by select Clean from the Project Menu. Ensure that usblib project is checked and select "Build only the selected project" and then click OK. C.1.3 DLP Spectrum Library The DLP Spectrum Library is a collection of C-language routines that provide the fundamental pieces to use a DLP system in a spectroscopy application. These routines are shared by the Tiva firmware, NIRscan Nano GUI, and iOS App. To compile the DLP Spectrum Library for Tiva firmware, follow these steps: 1. Import the DLP Spectrum Library by selecting Import from the File Menu. 2. In the new Import dialog window, select CCS Projects under C/C++ folder and click Next. 3. Find the location of the dlpspeclib project by browsing to the install directory: C:/ti/DLPNIRNANO_SPECLIB. 4. Compile this newly added dlpspeclib project by selecting Clean from the Project Menu. Ensure that dlpspeclib project is checked and select "Build only the selected project" and then click OK. C.2 Tiva Main Source The Tiva main program sources are installed by the DLPNIRscanNanoSoftware package. This package installs the Code Composer Studio project and source at the default directory C:\ti\DLPNIRscanNanoSoftware_1.0.0 1. Import the Mobile Spectroscopy Tiva EVM by pulling-down the File Menu and select Import. 2. In the new Import dialog window, select CCS Projects under C/C++ folder and click Next. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback How to Compile Tiva Source Code Copyright (c) 2015, Texas Instruments Incorporated 51 Project Settings www.ti.com 3. Find the location of the Mobile Spectroscopy Tiva EVM by browsing to the install directory of the sources: C:\ti\DLPNIRscanNanoSoftware_1.0.0\Sources. 4. Make sure all the other libraries are compiled and imported before this step. Then, compile this newly added Mobile Spectroscopy Tiva EVM project by selecting Clean from the Project Menu. Ensure that dlpspeclib project is checked and select "Build only the selected project" and then click OK. C.3 Project Settings The compilation of the Tiva sources and libraries requires the following project settings by right clicking on: * On Project Browser, select Mobile Spectroscopy Tiva EVM. Right-click and select "Show Build Settings..." * Under CCS General, select the Main tab. Ensure that the Compiler version is TI v5.2.4. * Under CCS General, select the RTSC tab. Ensure that TI-RTOS for TivaC is set to 2.10.1.38 and XDCtools version is 3.30.4.52_core. * Repeat this for all libraries. 52 How to Compile Tiva Source Code DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Appendix D DLPU030B - June 2015 - Revised July 2015 Required Tools to Compile NIRscan Nano GUI D.1 NIRscan Nano GUI The NIRscan Nano GUI requires Qt Framework and tools 5.4.1 or later, MinGW compiler 4.9.1, and the DLP Spectrum Library. The Qt Framework and tools can be downloaded from the Qt website. D.1.1 Compiling the DLP Spectrum Library The DLP Spectrum Library includes a batch file to compile for the PC. To compile the DLP Spectrum Library for the NIRscan Nano GUI, follow these steps: 1. Open MS-DOS window and change to the src directory of the DLP Spectrum Library: C:/ti/DLPNIRNANO_SPECLIB/src 2. Execute the build-lib.bat file. This batch file requires the prior installation of MinGW or a GCC toolchain in the Windows PC with their respective binaries added to the Windows PATH environment variable. D.1.2 Compiling NIRscan Nano GUI After compiling the DLP Spectrum Library, compile the NIRscan Nano GUI with the following steps: 1. Run Qt Creator. 2. In Qt Creator, click on "Open Project" button. Navigate to the directory where the NIRscanNanoGUI sources were installed. The default installation directory is C:\ti\NIRscanNanoGUI\Sources. Open the project file NirscanNanoGUI.pro 3. A dialog window will indicate that no user settings were found. Click the Yes button. 4. Click the Projects icon on the sidebar. Ensure that the Build settings are correct and that an existing Build directory is set. 5. From the Build menu, select Build All. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Required Tools to Compile NIRscan Nano GUI Copyright (c) 2015, Texas Instruments Incorporated 53 Appendix E DLPU030B - June 2015 - Revised July 2015 Tiva EEPROM Contents E.1 Tiva EEPROM The Tiva TM4C129XNCZAD microcontroller includes an EEPROM with 6kB of storage. The DLP NIRscan Nano uses this EEPROM to store the following factory information: * DLP NIRscan Nano Serial Number: A five digit number in the format YMMSSSS, where Y represents a one digit year of manufacturing number, MM represents a two digit month of manufacturing number, and SSSS represents a four digit serial number * Scan Data Index Counter: Default scan * Calibration Coefficients Data Structure Version Number * Calibration Coefficients Data * Reference Calibration Data Structure Version Number * Reference Calibration Data * Default Scan Name * Default Scan Configuration * Active Scan Configuration Number and Index * Scan Configuration Data Structure Version * Scan Configurations See Table E-1 for the address, size, and content of these information in Tive EEPROM. Table E-1. Tiva EEPROM 54 ADDRESS SIZE (BYTES) 0x0000 8 DESCRIPTION DLP NIRscan Nano Serial Number 0x0008 4 Scan Data Session Index 0x000C 4 Scan Configuration Index Counter 0x0010 4 Calibration Coefficients Data Structure Version Number 0x0014 50 Calibration Coefficients Data 0x0046 4 Reference Calibration Data Structure Version Number 0x004A 3632 0x0E7A 16 Default Scan Name 0x0E7E 4 Active Scan Configuration Number and Index 0x0E82 4 Scan Configuration Data Structure Version 0x0E96 1280 Reference Calibration Data Scan Configurations (64 Scan Configuration entries, with 20 bytes per Scan Configuration) Tiva EEPROM Contents DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Appendix F DLPU030B - June 2015 - Revised July 2015 DLP NIRscan Nano Connectors F.1 Battery Connector The battery power (J6) connector of the microprocessor board requires the following 2-pin, 2-mm connector part numbers: * JST part number: PHR-2 * Digi-Key part number: 455-1165-ND The corresponding connector terminal (crimp) part numbers are: * JST part number: SPH-002T-P0.5L * Digi-Key part number: 455-2148-1-ND Table F-1. Battery Power Connector (Tiva J6) NOTE: F.2 DESCRIPTION PIN SUPPLY RANGE Power positive 1 4.2 V Ground 2 Ground The preferred connection to the battery may be a direct solder type or any low resistance contact connection. Battery Thermistor Connector The battery thermistor connector (J7) of the microprocessor board requires the following 2-pin, 1-mm connector part numbers: * JST part number: SHR-02V-S-B * Digi-Key part number: 455-1377-ND The corresponding connector terminal (crimp) part numbers are: * JST part number: SSH-003T-P0.2 * Digi-Key part number: 455-1561-1-ND Table F-2. Battery Thermistor Connector (Tiva J7) F.3 DESCRIPTION PIN SUPPLY RANGE Power positive 1 4.9 V Ground 2 Ground Expansion Connector The expansion connector (J3) of the microprocessor board requires the following 10-pin, 1-mm connector part numbers: * JST part number: SHR-10V-S-B * Digi-Key part number: 455-1385-ND DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Connectors Copyright (c) 2015, Texas Instruments Incorporated 55 JTAG Connector www.ti.com The corresponding connector terminal (crimp) part numbers are: * JST part number: SSH-003T-P0.2 * Digi-Key part number: 455-1561-1-ND Table F-3. Expansion Connector (Tiva J3) F.4 DESCRIPTION PIN Power 1 SUPPLY RANGE 3.3 V Ground 2 Ground Tiva PA2 (GPIO, UART4 receive or SSI0 clock) 3 3.3 V Tiva PA3 (GPIO, UART4 transmit or SSI0 frame sync) 4 3.3 V Tiva PA4 (GPIO or SSI0 Data0) 5 3.3 V Tiva PA5 (GPIO or SSI0 Data1) 6 3.3 V Tiva PK2 (GPIO or UART4RTS) 7 3.3 V Tiva PK3 (GPIO or UART4 CTS) 8 3.3 V Ground 9 Ground Tiva wake 10 3.3 V JTAG Connector The ARM Cortex 10-pin JTAG connector (J4) of the Microprocessor Board requires an adapter to interface to the standard TI 14-pin and 20-pin emulators. Refer to the TI JTAG Connector wiki page for more information. Table F-4. ARM Cortex 10-pin JTAG Connector (Tiva J4) F.5 DESCRIPTION PIN SUPPLY RANGE Power 1 3.3 V TMS 2 3.3 V Ground 3 Ground TCK 4 3.3 V Ground 5 Ground TDO 6 3.3 V Key (no connect) 7 -- TDI 8 3.3 V Ground 9 Ground RESETz 10 3.3 V Trigger Connector The trigger connector (J500) of the DLPC150 board requires the following 9-pin, 1-mm connector part numbers: * JST part number: SHR-09V-S-B * Digi-Key part number: SHR-09V-S-B The corresponding connector terminal (crimp) part numbers are: * JST part number: SSH-003T-P0.2 * Digi-Key part number: 455-1561-1-ND Note that this connector is on the top side of the DLPC150 board covered by the plastic cover. To access this connector, the microprocessor and DLPC150 boards must be disassembled from the optical module. Do not remove the top cover because it protects the optical module from dust and keeps the lenses in place. 56 DLP NIRscan Nano Connectors DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Trigger Connector www.ti.com Table F-5. Trigger Connector (DLPC150 J500) DESCRIPTION PIN SUPPLY RANGE Tiva PD2 (lamp control) 1 3.3 V TRIG_IN_1 2 3.3 V Ground 3 Ground DLPC150 GPIO_17 4 3.3 V DLPC150 GPIO_18 5 3.3 V Ground 6 Ground TRIG_OUT_2 (frame trigger) 7 3.3 V TRIG_OUT_1 (pattern trigger) 8 3.3 V Ground 9 Ground DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Connectors Copyright (c) 2015, Texas Instruments Incorporated 57 Appendix G DLPU030B - June 2015 - Revised July 2015 DLP NIRscan Nano Command Description G.1 Command Handler Supported Commands The DLP NIRscan Nano Command Handler supports a set of commands described in Table G-1. Table G-1. DLP NIRscan Nano Supported Commands COMMUNICATIONS INTERFACE READ / WRITE (1) 58 USB DESCRIPTION BLUETOOTH OPCODE BYTE 1 BYTE 2 0x15 READ Perform file checksum 0x00 WRITE Write file data 0x00 0x25 WRITE Write file size 0x00 0x2C READ Read file size 0x00 0x2D READ Read file data 0x00 0x2E WRITE Update Tiva firmware 0x00 0x2F READ EEPROM test 0x01 0x01 READ Detector board test 0x01 0x02 READ Battery charger test 0x01 0x03 READ SDRAM test 0x01 0x04 WRITE DLP Controller power up test 0x01 0x05 READ Temperature sensor test 0x01 0x06 READ Humidity sensor test 0x01 0x07 WRITE Bluetooth test 0x01 0x08 READ microSD Card test 0x01 0x09 READ LED test 0x01 0x0B READ Read button test 0x01 0x0C WRITE Write button test 0x01 0x0D WRITE FACTORY USE ONLY: Write EEPROM Calibration Coefficient, Scan Configuration, and Reference Calibration Coefficients Versions (1) 0x01 0x0E READ Read version information 0x02 0x16 WRITE Write patterns in SDRAM 0x02 0x17 WRITE Start scan 0x02 0x18 SERVICE NAME SERVICE UUID CHARACTERISTI C UUID Device Information Service Table I-1 0x180A 0x2829, 0x2A24, 0x2A26, 0x2A27, 0x2A28 GATT Scan Data 0x53455206-444C- 0x4348411D-444CInformation Service 5020-4E495020-4E49Table I-7 52204E616E6F 52204E616E6F Commands highlighted in red are for factory calibration. Erasing the factory calibration data will render a unit non-functional and will need to be recalibrated. DLP NIRscan Nano Command Description DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Command Handler Supported Commands www.ti.com Table G-1. DLP NIRscan Nano Supported Commands (continued) COMMUNICATIONS INTERFACE READ / WRITE USB DESCRIPTION OPCODE BYTE 1 (2) BLUETOOTH BYTE 2 READ Scan status 0x02 0x19 WRITE Reset Tiva 0x02 0x1A WRITE Write ADC PGA gain 0x02 0x1B WRITE FACTORY USE ONLY: Write DLPC150 Register (1) 0x02 0x1C READ Read DLPC150 register 0x02 0x1D WRITE Generate patterns 0x02 0x1E WRITE Save given scan configuration in EEPROM 0x02 0x1F READ Read stored scan configurations 0x02 0x20 WRITE Erase all stored scan configurations 0x02 0x21 READ Read number of stored scan configurations 0x02 0x22 READ Read active scan configuration 0x02 0x23 WRITE Set active scan configuration 0x02 0x24 WRITE DLPC150 power control 0x02 0x25 WRITE Set scan subimage 0x02 0x26 WRITE FACTORY USE ONLY: Erase Calibration Coefficients, Reference Calibration Coefficients, and Scan Configuration stored in EEPROM (2) 0x02 0x27 READ Read PGA setting 0x02 0x28 WRITE FACTORY USE ONLY: Write spectrum calibration coefficients (2) 0x02 0x29 SERVICE NAME SERVICE UUID CHARACTERISTI C UUID 0x43484103-444C5020-4E49GATT General 0x53455201-444C52204E616E6F, Information Service 5020-4E490x43484104-444CTable I-3 52204E616E6F 5020-4E4952204E616E6F 0x43484114-444C5020-4E4952204E616E6F, GATT Scan 0x53455205-444C- 0x43484115-444CConfiguration 5020-4E495020-4E49Information Service 52204E616E6F 52204E616E6F, Table I-6 0x43484116-444C5020-4E4952204E616E6F 0x43484113-444C5020-4E4952204E616E6F GATT Scan 0x53455205-444C- 0x43484117-444CConfiguration 5020-4E495020-4E49Information Service 52204E616E6F 52204E616E6F Table I-6 0x43484118-444C5020-4E4952204E616E6F Commands highlighted in red are for factory calibration. Erasing the factory calibration data will render a unit non-functional and will need to be recalibrated. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Command Description Copyright (c) 2015, Texas Instruments Incorporated 59 Command Handler Supported Commands www.ti.com Table G-1. DLP NIRscan Nano Supported Commands (continued) COMMUNICATIONS INTERFACE READ / WRITE USB DESCRIPTION OPCODE BYTE 1 60 BLUETOOTH BYTE 2 SERVICE NAME Read spectrum calibration coefficients 0x02 WRITE Compute SNR 0x02 0x2B READ Read SNR calculation results 0x02 0x2C WRITE Generate calibration pattern 0x02 0x2D WRITE Write number of scan repeats 0x02 0x2E WRITE FACTORY USE ONLY: Reference Calibration in EEPROM (2) 0x02 0x30 WRITE FACTORY USE ONLY: Write Device Serial Number (2) 0x02 0x32 READ Read device serial number 0x02 0x33 WRITE Set scan name tag 0x02 0x34 WRITE Erase specified scan from microSD card 0x02 0x35 WRITE FACTORY USE ONLY: Mass erase Tiva EEPROM (2) 0x02 0x36 READ Read temperature (TMP006) sensor 0x03 0x00 WRITE Set temperature threshold READ Read humidity (HDC1000) sensor WRITE Set humidity threshold WRITE Set time and date 0x03 0x09 GATT Date and Time Service Table I-4 READ Read battery voltage 0x03 0x0A Battery Service Table I-2 READ Read Tiva internal temperature 0x03 0x0B 0x03 0x02 CHARACTERISTI C UUID 0x4348410D-444C5020-4E4952204E616E6F, 0x4348412E-444C5020-4E4952204E616E6F, 0x4348410F-444C5020-4E49GATT Calibration 0x53455204-444C52204E616E6F, Information Service 5020-4E490x43484110-444CTable I-5 52204E616E6F 5020-4E4952204E616E6F, 0x43484111-444C5020-4E4952204E616E6F, 0x43484112-444C5020-4E4952204E616E6F READ 0x2A SERVICE UUID Device Information Service Table I-1 0x180A 0x2A25 0x4348411C-444C5020-4E49GATT Scan Data 0x53455206-444C52204E616E6F Information Service 5020-4E490x4348411E-444CTable I-7 52204E616E6F 5020-4E4952204E616E6F 0x43484101-444C5020-4E4952204E616E6F 0x43484105-444C5020-4E49GATT General 0x53455201-444C52204E616E6F Information Service 5020-4E490x43484102-444CTable I-3 52204E616E6F 5020-4E4952204E616E6F 0x43484106-444C5020-4E4952204E616E6F DLP NIRscan Nano Command Description 0x53455203-444C- 0x4348410C-444C5020-4E495020-4E4952204E616E6F 52204E616E6F 0x180F 0x2A19 DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated Command Handler Supported Commands www.ti.com Table G-1. DLP NIRscan Nano Supported Commands (continued) COMMUNICATIONS INTERFACE READ / WRITE USB DESCRIPTION BLUETOOTH OPCODE BYTE 1 BYTE 2 READ Get time and date 0x03 0x0C WRITE Set Tiva in hybernation mode 0x03 0x0D READ Read number of scan files stored in microSD card 0x04 0x00 READ Read Photodetector 0x04 0x02 DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback SERVICE NAME GATT Date and Time Service Table I-4 SERVICE UUID CHARACTERISTI C UUID 0x53455203-444C- 0x4348410C-444C5020-4E495020-4E4952204E616E6F 52204E616E6F 0x43484119-444C5020-4E4952204E616E6F, GATT Scan Data 0x53455206-444C- 0x4348411A-444CInformation Service 5020-4E495020-4E49Table I-7 52204E616E6F 52204E616E6F, 0x4348411B-444C5020-4E4952204E616E6F DLP NIRscan Nano Command Description Copyright (c) 2015, Texas Instruments Incorporated 61 Appendix H DLPU030B - June 2015 - Revised July 2015 DLP NIRscan Nano USB Communications USB Communications The DLP NIRscan Nano communicates using USB 1.1 human interface device (HID) to exchange commands and data with a host processor or PC. The USB commands are variable length data packets that are sent with the least significant byte first. The maximum HID packet length is 64 bytes. The DLP NIRscan Nano enumerates as a Texas Instruments HID device with vendor ID = 0x0451 and product ID = 0x4200. USB Transaction Sequence The USB 1.1 HID protocol has the structure shown in Figure H-1: Byte 0 Report ID = 0 Byte 1 Byte 2 Command Byte Sequence Byte 7 6 5 4:0 R/W Reply Error Reserved Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Length LSB Length MSB OpCode 1 OpCode 2 Data Bytes Byte N ... Data Bytes Figure H-1. USB HID Protocol H.0.0.1 USB Read Transaction Sequence To issue a read command, the host must perform the following steps: 1. Host sends the Report ID byte, which is set to 0. 2. Host sends the Command ID byte, where: * Bit 6 is set to 0x1 to indicate the host wants a reply from the device. * Bit 7 is set to 0x1 to indicate a read transaction. 3. Host sends the Sequence byte. When a single command is more than 64 bytes, it is sent as multiple USB packets and the sequence byte is used to number the packets so the device can assemble them in the right sequence. Otherwise, this value is irrelevant and generally set to 0. 4. Host sends two bytes with the length of the data packet. This length denotes the number of data bytes in the packet and excludes the number of bytes in steps 1 through 4. It denotes the total number of bytes sent in steps 5 (command bytes) and 6 (data bytes). 5. Host sends two OpCode bytes: OpCode Byte 1 and OpCode Byte 2. 6. Host sends data appropriate to command. 7. After completion of this command, DLP NIRscan Nano responds with a packet that includes: (a) Byte with the command requested by the host (the matching Sequence byte) (b) Length of the data packet (c) Data requested 62 DLP NIRscan Nano USB Communications Copyright (c) 2015, Texas Instruments Incorporated DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback www.ti.com H.0.0.2 USB Write Transaction Sequence To issue a write command, the host must perform the following steps: 1. Host sends the Report ID byte, which is set to 0. 2. Host sends the Flags byte, where * Bit 6 is set to 0x1 to indicate the host wants a reply from the device. The device responds with the NACK bit set if an unknown command was received or there was any error in processing the command due to invalid parameters or other reasons.. * Bit 7 is set to 0x1 to indicate a read transaction 3. Host sends the Sequence byte. When a single command is more than 64 bytes, it is sent as multiple USB packets and the sequence byte is used to number the packets so the device can assemble them in the right sequence. In other cases, this value is irrelevant and generally set to 0. 4. Host sends two bytes with the length of the data packet. This length denotes the number of data bytes in the packet and excludes the number of bytes in steps 1 through 4. It denotes the total number of bytes sent in steps 5 (command bytes) and 6 (data bytes). 5. Host sends three OpCode bytes: OpCode Byte 1 and OpCode Byte 2. 6. Host sends data appropriate to command. 7. After completion of this command, DLP NIRscan Nano responds with a packet that includes a byte with the command requested by the host. This occurs only if bit 6 was set in the Flags byte. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano USB Communications Copyright (c) 2015, Texas Instruments Incorporated 63 www.ti.com 64 DLP NIRscan Nano USB Communications Copyright (c) 2015, Texas Instruments Incorporated DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Appendix I DLPU030B - June 2015 - Revised July 2015 DLP NIRscan Nano Bluetooth Communications I.1 Bluetooth Communications The DLP NIRscan Nano wirelessly communicates using Bluetooth Low Energy version 4.0 This wireless communication uses two main profiles for discovery and communication with a remote host: * GAP: Generic access profile for basic discovery and establishing connections. * GATT: Generic attribute profile for commands and data transfer. The DLP NIRscan Nano supports Bluetooth version 4.0 specification. When the Bluetooth sub-system is activated, the DLP NIRscan Nano broadcasts its availability while a smartphone, tablet or PC acts as an observer. Once connected, the DLP NIRscan Nano acts as a server for the GATT profile while the smartphone, tablet, or PC acts as a client. I.1.1 GATT Supported Services The DLP NIRscan Nano Bluetooth GATT Profile supports the following services: * Battery Service (BAS) to provide battery charge capacity. * Device Information Service (DIS) to provide manufacturer Name, model number, serial number, hardware revision, spectrum library revision, and Tiva software revision. * GATT General Information Service to provide temperature, humidity, status, hours of use, lamp hours, and battery recharge cycles. * GATT Date and Time Service to synchronize date and time information between smartphone, tablet, or PC to the Tiva's realtime clock. * GATT Calibration Information Service to provide calibration coefficients * GATT Scan Configuration Information Service to provide stored configurations and scan configuration data. * GATT Scan Data Information Service to initiate scan, clear scan data, and return stored scan data. A GATT service has a universally unique identifier (UUID) used to identify every service. A UUID is a 128bit value. However, common or frequently used services that are included in the BLE specifications and/or certified by Bluetooth.org are shortened to 16-bit UUID to improve efficiency. Each service is composed of a set of characteristics. Each characteristic contains a value with properties for how the value is accessed and information on how the value is displayed or represented. The properties are: * R = Read. * W = Write. * WWoR = Write without response. Not used in DLP NIRscan Nano Bluetooth implementation. * S = Signed write. Not used in DLP NIRscan Nano Bluetooth implementation. * N = Notify. * I = Indicate. * WA = Writable auxiliaries. Not used in DLP NIRscan Nano Bluetooth implementation. * B = Broadcast. Not used in DLP NIRscan Nano Bluetooth implementation. * EP = Extended properties. Not used in DLP NIRscan Nano Bluetooth implementation. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Bluetooth Communications Copyright (c) 2015, Texas Instruments Incorporated 65 Bluetooth Communications www.ti.com An "X" in a supported property indicates the properties supported by a characteristic. Empty columns indicate properties not supported by the characteristic. A data size entry with an MP value represents multiple packets. All data is transmitted little-endian. Table I-1. Device Information Service (DIS) SERVICE UUID DESCRIPTION 0x180A DEVICE INFORMATION SERVICE (DIS) CHARACTERIS TIC UUID DESCRIPTION SUPPORTED PROPERTIES DATA FORMAT DATA SIZE (BYTES) R W N NOTES I 0x2829 Manufacturer name string string 1 X org.bluetooth.ch aracteristic.manu facturer_name_s tring 0x2A24 Model number string string 1 X org.bluetooth.ch aracteristic.mode l_number_string 0x2A25 Serial number string string 1 X org.bluetooth.ch aracteristic.serial _number_string 0x2A27 Hardware revision string string 1 X org.bluetooth.ch aracteristic.hard ware_revision_st ring 0x2A26 Tiva firmware revision string string 1 X org.bluetooth.ch aracteristic.firmw are_revision_stri ng 0x2A28 Spectrum library revision string unsigned integer 2 X org.bluetooth.ch aracteristic.softw are_revision_stri ng Table I-2. Battery Service (BAS) SERVICE UUID DESCRIPTION 0x180F BATTERY SERVICE (BAS) CHARACTERIS TIC UUID 0x2A19 66 DESCRIPTION DATA FORMAT unsigned integer Battery level DATA SIZE (BYTES) 1 DLP NIRscan Nano Bluetooth Communications Copyright (c) 2015, Texas Instruments Incorporated SUPPORTED PROPERTIES R X W N NOTES I org.bluetooth.ser vice.battery_serv ice. Value reported in the range of 0-100. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Bluetooth Communications www.ti.com Table I-3. GATT General Information Service SERVICE UUID DESCRIPTION 0x53455201444C-50204E4952204E616E6F GATT GENERAL INFORMATION SERVICE SUPPORTED PROPERTIES DATA FORMAT DATA SIZE (BYTES) R integer 2 X X Humidity measurement unsigned integer 2 X X 0x43484103444C-50204E4952204E616E6F Device status (Reserved for future support) unsigned integer 2 X X 0x43484104444C-50204E4952204E616E6F Error status (Reserved for future support) unsigned integer 2 X X 0x43484105444C-50204E4952204E616E6F Temperature threshold integer 2 X 0x43484106444C-50204E4952204E616E6F Humidity threshold unsigned integer 2 X 0x43484107444C-50204E4952204E616E6F Number of hours of use (Reserved for future support) unsigned integer 2 X 0x43484108444C-50204E4952204E616E6F Number of battery recharge cycles (Reserved for future support) unsigned integer 2 X 0x43484109444C-50204E4952204E616E6F Total lamp hours (Reserved for future support) unsigned integer 2 X 0x4348410A444C-50204E4952204E616E6F Error log (Reserved for future support) string 1 X CHARACTERIS TIC UUID DESCRIPTION 0x43484101444C-50204E4952204E616E6F Temperature measurement 0x43484102444C-50204E4952204E616E6F DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback W N NOTES I Integer value returned in hundredths. Divide by 100 to get the actual floating point number. Value set in hundredths. Input truncated integer of actual value multiplied by 100. DLP NIRscan Nano Bluetooth Communications Copyright (c) 2015, Texas Instruments Incorporated 67 Bluetooth Communications www.ti.com Table I-4. GATT Date and Time Service SERVICE UUID DESCRIPTION 0x53455203-444C5020-4E4952204E616E6F GATT CURRENT DATE AND TIME CHARACTERISTIC UUID 0x4348410C-444C5020-4E4952204E616E6F DATA FORMAT DATA SIZE (BYTES) Current year (0-99: starting in year 2000) unsigned integer 1 Current month (1-12) unsigned integer 1 Current day (1-31) unsigned integer 1 Current day of the week (0-6) unsigned integer 1 Current hour (0-23) unsigned integer 1 Current minute (0-59) unsigned integer 1 Current second (0-59) unsigned integer 1 DESCRIPTION SUPPORTED PROPERTIES R W N I X Table I-5. GATT Calibration Information Service SERVICE UUID DESCRIPTION 0x53455204444C-50204E4952204E616E6F GATT CALIBRATION INFORMATION SERVICE CHARACTERIS TIC UUID 0x4348410D444C-50204E4952204E616E6F 68 DESCRIPTION Request Spectrum Calibration Coefficients 0x4348412E444C-50204E4952204E616E6F Return Spectrum Calibration Coefficients 0x4348410F444C-50204E4952204E616E6F Request Reference Calibration Coefficients 0x43484110444C-50204E4952204E616E6F Return Reference Calibration Coefficients 0x43484111444C-50204E4952204E616E6F Request Reference Calibration Matrix 0x43484112444C-50204E4952204E616E6F Return Reference Calibration Matrix DATA FORMAT DATA SIZE (BYTES) unsigned integer 1 SUPPORTED PROPERTIES R W 1 X unsigned integer 1 MP DLP NIRscan Nano Bluetooth Communications Copyright (c) 2015, Texas Instruments Incorporated Send 6 coefficients. Each coefficient is a double datatype of 8 bytes. The data is sent in serialized manner. Indicate intent to read. No data transferred. X MP NOTES I Indicate intent to read. No data transferred. X MP unsigned integer N X Serialized data; refer to spectrum C library for data structure. Indicate intent to read. No data transferred. X X Serialized data; refer to spectrum C library for data structure. DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Bluetooth Communications www.ti.com Table I-6. GATT Scan Configuration Information Service SERVICE UUID DESCRIPTION 0x53455205444C-50204E4952204E616E6F GATT SCAN CONFIGURATION INFORMATION SERVICE CHARACTERIS TIC UUID DESCRIPTION DATA SIZE (BYTES) R X 0x43484113444C-50204E4952204E616E6F Number of stored configurations unsigned integer 2 0x43484114444C-50204E4952204E616E6F Request stored configurations list unsigned integer 1 0x43484115444C-50204E4952204E616E6F Return stored configurations list 0x43484116444C-50204E4952204E616E6F Request scan configuration data 0x43484117444C-50204E4952204E616E6F 0x43484118444C-50204E4952204E616E6F SUPPORTED PROPERTIES DATA FORMAT W Return scan configuration data 2 2 No data transmitted. List of 2 byte indices. X X MP Active scan configuration NOTES I X MP unsigned integer N Index to read. Serialized data; refer to spectrum C library for data structure. X X Get/Set function. Parameter transmitted is a 2-byte index. X Table I-7. GATT Scan Data Information Service SERVICE UUID DESCRIPTION 0x53455206444C-50204E4952204E616E6F GATT SCAN DATA INFORMATION SERVICE CHARACTERIS TIC UUID DESCRIPTION DATA SIZE (BYTES) R X 0x43484119444C-50204E4952204E616E6F Number of stored scans unsigned integer 4 0x4348411A444C-50204E4952204E616E6F Stored scan indices list unsigned integer 4 0x4348411B444C-50204E4952204E616E6F Stored scan indices list 0x4348411C444C-50204E4952204E616E6F Set scan name stub DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback SUPPORTED PROPERTIES DATA FORMAT W 2 X X NOTES I No data transmitted. X MP string N Multiple packet transfer of five 4byte indices per packet. Limited to 15 bytes. DLP NIRscan Nano Bluetooth Communications Copyright (c) 2015, Texas Instruments Incorporated 69 Bluetooth Communications www.ti.com Table I-7. GATT Scan Data Information Service (continued) SERVICE UUID DESCRIPTION 0x53455206444C-50204E4952204E616E6F GATT SCAN DATA INFORMATION SERVICE CHARACTERIS TIC UUID 0x4348411D444C-50204E4952204E616E6F 70 DESCRIPTION DATA FORMAT unsigned integer Start scan DATA SIZE (BYTES) 1 SUPPORTED PROPERTIES R W X 0x4348411E444C-50204E4952204E616E6F Clear scan unsigned integer 4 X 0x4348411F444C-50204E4952204E616E6F Request scan name unsigned integer 4 X 0x43484120444C-50204E4952204E616E6F Return scan name string 20 0x43484121444C-50204E4952204E616E6F Request scan type unsigned integer 4 0x43484122444C-50204E4952204E616E6F Return scan type unsigned integer 1 0x43484123444C-50204E4952204E616E6F Request scan date/time unsigned integer 4 0x43484124444C-50204E4952204E616E6F Return scan date/time unsigned integer 7 0x43484125444C-50204E4952204E616E6F Request packet format version unsigned integer 4 0x43484126444C-50204E4952204E616E6F Return packet format version unsigned integer 4 DLP NIRscan Nano Bluetooth Communications Copyright (c) 2015, Texas Instruments Incorporated N NOTES I X Parameter value: 0x00 = do not store scan in microSD card 0x01 = store scan in microSD card. Notification returned: 0xFF = scan completed X Index of scan data to clear. Notification returned: 0x00 = success non-zero return is an error Index of scan data to read. X Scan name limited to 20 characters. Index of scan data to read. X X X X Seven bytes returned. Same format as GATT Date and Time Service. Index of data to read. X X DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Bluetooth Packets www.ti.com Table I-7. GATT Scan Data Information Service (continued) SERVICE UUID DESCRIPTION 0x53455206444C-50204E4952204E616E6F GATT SCAN DATA INFORMATION SERVICE CHARACTERIS TIC UUID 0x43484127444C-50204E4952204E616E6F 0x43484128444C-50204E4952204E616E6F I.2 DESCRIPTION Request serialized scan data structure Return serialized scan data structure DATA FORMAT DATA SIZE (BYTES) unsigned integer 4 MP SUPPORTED PROPERTIES R W N NOTES I Index of data to read X X Serialized data; refer to spectrum C library for data structure. Bluetooth Packets Bluetooth transmits in short packet sizes. The typical maximum transmission unit for an iOS App is 20 bytes. Multiple packets are needed to transfer the following information to DLP NIRscan Nano: * Spectrum Calibration Coefficients * Reference Calibration Coefficients * Stored Configurations List * Scan Configuration Data * Stored Scan Indices * Serialized Scan Data Structure The previous tables label the data size as MP to denote that multiple packets are used during transfer. The packet structure is: * First Packet: - Packet Index: 00 (one byte) - Data size in bytes (4 bytes) * Nth Packet: - Packet Index: N-1 (one byte describing the current packet number, zero-based) - Data Packet: data (up to 19 bytes) DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback DLP NIRscan Nano Bluetooth Communications Copyright (c) 2015, Texas Instruments Incorporated 71 Revision B History www.ti.com Revision B History Changes from A Revision (June 2015) to B Revision .................................................................................................... Page * * * Updated locations of firmware files in Section 3.1.4 ................................................................................ 29 Deleted OpCode Byte 3................................................................................................................. 58 Added USB Communications HID packet description .............................................................................. 62 NOTE: Page numbers for previous revisions may differ from page numbers in the current version. Revision A History Changes from Original (June 2015) to A Revision ......................................................................................................... Page * * * * * * * * * * * * * Added missing thermistor from block diagram and moved red LED to bq24250 ................................................. 9 Changed description to include more information ................................................................................... 12 Changed list of DLLs .................................................................................................................... 18 Changed description of scan configuration parameters ............................................................................ 22 Changed battery requirements ......................................................................................................... 31 Changed DLP Spectrum Library description ......................................................................................... 37 Added DLP Spectrum Library workflow diagrams ................................................................................... 37 Changed semaphore location to be outside of tasks ............................................................................... 40 Added Bluetooth Client App Workflow ................................................................................................ 40 Changed software version numbers .................................................................................................. 48 Added steps to compile NIRscanNanoGUI and its DLP Spectrum Library under Windows ................................... 53 Changed Command Handler Table to show the exact USB commands and Bluetooth services ............................. 58 Added notes to the GATT services characteristics .................................................................................. 65 NOTE: Page numbers for previous revisions may differ from page numbers in the current version. 72 Revision History DLPU030B - June 2015 - Revised July 2015 Submit Documentation Feedback Copyright (c) 2015, Texas Instruments Incorporated IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All semiconductor products (also referred to herein as "components") are sold subject to TI's terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI's terms and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily performed. TI assumes no liability for applications assistance or the design of Buyers' products. Buyers are responsible for their products and applications using TI components. To minimize the risks associated with Buyers' products and applications, Buyers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional restrictions. Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in safety-critical applications. In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI's goal is to help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and requirements. Nonetheless, such components are subject to these terms. No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties have executed a special agreement specifically governing such use. Only those TI components which TI has specifically designated as military grade or "enhanced plastic" are designed and intended for use in military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and regulatory requirements in connection with such use. TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of non-designated products, TI will not be responsible for any failure to meet ISO/TS16949. Products Applications Audio www.ti.com/audio Automotive and Transportation www.ti.com/automotive Amplifiers amplifier.ti.com Communications and Telecom www.ti.com/communications Data Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computers DLP(R) Products www.dlp.com Consumer Electronics www.ti.com/consumer-apps DSP dsp.ti.com Energy and Lighting www.ti.com/energy Clocks and Timers www.ti.com/clocks Industrial www.ti.com/industrial Interface interface.ti.com Medical www.ti.com/medical Logic logic.ti.com Security www.ti.com/security Power Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense Microcontrollers microcontroller.ti.com Video and Imaging www.ti.com/video RFID www.ti-rfid.com OMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.com Wireless Connectivity www.ti.com/wirelessconnectivity Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 Copyright (c) 2015, Texas Instruments Incorporated Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Texas Instruments: DLPNIRNANOEVM