remote controller of air conditioner using msp430 user's ...p7.5/l5 1 p7.4/l4 2 p7.3/l3 3...
TRANSCRIPT
TI DesignsRemote Controller of Air Conditioner Using MSP430User's Guide
TI Designs Design FeaturesTI Designs provide the foundation that you need • Ultra Low Power with FRAM Technologyincluding methodology, testing and design files to • Infrared Code Sending with Optimized Timerquickly evaluate and customize the system. TI Designs
• Matrix Key Scan for 14 Buttonshelp you accelerate your time to market.• Segment LCD
Design ResourcesFeatured Applications
Design PageTIDU513 • Infrared LCD Remote ControllerMSP430FR4133 Product Folder
ASK Our E2E ExpertsWEBENCH® Calculator Tools
An IMPORTANT NOTICE at the end of this TI reference design addresses authorized use, intellectual property matters and otherimportant disclaimers and information.
All trademarks are the property of their respective owners.
1TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
System Description www.ti.com
1 System DescriptionThis board demonstrates an ultra-low power, general purpose, infrared remote controller solution. Theboard uses a FRAM-based MCU MSP430FR4133, which supports features such as real time clock, buttonscan, infrared encoding, LED backlight, and LCD display.
1.1 MSP430FR4133The MSP430FR4133 is a FRAM-based ultra-low power mixed signal MCU. With the following features, theMSP430FR4133 is highly suitable for portable device applications.• 16-bit RISC architecture up to 16 Mhz• Wide supply voltage range from 1.8 V to 3.6 V• 64-Pin/56-Pin/48Pin TSSOP/LQFP package options• Integrated LCD driver with charge pump can support up to 4x36 or 8x32 segment LCD• Optimized 16-bit timer for infrared signal generation• Low power mode (LPM3.5) with RTC on:0.77 uA• Low power mode (LPM3.5) with LCD on: 0.936 uA• Active mode: 126 uA/MHz• 10^15 write cycle endurance low power ferroelectric RAM (FRAM) can be used to store data• 10-channel, 10-bit analog-to-digital converter (ADC) with built-in 1.5 V reference for battery powered
system• All I/Os are capacitive touch I/O
2 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com Circuit Design
2 Circuit DesignThe highly-integrated mixed signal processer MSP430FR4133 has a small amount of componentsnecessary to realize a fully-functional air conditioner remote controller.
Refer to Figure 1 for the design block diagram.
Figure 1. Remote Controller Block Diagram
A 4x28 segment LCD is directly connected to the MSP430FR4133 LCD driver pins. Designers can swapthe COM and SEG pins to simplify the PCB layout.
A 4x4 matrix is used to detect 15 buttons. The matrix columns are connected to interrupt-enabled GPIOs(P1) to wake up the MSP430FR4133 from low power mode. MCU internal pull up/pull down resistors areused as button scan matrix pull up resistors. No external resistor is needed for button detection, and noexternal circuit is needed for battery voltage detection. The function is also realized by the MCU ADCmodule without any external component.
3TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Circuit Design www.ti.com
A 32.768 KHz watch crystal serves as the MCU FLL and RTC clock source. Two chip capacitors, C4 andC6, are used as the crystal loading capacitor. Designers must choose C4 and C6 values carefullyaccording to crystal specification. Cautious PCB layout design for the crystal is strongly recommended, tosecure system clock robustness. Figure 2 illustrates an example of the crystal PCB design.
Figure 2. Crystal PCB Layout
Refer to SLAA322B-MSP430 32-kHz Crystal Oscillators for detailed design considerations.
4 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com Software Description
3 Software DescriptionThe software implements an interrupt-driven structure. In the main loop, the MCU stays in LPM3.5 mode.Interrupts from the button, RTC, and timer wake up the MCU for task processing. Inputs from the buttonare processed in task KeyProcess (), which handles system status and generates the content for the LCDdisplay and infrared signal. RTC generates a 3S interval interrupt to inform the system of battery voltagemeasurement.
Figure 3. Software Structure
3.1 Infrared Signal GenerationThere are several kinds of infrared modulation protocols in the industry. This design illustrates pulsedistance protocol with data frame format, the most commonly-used format for air conditioner remotecontrollers. As shown in Figure 4, each bit is composed of a carrier-modulated pulse and a space. Thespace’s width distinguishes logic 1 and logic 0 respectively. The carrier-modulated pulse width is constant.In this design, space length for 1 is 1690 uS, and 560 uS for digit 0. Modulated pulse width is 560 uS.
Figure 4. Pulse Distance Protocol, Bit Encoding
5TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Software Description www.ti.com
A complete data frame format is shown in Figure 5.
Figure 5. Pulse Distance Protocol, Data Frame Format
The envelope waveform depends on the frame format. Quantize all of the above items with a minimumtime slot of 0.56 ms, as shown in Table 1.
Table 1. Table 1. Pulse Distance Protocol, Data Encoding Quantization Table
Leading Code Logic ‘1’ Logic ‘0' Tail CodeCarrier Carrier Carrier CarrierItems
Modulated Space Modulated Space Modulated Space Modulated SpacePulse Pulse Pulse Pulse
Length 9 ms 4.5 ms 0.56 ms 1.69 ms 0.56 ms 0.56 ms 0.56 ms 0 msQuantizatio 16 8 1 3 1 1 1 0n
TA1 is used to generate an envelope waveform, and each pair of carrier-modulated pulse and space mustupdate the CCR0 and CCR2 once. The CCR0 depends on the carrier-modulated pulse period plus thespace period, while the CCR2 depends on the carrier-modulated pulse period. For instance, if TA1sources from SMCLK of 4 MHz and uses default divider configuration, CCR0 and CCR2 are individuallyconfigured as 54,000 and 36,000, to generate the leading code (9 ms carrier modulated pulse paired with4.5 ms space), and updated to 9,000 and 2,240 for logic 1 (see Figure 6). To send one full data frame,CCR0 and CCR2 must be updated 34 (1+8*2+8*2+1) times, which is achieved in the TA1 interruptroutine.
Figure 6. Pulse Distance Protocol, TA1 in Envelope Generation
6 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com Test Setup and Results
To generate 38 kHz carrier with ¼ duty, CCR0 and CCR2 of TA0 are configured according to SMCLK. Forexample, with a 4 MHz SMCLK, CCR0 and CCR2 are individually configured to be 105 (4,000/38) and 26(4,000/38/4). Figure 7 shows how the duty setting works.
Figure 7. Pulse Distance Protocol, TA0 in Carrier Generation
4 Test Setup and Results
4.1 Power and Infrared Code Test2 AAA batteries power the board. By pressing the button pads with conductors, the user can observe thecontents on the LCD. Typical air-conditioner working modes and parameters can be configured. A micro-ampere meter is inserted in the power path to monitor the board power consumption as shown in Figure 8.Table 2 shows the sample board test results. To observe the infrared signal, use P1.0 with anoscilloscope. Figure 9 shows the infrared driving signal, typically 38 KHz PWM carriers, 30% duty.
7TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Test Setup and Results www.ti.com
Figure 8. Current Test Setup
8 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com Test Setup and Results
Figure 9. Infra Transmitter Driving Signal from MCU
Table 2. Power Consumption Test Result (VCC = 3.0 V with RTC ON and LCD ON, LPM3.5)
Board NO# Vcc(V) Low Power Mode with RTC and LCD ON Standby Current (uA)1# 3.0 LPM3.5 2.62# 3.0 LPM3.5 3.43# 3.0 LPM3.5 3.64# 3.0 LPM3.5 2.8
9TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Test Setup and Results www.ti.com
4.2 Oscillation Frequency, Peak-Peak Voltage and Allowance TestThe ultra-low power 32.768 KHz crystal is the MCU RTC clock source and FLL reference clock source. Itis essential to secure the robustness from noises. According to SLAA322B-MSP430 32-kHz CrystalOscillators, the user can test the oscillation frequency and allowance to calculate the SF (Safety Factor),and evaluate system clock robustness. As described in SLAA322B, the SF should be greater than 3.
To perform the oscillation frequency test, download FR4133CrystalTest.c to the board. Then observe theMCLK frequency on P1.4, which indicates crystal oscillation frequency.
For an oscillation peak-peak voltage test, observe the signal on XOUT with a low capacitor (<2 pF) probe.For an oscillation allowance test, add a resistor (Rq) in series with the crystal, as shown in Figure 10.
Figure 10. Oscillation Allowance Test with Added Resister Rq
Table 3 shows the test results of sample boards with different value Rq.
Table 3. Oscillation Test with VCC = 3.0 V, Temperature = 25℃℃,,Crystal ESR = 35 KOhm
Rq = 0Ohm Rq=100KOhm Rq=200KOhmBoard SF
Freq.(Khz) Vp-p(mV) Freq.(Khz) Vp-p(mV) Freq.(Khz) Vp-p(mV)1# 32.769 512 32.770 616 32.770 560 >6.72# 32.769 504 32.770 624 32.770 568 >6.73# 32.770 448 32.770 536 32.771 488 >6.74# 32.769 488 32.770 560 32.770 520 >6.75# 32.770 512 32.770 600 32.771 584 >6.76# 32.769 472 32.770 568 32.771 528 >6.77# 32.770 630 32.768 608 32.769 520 >6.78# 32.767 480 32.770 576 32.770 536 >6.7
As shown in Table 3, even with a 200 KOhm resistor added in series with the crystal, the crystal worksnormally, which indicates the SF is greater than 6.7.
10 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
1
1
2
2
3
3
4
4
D D
C C
B B
A A
Title
Number RevisionSize
A
Date: 2014-9-11 Sheet ofFile: Z:\Share_Folder\..\RemoteControlerB.SchDocDrawn By:
XOUTXIN
DVCCGND
RSTTEST
L0L1L2L3L4L5 L8
L9L10L11L12L13L14L15L16L17L18L19L20L21L24L25L26L27
C16101GND
KEYOUT4KEYOUT3KEYOUT2KEYOUT1
KEYSHIFT
BACKLI GHTKEYIN1
KEYIN2KEYIN3KEYIN4
P7.5/L51
P7.4/L42
P7.3/L33
P7.2/L24
P7.1/L15
P7.0/L06
P4.7/R137
P4.6/R238
P4.5/R339
P4.4/LCDC210
P4.3/LCDC111
P4.2/XOUT12
P4.1/XIN13
DVSS14
DVCC15
RST/NMI/SBWTDIO16
TEST/SBWTCK17
P4.0/TA1.118
P8.3/TA1.219
P8.2/TA1CLK20
P1.7/TA0.1/TDO/A721
P1.6/TA0.2/TDI/TCLK/A622
P1.5/TA0CLK/TMS/A523
P1.4/MCLK/TCK/A424
P1.3/UCA0STE/A325
P1.2/UCA0CLK/A226
P1.1/UCA0RXD/UCA0SOMI/A1/Veref+27
P1.0/UCA0TXD/UCA0SIMO/A0/Veref–28
P5.5/L3729
P5.4/L3630
P5.3/UCB0SOMI/UCB0SCL/L3531
P5.2/UCB0SIMO/UCB0SDA/L3432
P5.1/UCB0CLK/L3333
P5.0/UCB0STE/L3234
P2.7/L3135
P2.6/L3036
P2.5/L2937
P2.4/L2838
P2.3/L2739
P2.2/L2640
P2.1/L2541
P2.0/L2442
P6.5/L2143
P6.4/L2044
P6.3/L1945
P6.2/L1846
P6.1/L1747
P6.0/L1648
P3.7/L1549
P3.6/L1450
P3.5/L1351
P3.4/L1252
P3.3/L1153
P3.2/L1054
P3.1/L955
P3.0/L856
U1
MSP430FR4133
SEND
32768
C6
200
C4
200
GND
1234
P1
JTAG-SBW
C9105
RSTTEST
DVCC
104
C1
104
C2
104
C3
104C5
GND
1M
R1
0RR2
47KR3
GND
C8
106
C7
104
GND2KR4
L28L29L30L31
GND
VCC
C14
106
C15
104
C10
104
C11
104 100uF
C13
3V
+1
|2
U2
Battery
4.7uF
C12
DVCC
GND
KEYSHIFT
1 2
SHIFT
Button-2p
1 2FAN
Button-2p
1 2MODE
Button-2p
1 2ON/OFF
Button-2p
1 2LIGHT
Button-2p
1 2+
Button-2p
1 2TURBO
Button-2p
1 2SAVE
Button-2p
1 2-
Button-2p
1 2SILENT
Button-2p
1 2
HEAT/HEALTH.AIR
Button-2p
1 2
TEMP.DIS
Button-2p
1 2
COLD/BLOW.HEAT
Button-2p
1 2
TIMER/SWINGUD
Button-2p
1 2
SLEEP/SWINGLR
Button-2p
KEYIN4 KEYIN3 KEYIN2 KEYIN1
KEYOUT1
KEYOUT2
KEYOUT3
KEYOUT4
L0L1L2L3L4L5
L28L29
L8L9L10L11L12L13L14L15
L16L17L18L19L20L21L24L25L26L27
123456789
101112131415
16171819202122232425262728
J1
Header14*2
Q2
VCC
SEND
GND
Q1
GND
VCC
BACKLI GHT
0R
R5
0R
R6
220RR9
100KR11
2R2
R7
300R
R8
10R
R10
L30L31
LED1Infrared Radiation
LED2Backlight
none
COM1COM2COM3COM4
www.ti.com Design Files
5 Design Files
5.1 SchematicsTo download the schematic, see the design files at http://www.ti.com/tool/TIDU513
Figure 11. Schematic
11TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Design Files www.ti.com
5.2 Bill of MaterialsTo download the bill of materials (BOM), see the design files at http://www.ti.com/tool/TIDU513.
Table 4. BOMDesignator Description Quantity
+, -, COLD/BLOW.HEAT, FAN, HEAT/HEALTH.AIR, Buttons 14LIGHT, MODE, ON/OFF, SAVE, SILENT,SLEEP/SWINGLR, TEMP.DIS, TIMER/SWINGUD,TURBO
C1, C2, C3, C5 0805, Chip Capacitor, X7R,16 V, +-10% 4
C4, C6 0805, Chip Capacitor Chip Capacitor 200 X7R,16 V, +- 210%
C7, C10, C11, C14 0805, Chip Capacitor 104 X7R, 16 V, +-10% 4
C8, C16 0805, Chip Capacitor 106 X7R,16 V, +-10% 1
C9 0805, Chip Capacitor 105 X7R,16 V, +-10% 1
C12 0805, Chip Capacitor Cap Pol1 X7R,16 V, +-10% 1
C13 0805, Chip Capacitor Cap Pol1 X7R,16 V, +-10% 1
C15 0805, Chip Capacitor 102 X7R,16 V, +-10% 1
Crystal 32.768 Khz crystal 1
J1 Header14*2 1
LED1 Infrared Radiation transmitter 1
LED2 Backlight LED 1
P1 JTAG-SBW 1
Q1, Q2 Transistor 2
R1, R2, R3, R4, R5, R6, R8, R9, R10, R11 0805 Chip Resistor 10
R7 0805 Chip Resistor 1
SHIFT Button 1
U1 MSP430F4133 1
U2 Battery 1
12 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com Design Files
5.3 PCB LayoutTo download the layer plots, see the design files at http://www.ti.com/tool/TIDU513.
13TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Design Files www.ti.com
Figure 12. PCB Layer 1
14 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com Design Files
Figure 13. PCB Layer 2
15TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Design Files www.ti.com
5.4 Gerber FilesTo download the Gerber files, see the design files at http://www.ti.com/tool/TIDU513.
6 Software FilesTo download the software files, see the design files at http://www.ti.com/tool/TIDU513
16 Remote Controller of Air Conditioner Using MSP430 User's Guide TIDU513–October 2014Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com About the Author
7 About the AuthorJASON GUO is a system application engineer at Texas Instruments, where he is responsible fordeveloping reference design solutions for the industrial segment. Jason earned his Engineering Master ofIntegrated Circuits Design from Peking University, and Bachelor of Electronic Engineering from ShanghaiJiaotong University.
17TIDU513–October 2014 Remote Controller of Air Conditioner Using MSP430 User's GuideSubmit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
IMPORTANT NOTICE FOR TI REFERENCE DESIGNS
Texas Instruments Incorporated ("TI") reference designs are solely intended to assist designers (“Buyers”) who are developing systems thatincorporate TI semiconductor products (also referred to herein as “components”). Buyer understands and agrees that Buyer remainsresponsible for using its independent analysis, evaluation and judgment in designing Buyer’s systems and products.TI reference designs have been created using standard laboratory conditions and engineering practices. TI has not conducted anytesting other than that specifically described in the published documentation for a particular reference design. TI may makecorrections, enhancements, improvements and other changes to its reference designs.Buyers are authorized to use TI reference designs with the TI component(s) identified in each particular reference design and to modify thereference design in the development of their end products. HOWEVER, NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPELOR OTHERWISE TO ANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY THIRD PARTY TECHNOLOGYOR INTELLECTUAL PROPERTY RIGHT, IS GRANTED HEREIN, including but not limited to 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 awarranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectualproperty of the third party, or a license from TI under the patents or other intellectual property of TI.TI REFERENCE DESIGNS ARE PROVIDED "AS IS". TI MAKES NO WARRANTIES OR REPRESENTATIONS WITH REGARD TO THEREFERENCE DESIGNS OR USE OF THE REFERENCE DESIGNS, EXPRESS, IMPLIED OR STATUTORY, INCLUDING ACCURACY ORCOMPLETENESS. TI DISCLAIMS ANY WARRANTY OF TITLE AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE, QUIET ENJOYMENT, QUIET POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTYINTELLECTUAL PROPERTY RIGHTS WITH REGARD TO TI REFERENCE DESIGNS OR USE THEREOF. TI SHALL NOT BE LIABLEFOR AND SHALL NOT DEFEND OR INDEMNIFY BUYERS AGAINST ANY THIRD PARTY INFRINGEMENT CLAIM THAT RELATES TOOR IS BASED ON A COMBINATION OF COMPONENTS PROVIDED IN A TI REFERENCE DESIGN. IN NO EVENT SHALL TI BELIABLE FOR ANY ACTUAL, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANYTHEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, ARISING INANY WAY OUT OF TI REFERENCE DESIGNS OR BUYER’S USE OF TI REFERENCE DESIGNS.TI reserves the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services perJESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevantinformation before placing orders and should verify that such information is current and complete. All semiconductor products are soldsubject 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 termsand conditions of sale of semiconductor products. Testing and other quality control techniques for TI components are used to the extent TIdeems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is notnecessarily performed.TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products andapplications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provideadequate design and operating safeguards.Reproduction of significant portions of TI information in TI data books, data sheets or reference designs is permissible only if reproduction iswithout alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable forsuch altered documentation. Information of third parties may be subject to additional restrictions.Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirementsconcerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or supportthat may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards thatanticipate dangerous failures, monitor failures and their consequences, lessen the likelihood of dangerous failures and take appropriateremedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components inBuyer’s safety-critical applications.In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is tohelp enable customers to design and create their own end-product solutions that meet applicable functional safety standards andrequirements. 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 partieshave executed an agreement specifically governing such use.Only those TI components that TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use inmilitary/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components thathave not been so designated is solely at Buyer's risk, and Buyer is solely responsible for compliance with all legal and regulatoryrequirements 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 ofnon-designated products, TI will not be responsible for any failure to meet ISO/TS16949.IMPORTANT NOTICE
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265Copyright © 2014, Texas Instruments Incorporated