Application Report. 1 Hardware Description. John Fahrenbruch... MSP430 Applications

Similar documents
TMS470R1x External Clock Prescale (ECP) Reference Guide

Table 1. Proper Termination of Unused (Port) Pins in a Single-Port PSE System

This document describes the features of the GUI program used to control Power Line Modem with E-Meter Platform.

Application Report. 1 Introduction. MSP430 Applications. Keith Quiring... ABSTRACT

XIO1100 NAND-Tree Test

TMS320C6000 DSP 32-Bit Timer Reference Guide

TMS320C64x DSP Peripheral Component Interconnect (PCI) Performance

Using Endianess Conversion in the OMAP5910 Device

PCIxx12 Single Socket CardBus Controller with Integrated 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller

DSP/BIOS Link. Platform Guide Published on 20 th JUNE Copyright 2009 Texas Instruments Incorporated.

TMS320C6000 DSP Interrupt Selector Reference Guide

Calibration Routines and Register Value Generation for the ADS1216, ADS1217 and ADS1218

Power Line Modem with E-Meter Platform Quick Start Guide

Application Report. 1 System Requirements. 2 Using the DM643x Pin Multiplexing Utility. Bernard Thompson...

SN5476, SN54LS76A SN7476, SN74LS76A DUAL J-K FLIP-FLOPS WITH PRESET AND CLEAR

Interfacing the ADS8320/ADS8325 to The TMS320C6711 DSP

Quad-Channel TEC Controller Getting Started Guide. Contents. Introduction. Contents of Evaluation Kit

AC Induction Motor (ACIM) Control Board

System-on-Chip Battery Board User s Guide

TMS320C620x/C670x DSP Boot Modes and Configuration Reference Guide

TMS470R1VF334E TMS470 Microcontrollers Silicon Errata

TMS320C672x DSP Software-Programmable Phase-Locked Loop (PLL) Controller. Reference Guide

TMS320C6000 DSP General-Purpose Input/Output (GPIO) Reference Guide

Wolverine - based microcontrollers. Slashing all MCU power consumption in half

The examples in this application report require the Flash API Modules (SPRC236) within the "Tools & Software" folder.

description VCC 1PRE 1OC 1D1 1C 1Q1 1Q2 1Q3 1Q4 2Q1 2Q2 2Q3 2Q4 2C 2PRE 1D2 1D3 1D4 2D1 2D2 2D3 2D4 2OC GND 1PRE 1OC 1Q1 1D1 1Q2 1Q3 1Q4 1D2 1D3 1D4

External Programming of the TMS320C64x EDMA for Low Overhead Data Transfers

Bootstrap Loader (BSL) Scripter User s Guide

Stacking the REF50xx for High-Voltage References

Hands-On: Implementing an RF link with MSP430 and CC1100

Protecting the TPS25810 from High Voltage DFPs

TMS320C6414T/15T/16T Power Consumption Summary

ez430-rf2480 Sensor Monitor SWRU Low-Power RF

SN54155, SN54156, SN54LS155A, SN54LS156, SN74155, SN74156, SN74LS155A, SN74LS156 DUAL 2-LINE TO 4-LINE DECODERS/DEMULTIPLEXERS

Application Report. Low-Power Wireless. Shreharsha Rao... ABSTRACT

Application Report. 1 Overview. Marc Sousa... Power Supply ABSTRACT

DS25BR204 Evaluation Kit

TMS320VC5501/5502 DSP Host Port Interface (HPI) Reference Guide

Application Note AN045

TMS320C55x DSP Peripherals Overview Reference Guide. Preliminary Draft

PRODUCT DATASHEET. Features. IPNetCam Reference Design on DM365 Product Release 1.5.0, Nov 2009

TCI6616/C6670/TCI6608/C6678 Device Simulator EMAC Model I/O user-guide

TPS62290EVM-279. User's Guide SLVU217 July 2007

WL1271 ini File Description and Parameters User's Guide

27 - Line SCSI Terminator With Split Disconnect

MSP430F20xx Device Erratasheet

Ethernet-Enabled Intelligent Display Modules (IDMs)

HV Solar MPPT DC-DC GUI Overview. Getting Started Guide

Increase Current Drive Using LVDS

Using the DSP in the Dual-Core DaVinci as a Graphics Render Engine

4-Level Strap Device Configuration

TMS320VC5510 DSP Host Port Interface (HPI) Reference Guide

DAP Signal Conditioning Board. User s Guide. Data Acquistion Digital/Analog Converters SLAU105

Passing CISPR25-Radiated Emissions Using TPS54160-Q1

WLAN Design Considerations

TVP5146 PDC and VPS APPLICATION NOTE HPA Digital Audio Video

TMS Bit RISC ARM7TDMI -Based Microcontroller Platform

PACKAGE OPTION ADDENDUM

DaVinci System Optimization

OMAP5912 Multimedia Processor Direct Memory Access (DMA) Support Reference Guide

Connecting Bluetooth to the OMAP5910

A DSP/BIOS AIC23 Codec Device Driver for the TMS320C5510 DSK

Maximizing Endurance of MSC1210 Flash Memory

SN64BCT757 OCTAL BUFFER/DRIVER WITH OPEN-COLLECTOR OUTPUTS

Techniques for Profiling on ROM-Based Applications

Stereo Audio Volume Control

Design Considerations for Avoiding Timing Errors during High-Speed ADC, High-Speed ADC, LVDS Data Interface with FPGA

FEATURES APPLICATIONS DESCRIPTION

TFP101, TFP201, TFP401, TFP401A 2Pix/Clk Output Mode

Table 1. EVM Description

User s Guide for Sonic MDIO Software

Debugging Shared Memory Systems

Data sheet acquired from Harris Semiconductor SCHS041D Revised October 2003

In order for this EVM to operate properly, the following components must be connected and properly configured.

2. With the Evaluation Kit DVD, click the Tools button and then click the Code Composer Studio logo to start the setup program.

TMS320C6000 DSP Software-Programmable Phase-Locked Loop (PLL) Controller Reference Guide

A DSP/BIOS AIC23 Codec Device Driver for the TMS320C6416 DSK

SN74BCT756 OCTAL BUFFER/DRIVER WITH OPEN-COLLECTOR OUTPUTS

Using the TMS320VC5509/5510 Enhanced HPI

Designing for Ultra-Low Power with MSP430

EV Software Rev Evaluation System User Guide. Introduction. Contents. Hardware and Software Setup. Software Installation

UART Bootloader for Hercules TMS570LS04x MCU

TMS320VC5409A Digital Signal Processor Silicon Errata

Hardware UART for the TMS320C3x

Configuring Code Composer Studio for OMAP Debugging

UCD3138 Responding to Multiple PMBus Slave Addresses

Using the TMS320C5509 USB Bootloader

Application Note AN057

DRV8833 Evaluation Module. User's Guide

Real-Time Clock Module With NVRAM Control. Time of day in seconds, minutes, and hours

Stereo Audio Volume Control

18-Line SCSI Terminator (Reverse Disconnect) UCC5617 FEATURES DESCRIPTION BLOCK DIAGRAM

Texas Instruments Voltage-Level-Translation Devices

AN-2245 MSP430 Interface to DAC161P997 Code Library

TPS63020EVM-487. User's Guide. 1 Introduction. 1.1 Background. 1.2 Performance Specification

February 2004 PMP Portable Power SLVU101

SN54LVTH16374, SN74LVTH V ABT 16-BIT EDGE-TRIGGERED D-TYPE FLIP-FLOPS WITH 3-STATE OUTPUTS

I2C and the TAS3001C. Introduction. The I2C Protocol. Digital Audio Group ABSTRACT

RapidIO Rev 2.0 for Next-Generation Communication and Embedded Systems. Travis Scheckel Texas Instruments

SN54LS169B, SN54S169 SN74LS169B, SN74S169 SYNCHRONOUS 4-BIT UP/DOWN BINARY COUNTERS

Transcription:

Application Report SLAA309 June 2006 Low-Power Tilt Sensor Using the MSP430F2012 John Fahrenbruch... MSP430 Applications ABSTRACT The MSP430 family of low-power microcontrollers are ideal for low-power smart-sensor applications. This application report describes a method for interfacing an accelerometer to an MSP430F2012, creating a microcontroller-based dual-axis tilt sensor. Using efficient hardware and software design practices, the MSP430 directly interfaces with an accelerometer and drives 12 LEDs with 6 port pins to illuminate the LED oriented at the highest point when the board is tilted. 1 Hardware Description The MSP430F2012 is interfaced with an accelerometer to create a low-power 3-V tilt sensor. To demonstrate functionality, the LED oriented at the highest point is illuminated. Figure 1 shows a system block diagram of the interface between the MSP430, accelerometer, and LEDs. The accelerometer requires 0.45 ma at 3-V V CC. This allows power to be sourced using a port pin from the MSP430 and further power savings by turning the sensor off when not in use. The ADC10 converts the accelerometer s analog output (Xout and Yout) to a binary value. This value is processed by software to determine which LED to illuminate. V CC MSP430F2012 LED Array (6 LEDs) 3-V CR2032 SW1 P2.7 DCO CPU P1.2 P1.3 P1.4 3 Accelerometer V CC Xout Yout Cy P2.6 Cx VLO A0 A1 Timer ADC10 P1.5 P1.6 P1.7 3 LED Array (6 LEDs) V SS Figure 1. Block Diagram All trademarks are the property of their respective owners. SLAA309 June 2006 Low-Power Tilt Sensor using the MSP430F2012 1

Hardware Description www.ti.com The signals output from the accelerometer are converted two times per second, updating the 12 LEDs that are arranged in a circular pattern every 30 degrees on the circuit board shown in Figure 2. Figure 2. Circuit-Board Layout Using multiplexing, it is possible to drive six LEDs with three port pins as shown in Figure 3 and Table 1. Reiterating this concept, 12 LEDs are driven with 6 port pins. Figure 3. LED Network 2 Low-Power Tilt Sensor using the MSP430F2012 SLAA309 June 2006

Software Table 1. LED Multiplexing (1) LED STATUS P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 All Off 0 0 0 0 0 0 #1 On 0 0 0 Z 1 0 #2 On 0 0 0 1 0 Z #3 On 0 0 0 Z 0 1 #4 On 0 0 0 0 1 Z #5 On 0 0 0 0 Z 1 #6 On 0 0 0 1 Z 0 #7 On Z 1 0 0 0 0 #8 On 1 0 Z 0 0 0 #9 On Z 0 1 0 0 0 #10 On 0 1 Z 0 0 0 #11 On 0 Z 1 0 0 0 #12 On 1 Z 0 0 0 0 (1) 0 = low output, 1 = high output, Z = high impedance (pin configured as an input) Clocking the MSP430 core is accomplished with the internal digitally controlled oscillator (DCO) at a factory-calibrated frequency of 1 MHz. The built-in very-low-power/very-low-frequency oscillator (VLO) is designed to operate at 12 khz (typical) and is used to clock the Timer_A module. Using the factory-calibrated DCO as a time base, the VLO frequency can be calculated so that appropriate values can be loaded into Timer_A to achieve accurate timing. This is described in further detail in Section 2. The MSP430F2xx devices have internal programmable pullup/pulldown resistors on each port pin that have been utilized in the switch circuitry to pull to V CC internally. 2 Software By taking advantage of the hardware architecture, the MSP430 family of microcontrollers can be optimized for low power consumption. Peripherals are turned off whenever possible, and the MSP430 is placed in low-power modes that shut down the DCO clock and CPU whenever possible. In this application, the VLO is used to clock peripherals to further conserve power, without the need for a 32.768-kHz watch crystal. Figure 4 shows the software flow chart for the provided code. SLAA309 June 2006 Low-Power Tilt Sensor using the MSP430F2012 3

Software Timer_A0 ISR Enter Timer_A0 ISR Main Initialization VLO, WDT Ports (P1 and P2) ADC10 Timer_A Interrupts Calibrate the Sensor Calibrate Time Constants, Start Timer ADC10 ISR Enter ADC10 ISR Turn Sensor On Initialize 25-ms Delay Clear ADC10IFG RETI Initialize Data Storage Start Sampling RETI Enter ADC10 ISR Turn Sensor Off Process Sensor Output and Turn LED On Initialize 25-ms Delay Turn LEDs Off Initialize Timer Delay for 450 ms Port 2 ISR Enter Port 2 ISR Clear P2 Interrupt Flag Turn LEDs Off Enable P2.7 Interrupt RETI Enter LPM4 Disable P2.7 Interrupt YES Same LED On for 15 Counts? NO Figure 4. Tilt Sensor Software Flowchart Upon power up, the system is initialized and must be placed on a level surface to establish a positional reference. The zero-tilt reference position is used to calibrate the accelerometer at power-up. Timer_A is clocked with ACLK = VLO to determine time constants for delays. Utilizing the 1-MHz factory frequency calibration for the DCO, the VLO frequency can be internally measured, and timer constants for the required delay periods can be calculated. This is done by counting the number of DCO clock cycles per VLO period with Timer_A. 4 Low-Power Tilt Sensor using the MSP430F2012 SLAA309 June 2006

Results After the VLO measurement is complete, the program enters an endless loop of sampling, processing the samples, and flashing the LEDs at two times per second. Initially, the accelerometer is turned on and given 25 ms to stabilize. The minimum time required is 21 ms; however, 25 ms has been used to simplify timing and optimize the delay constant calculations in software. During this time, the MSP430 enters Low Power Mode 3 (LPM3), waiting to wake from a timer interrupt to trigger the ADC10 to begin acquiring X- and Y-axis samples. After the ADC10 is triggered, the MSP430 again enters LPM3 until the ADC10 completes acquisition and storage of the two samples into RAM. Once this is complete, the ADC10 sets the ADC10IFG bit, triggering an interrupt and causing the MSP430 to resume operation in active mode within the ADC10 ISR. The stored conversion data is analyzed, and the appropriate LED is turned on for 25 ms. After 25 ms, the MSP430 enters LPM3 for 450 ms with all LEDs turned off to complete the 500-ms period. A counter variable is used to determine if there is no board movement for 15 simultaneous flashes of the same LED. Should no activity be sensed, the sensor is turned off, LEDs are turned off, P2.7 interrupts are enabled, and the MSP430 is placed in LPM4 (the lowest power mode). To wake from LPM4, the external push-button switch must be depressed, causing an interrupt on port pin P2.7 to resume normal operation. There is a window variable defined in the program. This is used to define the voltage threshold to turn on the middle LED in each quadrant grouping (i.e., LEDs 2, 5, 8, and 11). From the sensor data sheet, the sensitivity is 420 mv/g, meaning that, at rest, the maximum/minimum voltage output is 1.5 V ± 420 mv. By dividing 420 mv by 3, a "voltage window" of 140 mv for each LED is defined. Using quadrant 1 as an example, when tilted off level, LED 10 illuminates between 1.5 V and 1.64 V. LED 12 illuminates between 1.78 V and 1.92 V. By default, any value not falling within the ranges defined illuminates the middle LED, which is LED 11 in this case. Refer to Appendix A: Accelerometer Sensor Operation for additional information concerning the typical usage and implementation. 3 Results The system is powered from a standard CR2032 3-V lithium battery. Using the software flow chart shown in Figure 4, an estimate of average system current consumption (I CC ) can be calculated and is approximately 138 µa over a period of one second. Assuming a safe margin of 80% of the typical 220-mAHr battery life is usable, an estimated system battery life of approximately 1275 hours can be achieved. Further analysis shows that the sensor and LEDs consume 99.5% of the power, while the MSP430 consumes 0.5%. Table 2 shows a breakdown of the current calculations. Table 2. Typical System Current Consumption (for 500 ms) FUNCTION DURATION ACTIVE CURRENT AVERAGE CURRENT MSP430 in active mode (1-MHz DCO at 3 V) 0.15 ms 300 µa 0.05 µa MSP430 in LPM3 with VLO 499.8 ms 0.6 µa 300 na ADC10 On 10 µs 600 µa 0.01 µa Sensor On 25.05 ms 450 µa 11.27 µa LED On 24.9 ms 2.3 ma 57.28 µa Average system current over 500 ms: 68.9 µa Average system current over 1 s: 137.8 µa When the MSP430 has not detected any change in orientation over a period of 15 consecutive samples, the system is powered down, and the MSP430 placed into LPM4. Average current consumption for the entire system in this powered-down state is approximately 0.5 µa. 4 References 1. MSP4302xx Family User s Guide (SLAU144) 2. MSP430F20xx Mixed Signal Microcontroller data sheet (SLAS491) 3. Analog Devices ADXL322 data sheet SLAA309 June 2006 Low-Power Tilt Sensor using the MSP430F2012 5

Appendix A Appendix A Accelerometer Sensor Operation Accelerometers are used for many applications in addition to measuring tilt. A few examples are: vibration, shock, motion, security, and surface leveling. In any case, the accelerometer measures acceleration from the force of gravity (g) and/or actual acceleration. The accelerometer alone cannot differentiate the difference between a static and a dynamic force. A static force would be the force of gravity when the device is at rest and tilt is measured. A dynamic force is measured when the accelerometer is in motion. The output of the accelerometer is the vector addition of the static force (g) plus the dynamic force. Figure A-1 shows the axis orientation for the two-axis accelerometer used in this application report. Figure A-2 is the ideal output voltage when the device is level. The Analog Devices ADXL322 data sheet specifies the typical 0-g bias level to be 1.5 V, measured at the Xout and Yout pins when V CC is 3 V. x y Figure A-1. X-Axis and Y-Axis Orientation x x θ g Earth's Surface Xout = 1.5 V Yout = 1.5 V Figure A-2. Sensor Output When Level Figure A-3 shows the device oriented at some angle that is not parallel to the force of gravity. From the data sheet, the typical sensitivity is 420 mv/g when Vs = 3 V for the ADXL322. g Earth's Surface At 30 degrees Xout = 1.71 V Yout = 1.5 V Figure A-3. Sensor Output When Not Level Equation 1: Calculation for 30 Tilt θ (degrees) = arcsin[(sensor_output 1.5 V) (1/0.420)] θ (degrees) = arcsin[(1.71 V 1.5 V) (1/0.420)] θ (degrees) = arcsin(0.5) θ (degrees) = 30 6 Low-Power Tilt Sensor using the MSP430F2012 SLAA309 June 2006

IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI s terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI s standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed. TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI 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 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. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions: Products Applications Amplifiers amplifier.ti.com Audio www.ti.com/audio Data Converters dataconverter.ti.com Automotive www.ti.com/automotive DSP dsp.ti.com Broadband www.ti.com/broadband Interface interface.ti.com Digital Control www.ti.com/digitalcontrol Logic logic.ti.com Military www.ti.com/military Power Mgmt power.ti.com Optical Networking www.ti.com/opticalnetwork Microcontrollers microcontroller.ti.com Security www.ti.com/security Low Power Wireless www.ti.com/lpw Telephony www.ti.com/telephony Video & Imaging www.ti.com/video Wireless www.ti.com/wireless Mailing Address: Texas Instruments Post Office Box 655303 Dallas, Texas 75265 Copyright 2006, Texas Instruments Incorporated