Texas Instruments MSP-FET430 User Manual

MSP-FET430 FLASH Emulation Tool (FET) (For use with IAR Workbench Version 3.x)
User's Guide
2004 SLAU138A Mixed Signal Products
IMPORTANT NOTICE
Texas Instruments and its subsidiaries (TI) reserv e the right to make changes to their products or to discontinue any product or service without notice, and advise customers to obtai n the latest version of relevant information to verify, before placing orders, that information being relied on is current and complete. All products are sold subjec t to the terms and conditions of sale supplied at the time of order acknowledgment, including those pertaining to warranty, patent infringement, and limitation of liability.
TI warrants performance of its products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality c ontrol techniques are utilized to the extent TI deems necessary to support this warranty. Specific t esting of all parameters of each dev ice is not necessarily performed, except those mandated by government requirements.
Customers are responsible for their applications using TI components. In order to minimize risks associated with the customer’s appl ications, adequate design and operating safeguards must
be provided by the customer to minimize inherent or procedural hazards. TI assumes no liability for applications assistance or customer produc t design. 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 of TI coveri ng or relati ng to any comb ination, m achine, or proc ess in whic h s uch produc ts or s ervic es might be or are used. TI’s publication of inform ation regarding any third party’s products or services does not const itute TI’s approval, license, warranty or endorsement thereof.
Reproduction of information in TI data books or data s heets is perm issible onl y if reproduc tion is wit hout alterat ion and is accompanied by all associated warranties, conditions, limitations and notices. Repres entation or reproduction of this information with alteration voids all warrant ies provided f or an ass ociated TI produc t or s ervice, is an unf air and dec eptiv e business practice, and TI is not responsible nor liable for any such use.
Resale of TI’s products or servic es with statements different from or beyond the parameters or service voids all express and any implied warranties for the associated TI product or serv ice, is an unfair and deceptive business practice, and TI is not responsible nor liable for any such use.
Also see: Standard Terms and Conditions of Sale for Semiconductor Products.
Mailing Address:
Texas Instruments
Post Office Box 655303
Dallas, Texas 75265
Copyright © 2001, Texas Instruments Incorporated
www.ti.com/sc/docs/stdterms.htm
stated by TI for that product
ii
July 2004
About This Manual
This manual documents the Texas Instruments MSP-FET430 Flash Emulation Tool (FET). The FET is the program development tool for the MSP430 ultra low power microcontroller. Both available interfaces, the Parallel-Port-Interface and the USB-Interface, are described here.
How to Use This Manual
Read and follow the Get Started Now! chapter. This chapter will enable you to inventory your FET, and then it will instruct you to install the software and hardware, and then run the demonstration programs. Once you’ve been demonstrated how quick and easy it is to use the FET, we suggest that you complete the reading of this manual.
Preface
Read This First
This manual describes the set-up and operation of the FET, but does not fully teach the MSP430 or the development software systems. For details of these items, refer to the appropriate TI and IAR documents listed in Chapter 1.9 Important MSP430 Documents on the CD-ROM and WEB.
This manual is applicable to the following tools (and devices): MSP-FET430X110 (for the MSP430F11xIDW, MSP430F11x1AIDW, and
MSP430F11x2IDW devic es )
MSP-FET430P120 (for the MSP430F12xIDW and MSP430F12x2IDW
devices)
MSP-FET430P140 (for the MSP430F13xIPM, MSP430F14xIPM,
MSP430F15xIPM, MSP430F16xIPM, and MSP430F161xIPM devices) MSP-FET430P410 (for the MSP430F41xIPM devices) MSP-FET430P430 (for the MSP430F43xIPN devices) MSP-FET430P440 (for the MSP430F43xIPZ and MSP430F44xIPZ
devices) MSP-FET430UIF (debug interface with USB connection, for all MSP430
Flash based devices) This tool contains the most up-to-date materials available at the time of
packaging. For the latest materials (data sheets, User’s Guides, software, applications, etc.), visit the TI MSP430 web site at www.ti.com/sc/msp430 or contact your local TI sales office.
,
iii
C
W
Information About Cautions and Warnings
This book may contain cautions and warnings.
This is an example of a caution statement.
A caution statement describes a situation that could potentially damage your software or equipment.
AUTION
This is an example of a warning statement.
A warning statement describes a situation that could potentially cause harm to you
.
ARNING
The information in a caution or a warning is provided for your protection. Read each caution and warning carefu lly .
Related Documentation From Texas Instruments
MSP430xxxx Device Data Sheets
❏❏❏❏ MSP430x1xx Family User’s Guide, SLAU049 ❏❏❏❏ MSP430x3xx Family User’s Guide, SLAU012 ❏❏❏❏ MSP430x4xx Family User’s Guide, SLAU056
iv
If You Need Assistance
Support for the MSP430 device and the FET is provided by the Texas Instruments Product Information Center (PIC). Contact information for the PIC can be found on the TI web site at www.ti.com specific information can be found on the MSP430 web site at www.ti.com/sc/msp430
Note: Kickstart is supported by Texas Instruments
Although Kicksta rt is a product of IAR, Texas Instruments provides the support for it. Therefore, please do not request support for Kickstart from IAR. Please consult the extensive documentation provided with Kickstart before requesting assistance.
FCC Warning
This equipment is intended for use in a laboratory test environment only. It generates, uses, and can radiate radio frequency energy and has not been tested for compliance with the limits of computing devices pursuant to subpart J of part 15 of FCC rules, which are designed to provide reasonable protection against radio frequency interference. Operation of this equipment in other environments may cause interference with radio communications, in which case the user at his own expense will be required to take whatever measures may be required to correct this interference.
. Additional device-
.
v
vi vii
Contents
Read This First................................................................................................................iii
About This Manual.....................................................................................................iii
How to Use This Manual............................................................................................iii
Information About Cautions and Warnings................................................................ iv
Related Documentation From Texas Instruments...................................................... iv
If You Need Assistance..............................................................................................v
FCC Warning.............................................................................................................v
Contents.........................................................................................................................vii
Figures.............................................................................................................................ix
Tables..............................................................................................................................ix
Get Started Now!...........................................................................................................1-1
1.1 Kit Contents, MSP-FET430X110.....................................................................1-2
1.2 Kit Contents, MSP-FET430Pxx0 (‘P120, ‘P140, ‘P410, ‘P430, ‘P440) .............1-2
1.3 Kit Contents, MSP-FET430UIF........................................................................1-3
1.4 Software Installation........................................................................................1-3
1.5 Hardware Instal lation, MS P -FET430X110.......................................................1-3
1.6 Hardware Installation, MSP-FET430Pxx0 (‘P120, ‘P140, ‘P410, ‘P430, ‘P440)1-4
1.7 Hardware Installation, USB-IF, MSP-FET430UIF ............................................1-4
1.8 “Flash”ing the LED...........................................................................................1-4
1.9 Important MSP430 Documents on the CD-ROM and WEB..............................1-6
Development Flow........................................................................................................2-1
2.1 Overview.........................................................................................................2-2
2.2 Using Kickstart.................................................................................................2-2
2.2.1 Project Settings ..................................................................................................2-3
2.2.2 Creating a Project from Scratch.........................................................................2-5
2.2.3 Using an Existing IAR V1.x/V2.x Project............................................................2-6
2.2.4 Stack Management within the .xcl Files.............................................................2-6
2.2.5 How to Generate Texas Instrument .TXT (and other format) Files....................2-7
2.2.6 Overview of Example Programs.........................................................................2-7
2.3 Using C-SPY...................................................................................................2-9
2.3.1 Breakpoint Types ...............................................................................................2-9
2.3.2 Using Breakpoints..............................................................................................2-9
2.3.3 Using Single Step.............................................................................................2-10
2.3.4 Using Watch Windows .....................................................................................2-11
Design Considerations for In-Circuit Programming................................................... 3-1
3.1 Bootstrap Loader.............................................................................................3-2
3.2 External Power................................................................................................3-2
3.3 Device Signals.................................................................................................3-3
3.4 Signal Connections for In-System Programming and Debugging, MSP-
FET430X110...................................................................................................3-4
3.5 Signal Connections for In-System Programming and Debugging, MSP-
FETP430IF, MSP-FET430U IF.........................................................................3-6
Frequently Asked Questions.......................................................................................A-1
A.1 Hardware........................................................................................................A-2
A.2 Program Development (Assembler, C-Compiler, Linker).................................A-3
A.3 Debugging (C-SPY)........................................................................................ A-5
Hardware.......................................................................................................................B-1
B.1 History of changes to MSP-TS430PM64 Target Socket modul e................... B-12
FET Specific Menus..................................................................................................... C-1
C.1 EMULATOR....................................................................................................C-2
C.1.1 EMULATOR->RELEASE JTAG ON GO...........................................................C-2
C.1.2 EMULATOR->RESYNCHRONIZE JTAG .........................................................C-2
C.1.3 EMULATOR->INIT NEW DEVICE....................................................................C-2
C.1.4 EMULATOR->SHOW USED BREAKPOINTS..................................................C-2
C.1.5 EMULATOR->ADVANCED->GENERAL CLOCK CONTROL ..........................C-2
C.1.6 EMULATOR->ADVANCED->EMULATION MODE...........................................C-2
C.1.7 EMULATOR->ADVANCED->MEMORY DUMP................................................C-3
C.1.8 EMULATOR->ADVANCED->BREAKPOINT COMBINER................................C-3
C.1.9 EMULATOR->STATE STO RAGE.....................................................................C-3
C.1.10 EMULATOR->ST ATE STO R AGE WIN D OW....................................................C-3
C.1.11 EMULATOR->SEQUENCER............................................................................C-3
C.1.12 EMULATOR->”POWER ON” RESET ...............................................................C-3
C.1.13 EMULATOR->SECURE....................................................................................C-3
C.1.14 EMULATOR->GIE on/o ff...................................................................................C-4
C.1.15 EMULATOR->LEAVE TARGET RUNNING......................................................C-4
C.1.16 EMULATOR->FORCE SIN G LE STEPPI NG.....................................................C-4
C.1.17 EMULATOR->SET VCC...................................................................................C-4
80-pin MSP430F44x and MSP430F43x Device Emulation..........................................D-1
TI to IAR 2.x/3.x Assembler Migrat ion........................................................................E-1
E.1 Segment Control............................................................................................. E-2
E.2 Translating Asm430 Assembler Directives to A430 Directives........................ E-2
E.2.1 Introduction........................................................................................................E-2
E.2.2 Character strings...............................................................................................E-2
E.2.3 Section Control Directives.................................................................................E-3
E.2.4 Constant Initialization Directives .......................................................................E-4
E.2.5 Listing Control Directives .................................................................................. E-4
E.2.6 File Reference Directives.................................................................................. E-5
E.2.7 Conditional-Assembly Directives.......................................................................E-5
E.2.8 Symbol Control Directives.................................................................................E-6
E.2.9 Macro Directives................................................................................................E-7
E.2.10 Miscellaneous Directives...................................................................................E-7
E.2.11 Preprocessor Directives ....................................................................................E-7
E.2.12 Alphabetical Listing and Cross Reference of Asm4 30 Dir ectiv es..................... E-8
E.2.13 Additional A430 Directives (IAR).......................................................................E-8
MSP-FET430UIF Installation Guide............................................................................. F-1
F.1 Hardware Installation...................................................................................... F-2
viii
Figures
Figure 3-1. Signal connections for MSP-FET430X110................................................3-5
Figure 3-2. JTAG Signal Connections.........................................................................3-7
Figure A-1. Modification to FET Interface module..................................................... A-7
Figure B-1. MSP-FET430X110, Schematic.................................................................. B-2
Figure B-2. MSP-FET430X110, PCB Pictorials........................................................... B-3
Figure B-3. MSP-FET430IF FET Interface module, Schematic.................................. B-4
Figure B-4. MSP-FET430IF FET Interface module, PCB Pictorial.............................B-5
Figure B-5. MSP-TS430DW28 Target Socket module, Schematic............................. B-6
Figure B-6. MSP-TS430DW28 Target Socket module, PCB Pictorials......................B-7
Figure B-7. MSP-TS430PM64 Target Socket module, Schematic, Rev. 1.0..............B-8
Figure B-8. MSP-TS430PM64 Target Socket module, PCB Pictorials, Rev. 1.0....... B-9
Figure B-9. MSP-TS430PM64 Target Socket module, Schematic, Rev. 1.1............B-10
Figure B-10. MSP-TS430PM64 Target Socket module, PCB Pictorials, Rev. 1.1 ... B-11
Figure B-11. MSP-TSPN80 Target Socket module, Schematic................................B-13
Figure B-12. MSP-TSPN80 Target Socket module, PCB Pictorials......................... B-14
Figure B-13. MSP-TSPZ100 Target Socket module, Schematic.............................. B-15
Figure B-14. MSP-TSPZ100 Target Socket module, PCB Pictorials....................... B-16
Figure B-15. MSP-FET430UIF USB Interface schematics........................................ B-17
Figure F-1. WinXP Hardware Recognition................................................................... F-2
Figure F-2. WinXP Hardware Wizard............................................................................F-2
Figure F-3. WinXP Driver Location Selection Folder..................................................F-3
Figure F-4. WinXP Driver Installation...........................................................................F-4
Figure F-5. Device Manager..........................................................................................F-5
Tables
Table 2-1. Number of device breakpoints, and other emulation features.................2-9
Table D-1. F4xx/80-pin Signal Mapping...................................................................... D-2
ix
Chapter 1
Get Started Now!
This chapter will enable you to inventory your FET, and then it will instruct you to install the software and hardware, and the n run the de mons trat ion progra ms .
Topic Page
1.1 Kit Contents, MSP-FET430X110 1-2
1.2 Kit Contents, MSP-FET430Pxx0 (‘P120, ‘P140, ‘P410, ‘P430, ‘P440)
1.3 Kit Contents, MSP-FET430UIF 1-3
1.4 Software Installation 1-3
1.5 Hardware Installation, MSP-FET430X110 1-3
1.6 Hardware Installation, MSP-FET430Pxx0 (‘P120, ‘P140, ‘P410, ‘P430, ‘P440)
1.7 Hardware Installation, USB-IF, MSP-FET430UIF 1-4
1.8 “Flash”ing the LED 1-4
1.9 Important MSP430 Documents on the CD-ROM and WEB 1-6
1-2
1-4
1-1
Get Started Now!
1.1 Kit Contents, MSP-FET430X110
One READ ME FIRST document. One MSP430 CD-ROM. One MSP-FET430X110 Flash Emulation Tool. This is the PCB on which is
mounted a 20-pin ZIF socket for the MSP430F11xIDW, MSP430F11x1AIDW, or MSP430F11x2IDW device. A 25-conductor cable originates from the FET.
One small box containing two MSP430F1121AIDW device samples.
1.2 Kit Contents, MSP-FET430Pxx0 (‘P120, ‘P140, ‘P410, ‘P430, ‘P440)
One READ ME FIRST document. One MSP430 CD-ROM. One MSP-FETP430IF FET Interface module. This is the unit that has a 25-pin
male D-Sub connector on one end of the case, and a 2x7 pin male connector on the other end of the case.
MSP-FET430P120: One MSP-TS430DW28 Target Socket module. This is the
PCB on which is mounted a 28-pin ZIF socket for the MSP430F12xIDW or MSP43012x2IDW device. A 2x7 pin male connector is also present on the PCB.
MSP-FET430P140: One MSP-TS430PM64 Target Socket module. This is the
PCB on which is mounted a 64-pin clam-shell-style socket for the MSP430F13xIPM, MSP430F14xIPM, MSP430F15xIPM, MSP430F16xIPM, or MSP430F161xIPM device. A 2x7 pin male connector is also present on the PCB.
MSP-FET430P410: One MSP-TS430PM64 Target Socket module. This is the
PCB on which is mounted a 64-pin clam-shell-style socket for the MSP430F41xIPM device. A 2x7 pin male connector is also present on the PCB.
MSP-FET430P430: One MSP-TS430PN80 Target Socket module. This is the
PCB on which is mounted an 80-pin ZIF socket for the MSP430F43xIPN device. A 2x7 pin male connector is also present on the PCB.
MSP-FET430P440: One MSP-TS430PZ100 Target Socket module. This is the
PCB on which is mounted a 100-pin ZIF socket for the MSP430F43xIPZ or MSP430F44xIPZ device. A 2x7 pin male connector is also present on the PCB.
One 25-conductor cable.
1-2
One 14-conductor cable.
MSP-FET430P120: Four PCB 1x14 pin headers (Two male and two female). MSP-FET430P140: Eight PCB 1x16 pin headers (Four male and four female). MSP-FET430P410: Eight PCB 1x16 pin headers (Four male and four female).
MSP-FET430P430: Eight PCB 1x20 pin headers (Four male and four female). MSP-FET430P440: Eight PCB 1x25 pin headers (Four male and four female).
One small box containing two or four MSP430 device samples.
MSP-FET430P120: MSP430F123IDW and/or MSP430F1232IDW MSP-FET430P140: MSP430F149IPM and/or MSP430F169IPM MSP-FET430P410: MSP430F413IPM MSP-FET430P430: MSP430F437IPN and/or MSP430FG439 MSP-FET430P440: MSP430F449IPZ
Consult the device data sheets for device specifications. A list of device errata can be found at http://www.ti.com/sc/cgi-bin/buglist.cgi
1.3 Kit Contents, MSP-FET430UIF
❏❏❏❏ One READ ME FIRST document ❏❏❏❏ One MSP430 CD-ROM ❏❏❏❏ One MSP-FET430UIF interface module ❏❏❏❏ One USB-Cable ❏❏❏❏ One 14-conductor cable
Get Started Now!
1.4 Software Installation
Follow the instructions on the supplied READ ME FIRST document to install the IAR Embedded Workbench Kickstart. Read the file <Installation Root>\Embedded Workbench x.x\430\doc\readme.htm from IAR for the latest information about the Workbench. The term Kickstart is used to refer to the function-limited version of Emb edd ed Wor kbe nc h (inc lud ing C-SPY deb ug ger ). Kickstart is supplied on the CD-ROM included with each FET, and the latest version is available from the MSP430 web site.
The above documents (and this document) can be accessed using: START->PROGRAMS->IAR SYSTEMS->IAR EMBEDDED WORKBENCH KICKSTART FOR MSP430 V3
Kickstart is compatible with WINDOWS 98, 2000, ME, NT4.0, and XP. However, the USB-FET-Interface works only with WINDOWS 2000 and XP.
1.5 Hardware Installation, MSP-FET430X110
1) Connect the 25-conductor cable originating from the FET to the parallel port of your PC.
2) Ensure that the MSP430F1121AIDW is securely seated in the socket, and that its pin 1 (indicated with a circular indentation on the top surface) aligns with the “1” mark on the PCB.
3) Ensure that jumpers J1 (near the non-socketed IC on the FET) and J5 (near the LED) are in place. Pictorials of the FET and its parts are presented in Appendix B.
1-3
Get Started Now!
1.6 Hardware Installation, MSP-FET430Pxx0 (‘P120, ‘P140, ‘P410, ‘P430, ‘P440)
1) Use the 25-conductor cable to connect the FET Interface module to the parallel port of your PC.
2) Use the 14-conductor cable to connect the FET Interface module to the supplied Target Socket module.
3) Ensure that the MSP430 device is securely seated in the socket, and that its pin 1 (indicated with a circular indentation on the top surface) aligns with the “1” mark on the PCB.
4) Ensure that the two jumpers (LED and Vcc) near the 2x7 pin male connector are in place. Pictorials of the Target Socket module and its parts are presented in Appendix B.
1.7 Hardware Installation, USB-IF, MSP-FET430UIF
Use the USB cable to connect the USB-FET Interface module to a USB port of
your PC. The USB FET should be recognized instantly as the USB device driver should have been installed already with the Kickstart SW. If for any reason the Install Wizard starts, respond to the prompts and point the wizard to the driver files which are located in directory: <Installation Root>\Embedded Workbench x.x\430\bin\WinXP. Detailed driver installation instructions can be found in Appendix F.
After connecting to a PC the USB FET performs a selftest where the red LED
flashes for about 2 seconds. If the selftest passed successfully, the green LED lits permanently.
Use the 14-conductor cable to connect the USB-FET Interface module to a
target board, such as an MSP430-FETPxxx Target Socket Module.
Ensure that the MSP430 device is securely seated in the socket, and that its pin
1 (indicated with a circular indentation on the top surface) aligns with the “1” mark on the PCB.
Ensure that the two jumpers (LED and Vcc) near the 2x7 pin male connector are
in place. Pictorials of the MSP430 Target Socket modules and their parts are presented in Appendix B.
The USB FET has additional features like: programming of the security fuse and
adjustable target Vcc (1.8V–5.0V); target can be supplied with up to 100mA.
1.8 “Flash”ing the LED
This section demonstrates on the FET the equivalent of the C-language “Hello world!” introductory program; an application that flashes the LED is developed and downloaded to the FET, and then run.
1) Start the Workbench (START->PROGRAMS->IAR SYSTEMS->IAR EMBEDDED WORKBENCH KICKSTART FOR MSP430 V3->IAR EMBEDDED WORKB EN C H) .
1-4
2) Use FILE->OPEN WORKSPACE to open the file at: <Installation Root>\Embedded Workbench x.x\430\FET_examples\fet_projects.eww. The workspace window will open.
Get Started Now!
3) Click on the tab at the bottom of the workspace window that corresponds to your tool (FETxxx) and desired language (assembler or C).
4) Use PROJECT->OPTIONS->FET Debugger->Setup->Connection to select the appropriate port: LPTx for the parallel FET Interface or TI USB FET for the USB Interface.
5) Use PROJECT->REBUILD ALL to build and link the source code. You can view the source code by double-clicking on the project, and then double­clicking on the displayed source file.
6) Use PROJECT->DEBUG to start the C-SPY debugger. C-SPY will erase the device Flash, and then download the application object file to the device Flash.
Refer to FAQ, Debugging #1) if C-SPY is unable to communicate with the device.
7) Use DEBUG->GO to start the application. The LED should flash!
8) Use DEBUG->STOP DEBUGGING to stop debugging, to exit C-SPY, and to return to the Workbench.
9) Use FILE->EXIT to exit the Workbench.
Congratulations, you’ve just built and tested your first MSP430 application!
1-5
Get Started Now!
1.9 Important MSP430 Documents on the CD-ROM and WEB
The primary sources of MSP430 information are the device specific data sheet and User’s Guide. The most up to date versions of these documents available at the time of production have been provided on the CD-ROM included with this tool. The MSP430 web site (www.ti.com/sc/msp430 version of these documents.
From the MSP430 main page on the CD-ROM, navigate to: Literature->MSP430 Literature->Data Sheets, to access the MSP430 device data sheets.
From the MSP430 main page on the CD-ROM, navigate to: Literature->MSP430 Literature->User’s Guides, to access the MSP430 device User’s Guides and tools.
Documents describing the IAR tools (Workbench/C-SPY, the assembler, the C compiler, the linker, and the librarian) are located in common\doc and 430\doc. The documents are in PDF-format. Supplements to the documents (i.e., the latest information) are available in HTML-format within the same directories. 430\doc\readme_start.htm provides a convenient starting point for navigating the IAR documentation.
) will contain the latest
1-6
Chapter 2
Development Flow
This chapter discusses how to use Kickstart to develop your application software, and how to use C-SPY to debug it.
Topic Page
2.1 Overview 2-2
2.2 Using Kickstart 2-2
2.2.1 Project Settings 2-3
2.2.2 Creating a Project from Scratch 2-5
2.2.3 Using an Existing IAR V1.x/V2.x Project 2-6
2.2.4 Stack Management within the .xcl Files 2-6
2.2.5 How to Generate Texas Instrument .TXT (and other format) Files
2.2.6 Overview of Example Programs 2-7
2.3 Using C-SPY 2-9
2.3.1 Breakpoint Types 2-9
2.3.2 Using Breakpoints 2-9
2.3.3 Using Single Step 2-10
2.3.4 Using Watch Windows 2-11
2-7
2-1
Development Flow
2.1 Overview
Applications are developed in assembler and/or C using the Workbench, and they are debugged using C-SPY. C-SPY is seamlessly integrated into the Workbench. However, it is more convenient to make the distinction between the code development environment (Workbench) and the debugger (C-SPY). C­SPY can be configured to operate with the FET (i.e., an actual MSP430 device), or with a software simulation of the device. Kickstart is used to ref er to the Workbench and C-SPY collectively. The Kickstart software tools are a product of IAR.
Documentation for the MSP430 family and Kickstart is extensive. The CD-ROM supplied with this tool contains a large amount of documentation describing the MSP430. The MSP430 home page (www.ti.com/sc/msp430 of MSP430 information. The components of Kickstart (workbench/debugger, assembler, compiler, linker) are fully documented in <Installation Root>\Embedded Workbench x.x\common\doc and <Installation Root>\Embedded Workbench\430\doc. .htm files located throughout the Kickstart directory tree contain the most up to date information and supplement the .pdf files. In addition, Kickstart documentation is available on-line via HELP.
) is another source
Read Me Firsts from IAR and TI, and this document, can be accessed using: START->PROGRAMS->IAR SYSTEMS->IAR EMBEDDED WORKBENCH KICKSTART FOR MSP430 V3
Tool User’s Guide Most Up To Date
Information
Workbench/C-SPY EW430_UsersGuide.pdf readme.htm, ew430.htm,
cs430.htm, cs430f.htm, Assembler EW430_AssemblerReference.pdf a430.htm, a430_msg.htm Compiler EW430_CompilerReference.pdf icc430.htm, icc430_msg.htm C library CLibrary.htm Linker and Librarian xlink.pdf xlink.htm, xman.htm, xar.htm
2.2 Using Kickstart
The Kickstart development environment is function-li mited. The following restrictions are in place:
The C compiler will not generate an assembly code list file. The linker will link a maximum of 4K bytes of code originating from C source
(but an unlimited amount of code originating from assembler source).
2-2
The simulator will input a maximum of 4K bytes of code. A “Full” (i.e., unrestricted) version of the software tools can be purchased from
IAR. A mid-featured tool set – called “Baseline”, with a 12K byte C code size limitation and basic floating-point operations – is also available from IAR. Consult the IAR web site (www.iar.se
2.2.1 Project Settings
The settings required to configure the Workbench and C-SPY are numerous and detailed. Please read and thorou ghly und er s tand t he doc ume ntat io n supplied by IAR when dealing with project settings. Please review the project settings of the supplied assembler and C examples; the project settings are accessed using: PROJECT->OPTIONS with the project name selected. Use these project settings as templates when developing your own projects. Note that if the project name is not selected when settings are made, the settings will be applied to the selected file (and not to the project).
The following project settings are recommended/required: Specify the target device (GENERAL OPTIONS->TARGET->DEVICE)
Development Flow
) for more information.
Enable an assembler project or a C/assembler project (GENERAL OPTIONS-
>TARGET->ASSEMBLER ONLY PROJECT)
Enable the generation of an executable output file (GENERAL OPTIONS-
>OUTPUT->OUTPUT FILE->EXECUTABLE)
In order to most easily debug a C project, disable optimization (C/C++
Compiler->CODE->OPTIMIZATIONS->SIZE->NONE (BEST DEBUG SUPPORT))
Enable the generation of debug information in the compiler output (C/C++
Compiler ->OUTPUT->GENERATE DEBUG INFO)
Specify the search path for the C preprocessor (C/C++ Compiler-
>PREPROCESSOR->INCLUDE PATHS)
Enable the generation of debug information in the assembler output
(ASSEMBLER->OUTPUT->GENERATE DEBUG-INFO)
Specify the search path for the assembler preprocessor (ASSEMBLER -
>PREPROCESSOR->INCLUDE PATHS)
In order to debug the project using C-SPY, specify a compatible format
(LINKER->OUTPUT->FORMAT->DEBUG INFO [WITH TERMINAL IO])
Specify the search path for any used libraries (LINKER->CONFIG->SEARCH
PATHS)
Specify the C-SPY driver. Selec t PROJ ECT ->OPTIONS->Debugger->Setup-
>Driver->FET Debugger to debug on the FET (i.e., MSP430 device). Select SIMULATOR to debug on the simulator. If FET Debugger is selected, use PROJECT->OPTIONS->FET Debugger->Setup->Connection to select the appropriate port: LPTx for the parallel FET Interface or TI USB FET for the USB Interface.
2-3
Development Flow
Enable the Device Description file. This file makes C-SPY “aware” of the
specifics of the device it is debugging. This file will correspond to the specified target device (DEBUGGER->SETUP->DEVICE DESCRIPTION­>OVERRIDE DEFAULT)
Enable the erasure of the Main and Information memories before object code
download (FET DEBUGGER->SETUP->DOWNLOAD CONTROL->ERASE MAIN AND INFORMATION MEMORY)
In order to maximize system performance during debug, disable Virtual
Breakpoints (FET DEBUGGER->SETUP ->USE VIRTUAL BREAKPOINTS), and disable all System Breakpoints (FET DEBUGGER­>SETUP ->SYSTEM BREAKPOINTS ON)
Note: Use of Factory Settings to quickly configure a project
It is possible to use the Factory Settings button to quickly configure a project to a usable state.
The following steps can be used to quickly configure a project: Note: The GENERAL OPTIONS tab does not have a FACTORY
SETTINGS button
1) Specify the target device (GENERAL OPTIONS ->TARGET­>DEVICE)
2) Enable an assembler project or a C/assembler project (GENERAL OPTIONS ->TARGET->ASSEMBLER ONLY PROJECT)
3) Enable the generation of an executable output file (GENERAL OPTIONS ->OUTPUT->OUTPUT FILE->EXECUTABLE)
4) Accept the factory settings for the compiler (C/C++ COMPILER­>FACTORY SETTI NGS)
5) Accept the factory settings for the assembler (ASSEMBLER­>FACTORY SETTI NGS)
6) Accept the factory settings for the linker (LINKER->FACTORY SETTINGS)
7) Accept the factory settings for C-SPY (DEBUGGER->FACTORY SETTINGS)
8) To debug on the hardware, select DEBUGGER ->SETUP­>DRIVER->FET DEBUGGER
9) Specify the active parallel port used to interface to the FET if not LPT1 (FET DEBUGGER ->SETUP->CONNECTION->LPTx) or specify the USB port (FET DEBUGGER ->SETUP->CONNECTION­>TI USB FET)
2-4
Note: Avoid the use of absolute pathnames when referencing files.
Instead, use the relative pathname keywords $TOOLKIT_DIR$ and $PROJ_DIR$. Refer to the IAR documentation for a description of these keywords. The use of relative pathnames will permit projects to be moved easily, and projects will not require modification when IAR systems are upgraded (say, from Kickstart, or Baseline, to Full).
2.2.2 Creating a Project from Scratch
The following section presents step-by-step instructions to create an assembler or C project from scratch, and to download and run the application on the MSP430. Refer to Project Settings above. Also, the MSP430 IAR Embedded Workbench IDE User Guide presents a more comprehensive overview of the process.
1) Start the Workbench (START->PROGRAMS->IAR SYSTEMS->IAR EMBEDDED WORKBENCH KICKSTART FOR MSP430 V3->KICKSTART IAR EMBEDDED WORKBENCH).
2) Create a new text file (FILE->NEW->SOURCE/TEXT).
Development Flow
3) Enter the pr ogram text into the file.
Note: Use .h files to simplify your code development
Kickstart is supplied with files for each device that define the device registers and the bit names, and these files can greatly simplify the task of developing your program. The files are located in <Installation Root>\Embedded Workbench x.x\430\inc. Simply include the .h file corresponding to your target device in your text file (#include “msp430xyyy.h”). Additionally, files io430xxxx.h are provided, and are optimized to be included by C source files.
4) Save the text file (FILE->SAVE). It is recommended that assembler text file be saved with a file type suffix of
“.s43”, and that C text files be saved with a file type suffix of “.c”.
5) Create a new workspace (FILE->NEW->WORKSPACE). Specify a workspace name and press SAVE.
6) Create a new project (PROJECT->CREATE NEW PROJECT). Specify a project name and press CREATE
7) Add the text file to the project (PROJECT->ADD FILES). Select the text file and press OPEN. Alternatively, double-click on the text file to add it to the project.
2-5
Development Flow
Note: How to add assembler source files to your project
The default file type presented in the Add Files window is “C/C++ Files”. In order to view assembler files (.s43), select “Assembler Files” in the “Files of type” drop-down menu.
8) Configure the project options (PROJECT->OPTIONS). For each of the listed subcategories (GENERAL OPTIONS, C/C++ COMPILER, ASSEMBLER, LINKER, DEBUGGER), accept the default Factory Settings with the following exception s :
Specify the target device (GENERAL OPTIONS->TARGET->DEVICE) Enable an assembler project or a C/assembler project (GENERAL
OPTIONS ->TARGET->ASSEMBLER ONLY PROJECT)
Enable the generation of an executable output file (GENERAL OPTIONS -
>OUTPUT->OUTPUT FILE->EXECUTABLE)
To debug on the FET (i.e., the MSP430), select DEBUGGER ->SETUP-
>DRIVER-> FET DEBUGGER
Specify the active port used to interface to the FET (FET DEBUGGER -
>SETUP->CONNECTION)
8) Build the pr ojec t (PROJE C T ->RE BUIL D ALL).
9) Debug the application using C-SPY (PROJECT->DEBUG). This will start C­SPY, and C-SPY will get control of the target, erase the target memory, program the target memory with the application, and reset the target.
Refer to FAQ, Debugging #1) if C-SPY is unable to communicate with the device.
10) Use DEBUG->GO to start the application.
11) Use DEBUG->STOP DEBUGGING to stop the application, to exit C-SPY, and to return to the Workbench.
12) Use FILE->EXIT to exit the Workbench.
2.2.3 Using an Existing IAR V1.x/V2.x Project
It is possible to use an existing project from an IAR V1.x/V2.x system with the new IAR V3.x system; refer to the IAR document Step by step migration for EW430 x.xx. This document can be located in: <Installation Root>\Embedded Workbench x.x\430\doc\migration.htm
2.2.4 Stack Management within the .xcl Files
The .xcl files are input to the linker, and contain statements that control the allocation of device memory (RAM, Flash). Refer to the IAR XLINK documentation for a complete description of these files. The .xcl files provided with the FET (<Installation Root >\E mb edd ed Wor k be n ch x.x\430\config\lnk430xxxx.xcl) define a relocatable segment (RSEG) called CSTACK. CSTACK is used to define the region of RAM that is used for the
2-6
Development Flow
system stack within C programs. CSTACK can also be used in assembler programs [MOV #SFE(CSTACK), SP]. CSTACK is defined to extend from the last location of RAM for 50 bytes (i.e., the stack extends downwards through RAM for 50 bytes).
Other statements in the .xcl file define other relocatable regions that are allocated from the first location of RAM to the bottom of the stack. It is critical to note that:
1. The supplied .xcl files reserve 50 bytes of RAM for the stack,
regardless if this amount of stack is actually required (or if it is sufficient).
2. There is no runtime checking of the stack. The stack can overflow
the 50 reserved bytes and possible overwrite the other segments. No error will be output.
The supplied .xcl files can be easily modified to tune the size of the stack to the needs of the application; simply edit -D_STACK_SIZE=xx to allocate xx bytes for the stack. Note that the .xcl file will reserve 50 byes for the heap if required (say, by malloc()).
2.2.5 How to Generate Texas Instrument .TXT (and other format) F iles
The Kickstart linker can be configured to output objects in TI .TXT format for use with the GANG430 and PRGS430 programmers. Select: PROJECT­>OPTIONS->LINKER->OUTPUT->FORMAT->OTHER->MSP430-TXT. Intel and Motorola formats can also be selected.
Refer to FAQ, Program Development #6).
2.2.6 Overview of Example Programs
Example programs for MSP430 devices are provided in <Installation Root>\Embedded Workbench x.x\430\FET_examples. Each tool folder contains folders that contain the assembler and C sources.
<Installation Root>\Embedded Workbench\x.x\430\FET_examples\fet_projects.eww conveniently organizes the FET_1 demonstration code into a workspace. The workspace contains assembler and C projects of the code for each of the FET tools. Debug and Release versions are provided for each of the projects.
<Installation Root>\Embedded Workbench x.x\430\FET_examples\code_examples.eww conveniently organizes the code examples into a workspace. The workspace contains assembler and C projects of the code for each of the FET tools. Debug and Release versions are provided for each of the projects.
<Installation Root>\Embedded Workbench x.x\430\FET_examples\contents.htm conveniently organizes and documents the examples.
Additional code examples can be found on the MSP430 home page under Design Resources.
2-7
Development Flow
Note: Some example programs require a 32KHz crystal on LFXT1, and not all FETs are supplied with a 32KHz crystal.
2-8
2.3 Using C-SPY
Refer to Appendix C for a description of FET-specific menus within C-SPY.
2.3.1 Breakpoint Types
The C-SPY breakpoint mechanism makes use of a limited number of on-chip debugging resources (specifically, N breakpoint registers, refer to Table 2-1 below). When N or fewer breakpoints are set, the application runs at full device speed (or “Realtime”). When greater than N breakpoints are set and Use Virtual Breakpoints is enabled (FET DEBUGGER->SETUP->USE VIRTUAL BREAKPOINTS), the application runs under the control of the host PC; the system operates at a much slower speed, but offers unlimited software breakpoint (or “Non-Realtime”). During Non-Realtime mode, the PC effectively repeatedly single steps the device and interrogates the device after each operation to determine if a breakpoint has been hit .
Both (code) address and data (value) breakpoints are supported. Data breakpoints and range breakpoints each require two address breakpoints.
Development Flow
Table 2-1. Number of device breakpoints, and other emulation features.
Device Breakpoints
(N)
MSP430F11x1 2 MSP430F11x2 2 MSP430F12x 2 MSP430F12x2 2 MSP430F13x 3 X MSP430F14x 3 X MSP430F15x 8 X X X X MSP430F16x 8 X X X X MSP430F161x 8 X X X X MSP430F41x 2 X MSP430F42x 2 X MSP430F43x 8 X X X X MSP430F44x 8 X X X X MSP430FE42x 2 X MSP430FG43x 2 X MSP430FW42x 2 X
Range
Breakpoints
Clock
Control
2.3.2 Using Breakpoints
If C-SPY is started with greater than N breakpoints set and virtual breakpoints are disabled, a message will be output that informs the user that only N (Realtime) breakpoints are enabled (and one or more breakpoints are disabled). Note that the workbench permits any number of breakpoints to be set, regardless of the USE VIRTUAL BREAKPO INTS setting of C-SPY. If virtual breakpoints are disabled, a maximum of N breakpoints can be set within C­SPY.
State
Sequencer
Trace
Buffer
RESET’ing a program temporarily requires a breakpoint if PROJECT­>OPTIONS->DEBUGGER->SETUP->RUN TO is enabled. Refer to FAQ, Debugging #30).
2-9
Development Flow
The RUN TO CURSOR operation temporarily requires a breakpoint. Consequently, only N-1 breakpoints can be active when RUN TO CURSOR is used if virtual breakpoints are disabled. Refer to FAQ, Debugging #31).
If, while processing a breakpoint, an interrupt becomes active, C-SPY will stop at the first instruction of the interrupt service routine. Refer to FAQ, Debugging #24).
2.3.3 Using Single Step
When debugging an assembler file, STEP OVER, STEP OUT, and NEXT STATEMENT operate like STEP INTO; the current instruction is executed at full speed.
When debugging an assembler file, a step operation of a CALL instruction stops at the first instruction of the CALL’ed function.
When debugging an assembler file, a (true) STEP OVER a CALL instruction that executes the CALL’ed function at full device speed can be synthesized by placing a breakpoint after the CALL and GO’ing (to the breakpoint in “Realtime mode”).
When debugging a C file, a single step (STEP) operation executes the next C statement. Thus, it is possible to step over a function reference. If possible, a hardware breakpoint will be placed after the function reference and a GO will be implicitly executed. This will cause the function to be executed at full speed. If no hardware breakpoints are available, the function will be executed in Non­Realtime mode. STEP INTO is supported. STEP OUT is supported.
Within Disassembly mode (VIEW->DISASSEMBLY), a step operation of a non­CALL instruction executes the instruction at full device speed.
Within Disassembly mode (VIEW->DISASSEMBLY), a step operation of a CALL instruction will place – if possible - a hardware breakpoint after the CALL instruction, and then execute GO. The CALL’ed function will execute at full device speed. If no hardware breakpoint is available prior to the GO, the CALL’ed function will be executed in Non-Realtime mode. In either case, execution will stop at the instruction following the CALL.
It is only possible to single step when source statements are present. Breakpoints must be used when running code for which there is no source code (i.e., place the breakpoint after the CALL to the function for which there is no source, and then GO to the breakpoint in “Realtime mode”).
If, during a single step operation, an interrupt becomes active, the current instruction is completed and C-SPY will stop at the first instruction of the interrupt service routine. Refer to FAQ, Debugging #24).
2-10
2.3.4 Using Watch Windows
The C-SPY Watch Window mechanism permits C variables to be monitored during the debugging session. Although not originally designed to do so, the Watch Window mechanism can be extended to monitor assembler variables.
Assume that the variables to watch are defined in RAM, say:
RSEG DATA16_I varword ds 2 ; two bytes per word varchar ds 1 ; one byte per character
In C-SPY:
1) Open the Watc h W ind ow: VIEW- >W ATCH
2) Use DEBUG->QUICK WATCH
3) To watch varw or d, enter in the Ex pr ess ion box: (__data16 unsigned int *) #varword
4) To watch varchar, enter in the Expression box: (__data16 unsigned char *) #varchar
Development Flow
5) Press the Add Watch button
6) Close the Quick Watch window
7) For the created entry in the Watch Window, click on the + symbol. This will display the contents (or value) of the watched variable.
To change the format of the displayed variable (default, binary, octal, decimal, hex, char), select the type, click the right mouse button, and then select the desired format. The value of the displayed variable can be changed by selecting it, and then entering the new value.
In C, variables can be watched by selecting them and then dragging-n-dropping then into the Watch Window.
Since the MSP430 peripherals are memory mapped, it is possible to extend the concept of watching variables to watching peripherals. Be aware that there may be side effects when peripherals are read and written by C-SPY. Refer to FAQ, Debugging #22).
CPU core registers can be specified for watching by preceding their name with ‘#’ (i.e., #PC, #SR, #SP, #R5, etc.).
Variables watched within the Watch Window are only updated when C-SPY gets control of the device (say, following a breakpoint hit, a single step, or a STOP/escape).
Although registers can be monitored in the Watch Window, VIEW->REGISTER is a superior method.
2-11
Loading...
+ 66 hidden pages