msp430 manual

Upload: rajendrasoloni

Post on 12-Oct-2015

122 views

Category:

Documents


0 download

DESCRIPTION

Msp430 Manual

TRANSCRIPT

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 1

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 2

    INDEX

    CHAPTERS

    1. CHAPTER 1: GENERAL DESCRIPTION 1.1 Specification 1.2 Introduction

    2. CHAPTER 2 : INSTALLATION 2.1 CD Content 2.2 Block Diagram 2.3 Applying Power 2.4 System Requirements 2.5 Hyper Terminal Communication Package 2.6 Tutorial Software

    3. CHAPTER 3 : SPECIFICATIONS OF MSP430 3.1 MSP430F449 Description

    4. CHAPTER 4 : HARDWARE DETAILS 4.1 Connector Details 4.2 On-Board Interfaces

    4.2.1 Slide Switch (SW1) 4.2.2 Serial Interface 4.2.3 LCD Interface 4.2.4 Six Digit Multiplexed 7-Segment Displays 4.2.5 Keypad(4 Rows X 4 Columns) 4.2.6 Temperature Sensor(LM335 D11) & 12Bit ADC 4.2.7 High Current O/P Lines and Relay Interface 4.2.8 Elevator 4.2.9 DAC(DAC0800) 4.2.10 SPI ADC

    4.3 Jumper Description 4.4 PowerMate Detail 4.5 Relimate Detail

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 3

    5. CHAPTER 5 : SOFTWARE DEVELOPMENT DETAILS 5.1 Software Installation 5.2 Creation of New Project and simulation. 5.3 Program Downloading 5.4 Procedure to Creating the new Project and Simulating

    6. CHAPTER 6 : DEMO PROGRAMS ON THE BOARD 6.1 Demo Programs in IAR V5.3 6.2 Assembly programs 6.3 4X4 Key Matrix 6.4 UART Test 6.5 7 Segment Display 6.6 Elevator 6.7 Temperature Sensor 6.8 ADC 6.9 Stepper Motor 6.10 DC Motor 6.11 LED Toggle 6.12 DAC 6.13 Alphanumerical LCD 6.14 SPI ADC

    7. CHAPTER 7 : TROUBLE SHOOTING

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 4

    CHAPTER 1

    1.1 SPECIFICATIONS OF MSP430 EVALUATION BORAD

    The MSP430 Evaluation Board is powered by an external Power Supply of +5V.

    The MSP430 Evaluation Board can be used to understand the operation of on chip UART

    & SPI interfaces, ADC conversion, PWM generation, pulse width, capture, compare, LCD

    display, Comparator, temperature sensor.

    SPECIFICATIONS OF MSP430:

    The key features of the MSP430x44x family include, Ultra low-power architecture extends

    battery life

    60 KB flash and 512 bytes RAM.

    Low supply voltage range 1.8V to 3.6V.

    16 bit TimerA with 3 capture/compare, 16 bit TimerB with 7 capture/compare

    12-bit ADC 200 ksps, temperature sensor, with internal reference Vref

    Five Power Saving operating modes (mode 0-4), wake up from standby mode in

    less than 6 microseconds.

    Supply voltage supervisor.

    On-chip comparator.

    16-bit RISC CPU enables new applications at a fraction of the code size.

    Compact core design reduces power consumption and cost

    Optimized for modern high-level programming

    Only 27 core instructions and seven addressing modes, 125 nanosecond

    instruction cycle time.

    Extensive vectored-interrupt capability

    In-system programmable Flash permits flexible code changes, field upgrades and

    data logging.

    The following figure shows the architecture of the MSP430.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 5

    1.2 INTRODUCTION

    The ALS-SDA-MSP430-02 Evaluation Board is a comprehensive aid to understand the

    capabilities of an advanced micro controller.

    The MSP430F449- 16-bit micro controller (U1) with operating frequency from 0.6MHz-

    46MHz with an external crystal and supply voltage of +5V.

    It has 60K+256 bytes RAM.

    The Three 10 pin FRC connectors CN7 to CN9 connected to Port-2, to Port-4 of

    the on-board interfacing circuits include the study circuits of the internal

    features of the controllers such as , SPI, UART, External Interrupts, etc

    One 26 pin FRC to connect the ALS standard NIFC to the board

    A USB connector CN17 is used for RS232 serial I/O interface for UART

    experiments.

    A 9 pin D-type male Connector CN2 is meant for power connection

    (+5V,VCC(3.3V) and GND).

    A Slide switch SW1 to select either program mode or run mode.

    A Push button switches SW2 for External Interrupt.

    Two numbers of LED's are provided for general purpose.

    16 switches (From 0 to F) organized in 4 rows X 4 columns.

    8bit ADC(U9) and 8 bit DAC(U11)

    Six numbers of seven segment multiplexed displays (U16-U21)

    One ADC (ADC0809) with a Potentiometer to vary analog input & Temperature

    Sensor IC LM335 (D11).

    Elegant enclosure with Test Points for monitoring (TPs)

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 6

    CHAPTER 2 INSTALLATION

    2.1 CD CONTENTS: CD Basically Contents the following folders

    Manual

    EXE_Files

    1. Ft232r_drivers

    2. Mspfet

    3. Serial to usb driver

    4. Fet_r605 (IAR kick start)

    Software

    2.2 Block Diagram:

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 7

    2.3 Applying Power :

    After unpacking the system, if no visual damages are noticed use the following

    procedure to apply power.

    Connect a 9-pin DSUB Female Connector to a 9-pin DSUB Male connector CN2

    provided on the MSP430 Evaluation Board. The color code for the supply is

    Pin No Voltages Color Code (Female)

    9 VCC(+5V) Orange/White/Blue

    4,5 GND Yellow/Black

    2.4 System Requirements:

    Pentium-class host PC running Microsoft Xp, Windows 7.

    Tools like IAR and MSPFET

    FT232-Driver to make the use of USB port.

    ISP TOOL

    One working COM port (Eg: COM1) in the host computer system.

    Hyper Terminal

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 8

    2.5 SOFTWARE INSTALLATION

    1) IAR v5 installation

    Step 1: Double click on FET_R605.exe.

    Step 2: Click Setup.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 9

    Step3: Click on Next.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 10

    step 4: select I accept the terms of the licensed agreement. Then click next.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 11

    Step 5: Check complete and then click Next.

    Step 6: Click Next.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 12

    Step7: Click Next.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 13

    Step 8: Click Install.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 14

    Step 10: Automatic installs the Drivers no need to select anything.

    Step 9: Automatic starts the installation..

    Step 11: Click Finish.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 15

    Step 12: Go to the path as given in this screen shot.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 16

    Step 13: Creating short cut to the desktop.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 17

    MSPFET Installation

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 18

    Step 1: Go to EXE folder in the CD or your drive and run MSPFET.exe file.

    Step 2: Right click on MSPFET file-> Create short cut to the desktop.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 19

    FT232 DRIVER INSTALLATION:

    Go to FT232 driver Installation folder and then to setup executable file.

    Click on the CDM20802_setup file.

    Continue the execution process till FINISH.

    Now connect the USB to the connector of the EMB_EVAL_04 and switch on the

    Power supply.

    Now go to device manager and check for the Ports available.

    If the FT232 driver has installed then you get an option like USB Serial port.

    2.6 Hyper Terminal Communication Package:

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 20

    After download, connect MSP430 evaluation board to a computer, & open Hyper

    Terminal of Windows. This allows the user to use computer as a simple display terminal

    for MSP430 evaluation board and to transfer data between computer and MSP430

    evaluation board. To use the Hyper Terminal communication follow the below given

    steps.

    - Go to Start menu; select the Programs sub menu, select Accessories

    Communications Hyper Terminal.

    - Give the name for Hyper Terminal you want and then press OK.

    - The window Connect To will appear, Select the COM1 in Connect Using

    option.

    - In the window Port Settings set the settings as

    Bits per Sec: 9600

    Data bits: 8

    Parity: None

    Stop bits: 1

    Flow control: None

    Then Apply OK

    - Go to File Save

    - Bring the Shortcut icon for Hyper Terminal on the Desktop of your computer.

    Note: Better restart the system for updating installations.

    2.7 Tutorial Software: Example softwares to study the features of the MSP430

    evaluation board, 4 channels 8-bit ADC, temperature sensor, serial communication,

    elevator interface, etc. are provided in the CD-ROM. And also the data sheets of the

    related devices interfaced on the board are provided in the CD.

    CHAPTER 3

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 21

    CONTROLLER SPECIFICATIONS

    3.1) SPECIFICATION FOR MSF430F449 EVALUATION BOARD:

    MSP430F44x is a Texas Instruments Low Power 16-bit Microcontroller Operating at

    3.3V DC. The MSP430F44x processor is based on Reduced Instruction Set (RISC)

    architecture, and the instruction set and related decode mechanism are much simpler

    than those of micro programmed Complex Instruction Set Computers. This simplicity

    results in a high instruction throughput and impressive real-time interrupt response from

    a small and cost-effective processor Core. The controller includes the following features:

    1 60KB + 256B flash Program Memory. 2 2KB Static RAM. 3 48 I/O lines (Six ports of Eight bit each). 4 Four low power operating modes. 5 Three 16-bit Timers/Counters. 6 Capture, Compare and PWM modules. 7 On Chip Comparator. 8 Two UART multiplexed with SPI. 9 12-bit ADC with 8 Channel and internal reference. 10 Integrated LCD driver for up to 40 segments. 11 Onchip JTAG debugging and programming capability. 12 Internal Digital Controlled Oscillator in range of 0.6 to 46 MHz. 13 Two Software Selectable External crystal XT1 (32.768 kHz) and XT2 (450 kHz 8

    MHz).

    14 Processor wake-up from Power-down mode via external interrupt. 15 Individual enable/disable of peripheral functions for power optimization.

    ON BOARD INTERFACES:

    1 3 digit LCD display directly interfaced to controller. 2 SPI, 12-bit ADC. 3 Multiturn preset and temperature sensor to study Onchip 12-bit ADC. 4 Input switches and output LEDs connected to port lines. 5 16x2 alphanumeric displays with back lighting. 6 Push button and switch for resetting and programming the controller. 7 Two on-board FRC connector to interface controller with on-board peripheral or

    external peripheral device

    7 Unused controller lines terminated in berg headers. 8 A number of Software examples in C language to illustrate the functioning of

    the interfaces and the low power modes. The software examples are compiled

    using an evaluation version of C compiler.

    9 External programming adapter interfaced to COM port of PC, to download code to controller Flash memory.

    10 Power supply adapter 230VAC to 5VDC, 1A.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 22

    CHAPTER 4 HARDWARE DETAILS

    4.1 CONNECTOR DETAIL:

    1)CN2: Pin D-type Male Power connector.

    Pin No. Description

    1,2,3,6,7,8 No Connection

    4 GND

    5 GND

    9 VCC (+5V)

    2) CN1: 10 PIN FRC is connected for ISP tool for to fuse the program.

    PIN No. CONNECTED TO

    1 BSL/COMP

    2 TCK

    3 BSL_RX

    4 /RST/NMI*

    5 GND

    6 VCC

    7 NO CONNECTION

    8 NO CONNECTION

    9 NO CONNECTION

    10 NO CONNECTION

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 23

    3) CN3: 14 PIN FRC male connector for JTAG connection.

    PIN No. CONNECTED TO

    1 TDO

    2 JP2(1)

    3 TDI

    4 JP1(1)

    5 TMS

    6 XOUT

    7 TCK

    8 NO CONNECTION

    9 GND

    10 XIN

    11 RST/NMI

    12 NO CONNECTION

    13 NO CONNECTION

    14 NO CONNECTION

    4) CN7:10 pin FRC connected to Port-2 of the controller, which can be connected to on

    board compatible interface circuits.

    Pin No. Description

    1 Port line P2.0

    2 Port line P2.1

    3 Port line P2.2

    4 Port line P2.3

    5 Port line P2.4

    6 Port line P2.5

    7 Port line P2.6

    8 Port line P2.7

    9 No connection

    10 GND

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 24

    5) CN8: 10 pin FRC connected to Port-3 of the controller, which can be connected to on

    board compatible interface circuits.

    Pin No. Description

    1 Port line P3.0

    2 Port line P3.1

    3 Port line P3.2

    4 Port line P3.3

    5 Port line P3.4

    6 Port line P3.5

    7 Port line P3.6

    8 Port line P3.7

    9 No connection

    10 GND

    6) CN9: pin FRC connected to Port-4 of the controller, which can be connected to on

    board compatible interface circuits.

    Pin No. Description

    1 Port line P4.0

    2 Port line P4.1

    3 Port line P4.2

    4 Port line P4.3

    5 Port line P4.4

    6 Port line P4.5

    7 Port line P4.6

    8 Port line P4.7

    9 No connection

    10 GND

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 25

    9) Alphanumeric LCD Connector CN5 (16 pin female berg):

    PIN No. CONNECTED TO

    1 GND

    2 +5V

    3 LCD_RS

    4 R22 POT

    5 GND

    6 LCD_EN

    7 NO CONNECTION

    8 NO CONNECTION

    9 NO CONNECTION

    10 NO CONNECTION

    11 LCD_D0

    12 LCD_D1

    13 LCD_D2

    14 LCD_D3

    15 BACK_LT

    16 NO CONNECTION

    9) Connector CN18:26 pin male FRC

    PIN No. CONNECTED TO PIN No. CONNECTED TO

    1 P4.4 14 P3.1

    2 P4.5 15 P2.6

    3 P4.2 16 P2.7

    4 P4.3 17 P2.4

    5 P4.0 18 P2.5

    6 P4.1 19 P2.2

    7 P3.6 20 P2.3

    8 P3.7 21 P2.0

    9 P3.4 22 P2.1

    10 P3.5 23 P4.6

    11 P3.2 24 P4.7

    12 P3.3 25 VCC

    13 P3.0 26 GND

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 26

    9) 3 Digit lcd Connector CN19:

    PIN No. CONNECTED TO PIN No. CONNECTED TO

    1 S0 26 S25

    2 S1 27 S26

    3 S2 28 S27

    4 S3 29 S28

    5 S4 30 S29

    6 S5 31 S30

    7 S6 32 S31

    8 S7 33 S32

    9 S8 34 S33

    10 S9 35 COM0

    11 S10 36 P5.2/COM1

    12 S11 37 P5.3/COM2

    13 S12 38 P5.4/COM3

    14 S13 39 GND

    15 S14 40 GND

    16 S15

    17 S16

    18 S17

    19 S18

    20 S19

    21 S20

    22 S21

    23 S22

    24 S23

    25 S24

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 27

    9) Connector CN20:14 pin male FRC

    PIN No. CONNECTED TO

    1 ACLK

    2 SMCLK

    3 P5.1/S0

    4 P5.2/COM1

    5 P5.3/COM2

    6 P5.4/COM3

    7 VeREF+

    8 VREF-/VeREF-

    9 P1.7

    10 P6.1/A1

    11 NOT CONNECTED

    12 NOT CONNECTED

    13 GND

    14 VCC

    4.2 ON-BOARD INTERFACES:

    4.2.1 Slide Switch (SW1):

    The slide switch SW1 is used for programming the flash memory. When this switch

    is in PROG mode on the board the pin /RST/NMI (Pin-94 of U1) goes low forcing the

    on-chip boot loader execution. When the switch SW1 is in RUN mode the pin /RST/NMI

    is released high through a resistor and user application will be executed.

    4.2.2 Serial Interface:

    The board has a USB B-TYPE serial communication port. The Tx and Rx signals

    that appear on the USB B-TYPE connector CN17. Use a standard USB TO B-TYPE cable

    to connect the board to the computer's use USB port connector. The controller device

    MSP430F449 (U1) supplies serial I/O data at TTL levels to the FT232R device (U15).

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 28

    4.2.3 Alphanumeric LCD connector RM1(16 pin female berg) :

    PIN No. CONNECTED TO CONTROLLER PORT No.

    1 GND -

    2 +5V -

    3 R9 POT -

    4 LCD_RS P6.6

    5 GND -

    6 LCD_EN P6.7

    7 NO CONNECTION

    8 NO CONNECTION

    9 NO CONNECTION

    10 NO CONNECTION

    11 LCD_D0 P6.2

    12 LCD_D1 P6.3

    13 LCD_D2 P6.4

    14 LCD_D3 P6.5

    15 BACK_LT P1.3

    16 NO CONNECTION -

    RS = 0 for sending Command to the LCD

    RS = 1 for sending Data to the LCD

    R/W = 0 for reading from the LCD

    R/W = 1 for writing to the LCD

    EN = 0 for disabling the LCD

    EN = 1 for enabling the LCD

    4.2.4 Six Digit Multiplexed 7-Segment Displays:

    There are six multiplexed 7-segment display units (U16, U17, U18, U19,

    U20 and U21) on the board. Each display has 8-inputs SEG-A (Pin-7), SEG-B (Pin-6),

    SEG-C (Pin-4), SEG-D (Pin-2), SEG-E (Pin-1), SEG-F (Pin-9), SEG-G (Pin-10) and SEG-

    H (Pin-5) and the remaining pins pin-3 & pin-8 are Common Cathode CC. These

    segments are common cathode type hence active high devices. The port lines P2.4 to

    P2.7 are used to select one of the four digits as shown in the table below. These signals

    P2.4 to P2.7 are used as inputs to the 74LS145 (U3) and the output lines of the

    decoder are used as enable lines for six 7-segment displays. The port lines P3.0 to P3.7

    are used as segment lines for the six digits through the 74HCT244 buffer (U4).

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 29

    Selection Of seven segment displays:

    P2.7 P2.6 P2.5 P2.4 Display unit

    selected

    0 0 0 0 U16

    0 0 0 1 U17

    0 0 1 0 U18

    0 0 1 1 U19

    0 1 0 0 U20

    0 1 0 1 U21

    4.2.5 Keypad (4 Rows X 4 Columns):

    The switches 0 to F are organized as 4 rows X 4 columns matrix. One end of all

    the switches are connected to port lines P2.4 P2.7, which are configured as columns.

    The other end of the matrix is connected to the port lines P2.0 P2.3 which are

    configured as rows. The interface diagram for keypad is shown below.

    Operation: Initially take one column line to logic HIGH, then check for each row. If

    first row is at logic '0' and other rows are at logic '1' then save the read data and

    compare with the look-up table. Similarly repeat the procedure for all the columns

    4.2.6 Temperature Sensor (LM335 D14) & 12-Bit ADC:

    The channel-0 of the 8-channel 8-bit ADC device U9 (ADC0809) is connected to

    the preset voltage (POT R33) varying from 0V to 4.5V. The Channel-1 is connected to

    the Relay mate to feed the analog channel externally (Before feeding any channel make

    sure it not more than 5V). The temperature sensor device used in this interfacing block

    is LM335 (D11). The sensor device is connected to the Channel 2 (CH2) of the

    ADC0809 (U9). The port lines PX.1, PX.2 & PX.3 are used for Channel selection. The

    circuit diagram for ADC interface is as shown in next page.

    4.2.7 High Current Output Lines and Relay Interface:

    Any of the 3 ports can be used for High Current applications where a stepper

    motor, a Dc motor are interfaced through the high current driver ULN2803. These lines

    will have high current (max 300 mA) with low voltage level of 0.7V.

    The Stepper motor can be interfaced to the board by connecting it to the

    Powermate PM1. The rotating direction of the stepper motor can be changed.

    The DC Motor can also be interfaced to the board by connecting it to the Relay

    mate RM4. The direction of the rotation can be changed through software.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 30

    4.2.8 ELEVATOR:

    An elevator presents typical problem to logic designers. A number of situations

    like the occurrence of simultaneous requests, the assignment of priorities & the logging

    of requests are frequently encountered.

    The control & operation of an elevator within a building, having three floors is

    simulated by this interface. A key & corresponding RED LED indicator serves as a

    request button & request status indicator. A row of LEDs indicate the position of the

    elevator within the shaft. The Green LED when lit indicates that the elevator is at a

    floor. The servicing of a request can be indicated by clearing the request (turning OFF

    the request indicator flip-flop).

    A four line to 10 line decoder is used to specify the location of the elevator

    within the shaft. When the four inputs to the decoder are sequenced through the binary

    codes, corresponding to 0 to 9 with a time interval between transitions, the elevator is

    seen to move. Two dual D flip-flops are used to sense requests & output the status. A

    request is cleared through the clear inputs of the flip-flops.

    The elevator starts at the ground floor & moves up to the top. The requests are

    sensed each time the lift position is changed. Once the elevator has moved to the top

    all the requests are cleared.

    4.2.9 DAC (DAC0800)

    DAC0800 is used to convert the digital data into analog signals. Digital data from

    any port is given to DAC input. Amplitude of output waveform can be varied by varying

    the pot R40 that is by varying the reference voltage of DAC0800.

    4.2.10 SPI ADC:

    12 Bit SPI ADC is directly interfaced to the controller through the controller port

    lines P4.2(CS), P4.3(MOSI),P4.4(MISI) and P4.5(UCLK). Using the connector CN15 the

    lines are interfaced with the controller.

    4.3 JUMPER DESCRIPTION:

    There are 4 jumpers provided on the Controller board, the description and their

    significance are given below.

    Jumper Significance

    JP1 JTAG connects the VCC

    JP2 JTAG connects the VCC

    JP3 For to monitor DVCC1 voltage

    JP5 For to get DAC o/p voltage differential and single ended.

    JP6 Shorting pin-1&2 will connect 25th pin of the 26 pin FRC to VCC.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 31

    4.4 POWER MATE DETAILS:

    PM1: 5 Pin Power mate (High Current Output Lines for Stepper Motor)

    Pin No. Description

    1 OUT1

    2 OUT2

    3 OUT3

    4 OUT4

    5 VCC

    4.5 RELIAMATE DETAILS:

    RM3:2 Pin Reliamate

    Pin No. Description

    1 Connected to pin -13 of U8

    2 GND

    RM4: 2 Pin Reliamate

    Pin No. Description

    1 Connected to relay K1 13 pin

    2 Connected to Relay 4th pin

    RM5: 2 Pin Reliamate

    Pin No. Description

    1 ADC i/p channel IN1 (pin-27) of ADC0809 (U11)

    2 GND

    RM6: 2 Pin Reliamate

    Pin No. Description

    1 Connected to Output pin of DAC

    2 GND

    CHAPTER 5

    5.1CREATION OF NEW PROJECT and SIMULATING:

    The IAR compiler is used to create, compile & simulate the projects for MSP430

    family micro-controllers. The procedure to create projects is as follows

    Step 1: Create a folder with the name related to the project in any drive.

    Step 2: Open IAR Embedded Workbench software. A new workspace launcher will

    open.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 32

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 33

    Step 3: Go to Project click Create New Project.

    Step 4: Tool chain: Select MSP430

    Project templates: select asm if assembly codes you would like write, else you would

    like to write c then select Empty project

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 34

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 35

    Step 5: select asm and click OK.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 36

    Step 6: Give file name and save the file name in corresponding folder.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 37

    Step7: The window you can see after step6.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 38

    Step 8:Go to project tab, right click and select options.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 39

    Step 9: Go to general options > target tab> device>select device MSP430F449 .

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 40

    Step 10: Select device MSP430F449 and click OK.

    Step 10.1) No need to add the header files after you choosing the target device it

    automatically adds the corresponding header file to your project.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 41

    Step 11: Go to linker> output tab> check Allow C-SPY-specific extra output file

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 42

    Step 12: Linker>Extra output tab > check Generate Extra output file.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 43

    Step 13: Linker> Extra output tab >output format >select MSP430-txt.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 44

    Step 14: Click OK and build all again. After this step HEX file has been created at the project folder.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 45

    Step 15: Go to debugger > setup tab > select simulator > click OK

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 46

    Step 16: Go to file -> Save Workspace, save the workspace in corresponding folder.

    Click ok.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 47

    Step 17: Go to project-> Rebuild All

    if any errors or warnings you will get the result in build console

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 48

    Step 18:Go to Project Debug without Downloading

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 49

    Step 19: Go to project -> Make & Restart Debugger

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 50

    Step 20: PC points to the initial point of the program.

    Step 21:

    1) If you want to see the memory then go to view->memory.

    2) If you want to see the resistor then go to view->resistor.

    3) Any resistor you can add to the watch window. Just right click add to watch.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 51

    Step 22: Project creation for C code.

    Follow above the steps from 1 to 4, default Empty project selected just click on ok.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 52

    Step 23: Give the file name in corresponding folder and click save.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 53

    Step 24: Go to file-> New -> File.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 54

    Step 25: Write a C code in the blank page and save in the corresponding folder

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 55

    Step 26: Go to File -> save , save the file name with the .c extension.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 56

    Step 27: Go to project tab right click on project Add -> Add temp.c.

    >Follow the steps above shows from 9 to 14.

    >Follow the steps 16 and 17.

    >After the Step17 you can find the HEX file in the corresponding folder -> Debug.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 57

    5.2DOWNLOADING USING ISP TOOL:

    Step 1: Connect ISP Tool in between MSP430 evaluation kit and com port of the

    system.

    Step 2: Double click on MSPFET.exe file. A screen will be displayed as shown below.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 58

    Step 3: Select target device.

    Step 4: Click on File menuopen.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 59

    Step 5: Double click on temp.Hex file(you can find the .hex file in project folder-

    >debug folder).

    Step 6: Click on AUTO PROGRAM.

    Step 7:Now, Program starts downloading.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 60

    Step 8: This completes the downloading.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 61

    CHAPTER 6

    DEMO PROGRAMS ON THE BOARD:

    For all the demo programs make sure that the corresponding connectors are connected

    and also keep switch sw1 on RUN side.

    6.1 Demo Programs in IAR V5.3

    6.2 Assembly programs

    6.3 4x 4 Key Matrixes

    6.4 UART test

    6.5 7 Segment Display

    6.6 Elevator

    6.7 Temperature Sensor

    6.8 ADC

    6.9 Stepper Motor

    6.10 DC Motor

    6.11 LED Toggle

    6.12 DAC

    6.13 Alphanumeric LCD

    6.14 SPI ADC

    6.2 Assembly programs

    1) Project Name: block_move(IAR IDE workspace)

    Path: MSP430\programs\ block_move

    Simulate the program and observe the block move from address 0x2010 to address

    0x3020.

    2) Project Name: block_exchange(IAR IDE workspace)

    Path: MSP430\programs\ block_move

    Simulate the program and observe the block exchange from address 0x2010 to address

    0x3020 and vice-versa.

    3) Project Name: ascending(IAR IDE workspace)

    Path: MSP430\programs\ ascending

    Simulate the program and observe the output in ascending at the address 0x3010.

    4) Project Name: descending(IAR IDE workspace)

    Path: MSP430\programs\ descending

    Simulate the program and observe the output in descending at the address 0x3010.

    5) Project Name: largest(IAR IDE workspace)

    Path: MSP430\programs\ largest

    Simulate the program and observe the output finding the largest value in array at the

    address 0x3020.

    6) Project Name: add(IAR IDE workspace)

    Path: MSP430\programs\add

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 62

    Simulate the program and observe the output at the address 0x3030.

    7) Project Name: sub(IAR IDE workspace)

    Path: MSP430\programs\sub

    Simulate the program and observe the output at the address 0x3030.

    8) Project Name: multiplication(IAR IDE workspace)

    Path: MSP430\programs\ multiplication

    Simulate the program and observe the output at the address 0x3030.

    9) Project Name: div(IAR IDE workspace)

    Path: MSP430\programs\ div

    Simulate the program and observe the output at the address 0x3030.

    10) Project Name: square(IAR IDE workspace)

    Path: MSP430\programs\ square

    Simulate the program and observe the output at the address 0x3020

    11) Project Name: cube(IAR IDE workspace)

    Path: MSP430\programs\ cube

    Simulate the program and observe the output at the address 0x3020

    12) Project Name: up_counter(IAR IDE workspace)

    Path: MSP430\programs\ up_counter

    Simulate the program and observe the output at the hyper terminal.

    13) Project Name: down_counter(IAR IDE workspace)

    Path: MSP430\programs\ down_counter

    Simulate the program and observe the output at the hyper terminal.

    14) Project Name: up_count_hex(IAR IDE workspace)

    Path: MSP430\programs\ up_count_hex

    Simulate the program and observe the output at the hyper terminal.

    15) Project Name: down_count_hex(IAR IDE workspace)

    Path: MSP430\programs\ down_count_hex

    Simulate the program and observe the output at the hyper terminal.

    16) Project Name: bcd_to_ascii(IAR IDE workspace)

    Path: MSP430\programs\ bcd_to_ascii

    Simulate the program and observe the output at the address 0x3020

    17) Project Name: ascii_to_decimal(IAR IDE workspace)

    Path: MSP430\programs\ ascii_to_decimal

    Simulate the program and observe the output at the address 0x3020

    18) Project Name: decimal_to_ascii(IAR IDE workspace)

    Path: MSP430\programs\ decimal_to_ascii

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 63

    Simulate the program and observe the output at the address 0x3020 and 0x3030

    19) Project Name: hex_to_decimal(IAR IDE workspace)

    Path: MSP430\programs\ hex_to_decimal

    Simulate the program and observe the output at the address 0x3020

    20) Project Name: decimal_to_hex(IAR IDE workspace)

    Path: MSP430\programs\ decimal_to_hex

    Simulate the program and observe the output at the address 0x3020

    21) Project Name: on_chip_timer(IAR IDE workspace)

    Path: MSP430\programs\ on_chip_timer

    Simulate the program and observe the output timer initial ON and starts the counting

    from 0000 to TACCR0 value.

    22) Project Name: serial_port(IAR IDE workspace)

    Path: MSP430\programs\ serial_port

    Simulate the program and observe the output s is displaying on hyper terminal.

    6.3 Keypad 4X4 matrix Project Name: hex_key

    File Name: hex_key.c

    Path: MSP430\programs\interface\hex_key

    Setup- make the connection as per as the given bellow.

    Connect the 10pin FRC Port4->CN4

    The key pressed will display the corresponding Hexadecimal number on the LCD screen.

    6.4 . Serial (UART) Test

    Project Name: serial_port

    File Name: serial_port.c

    Path: MSP430\programs\interface\serial_port

    In this program serial port can be tested by checking characters loop back in the

    Hyper Terminal. Serial initialization has been done in program. Open the hyper terminal

    and set the Baud rate to 9600. Type the characters from computer keyboard & observe

    them on the console. Connect a 10 pin FRC cable from PORT4 to CN15.

    6.5 . 7 Segment Display

    Project Name: 7_segment

    File Name: 7_segment.c

    Path: MSP430\programs\interface\7_segment

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 64

    SETUP Make connections PORT-3 to CN5 of 7-Segment Display block and similarly

    PORT-2 to CN6.

    When this routine is executed the counting starts from 0 up to F. The counts are

    displayed on the 7-segment displays U16 U21. The counter is configured as up

    counter i.e. incrementing numbers are displayed.

    The above mentioned connectivity is for given demo program only. If the user changes

    the program contents such as assigning different port to a particular interface circuit,

    then the connections should be made as per the change.

    6.6. Elevator

    Project Name: elevator

    File Name: elevator.c

    Path: MSP430\programs\interface\ elevator

    SETUP Make connection from PORT-2 to CN10 of Elevator block and similarly PORT-3

    to CN11.

    Press any of the switches SW21 to SW24 to check out the movement of the

    control. RED LEDs indicate the request from the floor, GREEN LEDs indicate the current

    status of the Elevator and YELLOW LEDs indicate the direction of the movement.

    The above mentioned connectivity is for given demo program only. If the user

    changes the program contents such as assigning different port to the Elevator interface

    circuit, then the connections should be made as per the change.

    6.7 Temperature Sensor

    Project Name: temp_sensor

    File Name: temp_sensor.c

    Path: MSP430\programs\interface\ temp_sensor

    SETUP Make connections from PORT-2 to CN14 connector and PORT-4 to CN16

    connector ADC block.

    This routine can be used to read the temperature being sensed by the device LM335

    (D11) present on the board. When this routine is executed, the temperature in degree

    Celsius is displayed on the LCD with digital output. Provide little heat to the sensor to

    observe the temperature variation.

    The above mentioned connectivity is for given demo program only. If the user changes

    the program contents such as assigning different port to a particular interface circuit,

    then the connections should be made as per the change

    6.8 ADC

    Project Name: adc

    File Name: adc .c

    Path: MSP430\programs\interface\ adc

    SETUP Make connections from PORT-2 to CN14 connector and PORT-4 to CN16

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 65

    connector ADC block.

    This routine is used to study the interfacing of the ADC0809 (U9) device present on the

    board. Vary the Pot R33 to get the different ADC o/p values. If the user wishes to

    monitor his own analog channel, then he can connect the analog signal to the channel-1

    of ADC0809 through Relay mate RM5. Make sure that the analog channel selection in

    the program has to be changed from channel-0 to Channel-1.

    The above mentioned connectivity is for given demo program only. If the user

    changes the program contents such as assigning different port to a particular interface

    circuit, then the connections should be made as per the change.

    6.9 Stepper Motor Interface

    Project Name: stepper_motor

    Project File: stepper_motor.c

    Path: MSP430\programs\interface\ stepper_motor

    SETUP Make connections form PORT-4 to the connector CN12 of the DC and stepper

    motor block using 10 core FRC. Connect the Female Powermate of the stepper motor to

    the male Powermate PM1 present on the board in Stepper Motor block.

    Download & run the above program to observe the rotation of the stepper motor.

    6.10 DC Motor Interface

    Project Name: DC_motor

    Project File: DC_motor.c

    Path: MSP430\programs\interface\ DC_motor

    SETUP Make connections form PORT-4 to the connector CN12 of the DC and stepper

    motor block using 10 core FRC. Connect the Female Relay mate of the DC motor to the

    male Relay mate RM3 present on the board in DC Motor block.

    Download & run the above program to observe the rotation of the DC motor.

    6.11 . Project Name: LED_Toggle

    Project File: LED_Toggle.c

    Path: MSP430\programs\interface\ LED_Toggle

    SETUP Connections are made from PORT-5 to the LEDs(L16 and L17). The PORT-5

    of PORT-5.2 to L16 and PORT-5.3 to L17. Make the port line high and observe the

    corresponding LED.

    6.12 DAC

    Project Name: dac_sine, dac_triangle, dac_square

    Project File: dac_sine.c, dac_triangle.c, dac_square.c

    Path: MSP430\programs\interface\ dac_sine...

    SETUP Make connections from PORT-2 to the connector CN13 of the DAC block using

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 66

    a 10 core FRC. This connects the DAC0800 device to the microcontroller through port

    PORT-2

    Download the required DAC program & observe the Analog output waveform at the

    pin-1 Of RM6 (DAC O/P) and shorting jumper JP5 will make the output wave form as

    single polar.

    6.13 alphanumeric LCD

    Project Name: alphanumeric_lcd

    Project File: alphanumeric_lcd.c

    Path: MSP430\programs\interface\ alphanumeric_lcd

    SETUP Connections are made from PORT-6 to the Alphanumeric LCD. The PORT-6

    connection from the controller is as show in the above 4.2.3 section.

    6.14 SPI ADC

    Project Name: spi_adc

    Project File: spi_adc.c

    Path: MSP430\programs\interface\ spi_adc

    SETUP Make connections from PORT-4 to the connector CN15 of the DAC block using

    a 10 core FRC.

    Connections are made from PORT-6 to the Alphanumeric LCD. The PORT-6 connection

    from the controller is as show in the above 4.2.3 section.

    Very the POT R50 and oserve the voltage at the LCD.

    NOTE: All the multiplexed port lines which are used for the peripherals are enabled by

    setting those bits in the PxSEL registers.

    NOTE: In all the above programs the clock signals ACLK, SMCLK & MCLK are directed

    the port lines P1.5, P1.4 and P1.1 respectively. The clock signal ACLK = 32768 Hz, can be

    observed at the test point TP10. Similarly the clock signals SMCLK and MCLK can be

    observed at test point TP9 and TP11 respectively.

  • ALS-SDA-MSP430-EVAL-02

    ADVANCED ELECTRONIC SYSTEMS 67

    CHAPTER 7

    TROUBLE SHOOTING

    If any trouble is faced then refer to the schematic and resolve the problem

    according to the following suggestions.

    GENERAL PROBLEM: In case of any problem check out the clock signals ACLK,

    SMCLK & MCLK at the port lines P1.5, P1.4 and P1.1 respectively. The clock signal ACLK

    = 32768 Hz, can be observed at the pin 4 of the connector CN6. Similarly the clock

    signals SMCLK = MCLK = 1048550 Hz can be observed at the pin 3 and TP11

    respectively. If the clock signals are not accordingly then check out the microcontroller.

    POWER FAILURE: If power LED L1 is not glowing then, check out the LED. If LED is in

    good condition then it means the power is not supplied to the MSP430 board. Check out

    the +5V incoming power at the pin 9 of connector CN2. If +5V is not supplied then

    replace the +5V power supply unit with the one which is working good.

    If then also power is not supplied then check out the input of the regulator U2 on board.

    If +5V is measured at the input pin-3 of the regulator U2 and 3.3V is not obtained at the

    output pin-2 of the U2 then replace the regulator with the one which is working good. If

    then also power is not supplied to the board then refer to the schematic and checkout all

    the related tracks on the board.

    DOWNLOADING PROBLEM: If there is any problem in downloading the program then

    check out the followings

    1. Check out the proper connections as per the downloading details provided.

    2. Check whether proper target device is selected in the MSPFET utility.