6_USING _LINKER

  • 格式:pdf
  • 大小:193.55 KB
  • 文档页数:20

MSP430 FamilyUsing the Linker6-1TopicsPage6Using the Linker6-36.1Opening and configuring a project6-46.2Adding source-files to the project6-76.3Building the project (assembling and linking)6-96.4Starting the program6-11

FiguresPage6.1ADT430 Program group6-46.2Project|New/Open6-46.3Project Open dialog box6-56.4Configure New Project dialog box6-56.5Project window6-66.6Add File to Project dialog box6-76.7Project window/added files6-86.8Project|Build6-96.9Output window6-106.10Setting a breakpoint6-116.11Run|Reset Program6-126.12Run bar6-136.13Window/LCD command6-146.14LCD window6-156.15Run|Snapshot On Breakpoint command6-166.16Status window6-176.17Step Into command6-186.18evma320m.asm6-19Using the LinkerMSP430 Family

6-2NotesPage6Simulator version6-36.2Load project file6-86.3Project|Rebuild All command6-96.4Open a file6-116.5Reset button6-126.6Snapshot On Breakpoint button6-166.7Hold On Breakpoint button6-176.8Run|Step Into, Run|Step Over6-19MSP430 FamilyUsing the Linker

6-36Using the LinkerThis chapter shows the first steps you have to perform within the MSP430 SimulationEnvironment to link the object code of more than one source file. The used source filesare provided in your installation directory ‘..\dt430\examples’ and will demonstrate theusability of the LCD-module. The source code is distributed to 3 source files:

evma320m.asmwhich contains the main programevma320i.asmwhich contains the interrupt routine for the basic timer interruptevma320l.asmwhich contains the definitions e.g. for the used LCD (demo.lcd)

Note:Simulator versionThis chapter is only important if you have installed a simulator version whichcontains the MSP430 Linker.Using the LinkerMSP430 Family

6-46.1Opening and configuring a projectThe first step to run the simulator is to open the MSP430 Simulation Environment witha double mouse click on the DT430 icon in the ADT430 program group.

Figure 6.1: ADT430 Program groupOn the desktop select the Project|New/Open command.

Figure 6.2: Project|New/OpenMSP430 FamilyUsing the Linker

6-5This causes to open the ‘Open Project’ dialog box.

Figure 6.3: Project Open dialog boxType ‘linktest.prj’ in the ‘File Name’ edit field and click the OK button. An additionaldialog box ‘Configure New Project’ will be opened.

Figure 6.4: Configure New Project dialog boxSelect the ‘MSP430E325’ in the processor list box and click the OK button.Using the LinkerMSP430 Family

6-6A project window will appear including a specific command file for the linker containingprocessor specific data according to the selected processor type.

Figure 6.5: Project windowMSP430 FamilyUsing the Linker

6-76.2Adding source files to the projectThe next step is to add the following assembler source files to your project:‘..\adt430\dt430\examples\evma320i.asm’‘..\adt430\dt430\examples\evma320l.asm’‘..\adt430\dt430\examples\evma320m.asm’

First select the Project|Add File command in the Project menu. The ‘Add File to Project’dialog box will appear.

Figure 6.6: Add File to Project dialog boxSecondly, select the files ‘evma320i.asm’, ‘evma320l.asm’ and ‘evma320m.asm’ oneafter another and click for each file the Add button. Third, you can close the dialog boxwith the Close button.Using the LinkerMSP430 Family

6-8The files ‘evma320i.asm’, ‘evma320l.asm’ and ‘evma320m.asm’ are added to yourproject in the Project window.

Figure 6.7: Project window/added filesNote:Load project fileYou can load each file listed in the project into the editor with a double click onits name in the project window. Only ASCII text files should be opened thisway.MSP430 FamilyUsing the Linker

6-96.3Building the project (assembling and linking)For building (assembling and linking) the project, select the Project|Build command inthe project menu or press the key F9.

Figure 6.8: Project|BuildNote:Project|Rebuild All commandIf you want to assemble all source files with a subsequent link-process, selectthe Project|Rebuild All command.Using the LinkerMSP430 Family

6-10An Output window is displayed with the messages, that all files are assembled withouterrors and the object file ‘linktest.obj’ is created.

Figure 6.9: Output windowNow you have assembled and linked a complete project the first time. The object codeis loaded into the simulator.