You are on page 1of 46

MSP430

CodeComposerStudiov4User

User'sGuide

sGuidefor ’

MSP430 CodeComposerStudiov4User User'sGuide sGuidefor ’ LiteratureNumber:SLAU157K May2005 RevisedAugust2009 –

LiteratureNumber:SLAU157K

May2005

RevisedAugust2009 –

2SLAU157K

May2005 –

RevisedAugust2009 –

Contents Preface 7 1GetStartedNow! 9 1.1SoftwareInstallation 10 1.2FlashingtheLED 10

Contents

Preface

7

1GetStartedNow!

9

1.1SoftwareInstallation

10

1.2FlashingtheLED

10

1.3ImportantMSP430DocumentsontheCD-ROMandWeb

11

2DevelopmentFlow

13

2.1UsingCodeComposerStudio(CCS)

14

2.1.1CreatingaProjectFromScratch

14

2.1.2ProjectSettings

15

2.1.3UsinganExistingCCEv2,CCEv3orCCEv3.1Project

15

2.1.4StackManagement

15

2.1.5HowtoGenerateBinary-FormatFiles(TI-TXTandINTEL-HEX)

15

2.1.6OverviewofExampleProgramsandProjects

16

2.2UsingtheIntegratedDebugger

16

2.2.1BreakpointTypes

16

2.2.2UsingBreakpoints

17

AFrequentlyAskedQuestions

19

A.1Hardware

20

A.2ProgramDevelopment(Assembler,C-Compiler,Linker,IDE)

20

A.3Debugging

21

BIAR2.x/3.x/4.xtoCCSC-Migration

25

B.1InterruptVectorDefinition

26

B.2IntrinsicFunctions

26

B.3DataandFunctionPlacement

26

B.3.1DataPlacementatanAbsoluteLocation

26

B.3.2DataPlacementIntoNamedSegments

27

B.3.3FunctionPlacementIntoNamedSegments

27

B.4CCallingConventions

28

B.5OtherDifferences

28

B.5.1InitializingStaticandGlobalVariables

28

B.5.2CustomBootRoutine

29

B.5.3PredefinedMemorySegmentNames

29

B.5.4PredefinedMacroNames

30

CIAR2.x/3.x/4.xtoCCSAssemblerMigration

31

C.1SharingC/C++HeaderFilesWithAssemblySource

32

C.2SegmentControl

32

C.3TranslatingA430AssemblerDirectivestoAsm430Directives

33

C.3.1Introduction

33

C.3.2CharacterStrings

33

C.3.3SectionControlDirectives

34

SLAU157K

May2005

RevisedAugust2009Contents3 –

www.ti.com
www.ti.com

www.ti.com

C.3.4ConstantInitializationDirectives

34

C.3.5ListingControlDirectives

35

C.3.6FileReferenceDirectives

35

C.3.7ConditionalAssemblyDirectives

36

C.3.8SymbolControlDirectives

36

C.3.9MacroDirectives

37

C.3.10MiscellaneousDirectives

37

C.3.11AlphabeticalListingandCrossReferenceofAsm430Directives

38

C.3.12UnsupportedA430Directives(IAR)

39

DFET-SpecificMenus

41

D.1Menus

42

D.1.1DebugView:Run

 

FreeRun

 

42

D.1.2Target

ConnectTarget

 

42

D.1.3Target

Advanced

MakeDeviceSecure

42

D.1.4Project

Properties

CCSDebugSettings

Target

MSP430Properties

ClockControl

42

D.1.5Window

ShowView

 

Breakpoints

42

D.1.6Window

ShowView

Trace

42

D.1.7Project

Properties

TIDebugProperties

Target

MSP430Properties

TargetVoltage

43

DocumentRevisionHistory

 

44

ImportantNotices

45

4ContentsSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com
www.ti.com

www.ti.com

ListofTables

1-1SystemRequirements

10

1-2CodeExamples

10

2-1DeviceArchitecture,BreakpointsandOtherEmulationFeatures

16

SLAU157K

May2005

RevisedAugust2009ListofTables5 –

Allothertrademarksarethepropertyoftheirrespectiveowners.

Microsoft,Windows,WindowsVistaareregisteredtrademarksofMicrosoftCorporation.

ThinkPadisaregisteredtrademarkofLenovo.

IAREmbeddedWorkbenchisaregisteredtrademarkofIARSystemsAB.

6ListofTablesSLAU157K

May2005 –

RevisedAugust2009 –

SLAU157K – May2005 RevisedAugust2009 – Preface ReadThisFirst AboutThisManual MSP430ultra-low-powermicrocontrollers.

SLAU157K

May2005

RevisedAugust2009 –

Preface

ReadThisFirst

AboutThisManual

MSP430ultra-low-powermicrocontrollers.

ThismanualdescribestheuseofTexasInstruments'CodeComposerStudiov4(CCSv4)withthe

HowtoUseThisManual

atwww.ti.com/msp430orcontactyourlocalTIsalesoffice.

materials(datasheets,user'sguides,software,applicationinformation,etc.),visittheTIMSP430website

Thesetoolscontainthemostup-to-datematerialsavailableatthetimeofpackaging.Forthelatest

developmenttoolsseries.

ThismanualappliestotheusewithTexasInstruments'MSP-FET430UIF,MSP-FET430PIFandeZ430

DocumentsontheCD-ROMandWeb

detailsoftheseitems,refertotheappropriateTIdocumentslistedinSection1.3

doesnotfullydescribetheMSP430orthecompletedevelopmentsoftwareandhardwaresystems.For

Thismanualdescribesonlythesetupandbasicoperationofthesoftwaredevelopmentenvironmentbut

andeasyitistousethedevelopmenttools,TIrecommendsthatyoureadallofthismanual.

installingthesoftware,anddescribeshowtorunthedemonstrationprograms.Afteryouseehowquick

ReadandfollowtheinstructionsintheGetStartedNow!chapter.Thischapterprovidesinstructionson

,ImportantMSP430

.

InformationAboutCautionsandWarnings

Thisdocumentmaycontaincautionsandwarnings.

CAUTION

softwareorequipment.

Acautionstatementdescribesasituationthatcouldpotentiallydamageyour

Thisisanexampleofacautionstatement.

WARNING

causeharmtoyou.

Awarningstatementdescribesasituationthatcouldpotentially

Thisisanexampleofawarningstatement.

carefully.

Theinformationinacautionorawarningisprovidedforyourprotection.Readeachcautionandwarning

SLAU157K

May2005

RevisedAugust2009ReadThisFirst7 –

RelatedDocumentationFromTexasInstruments www.ti.com
RelatedDocumentationFromTexasInstruments www.ti.com

RelatedDocumentationFromTexasInstrumentswww.ti.com

RelatedDocumentationFromTexasInstruments

MSP430HardwareToolsUser'sGuide,literaturenumberSLAU278

MSP430developmenttoolsdocumentation

MSP430OptimizingC/C++CompilerUser

MSP430AssemblyLanguageToolsUser

CCSv4documentation

sGuide,literaturenumberSLAU131

sGuide,literaturenumberSLAU132

eZ430-RF2480User'sGuide,literaturenumberSWRA176

eZ430-F2013DevelopmentToolUser'sGuide,literaturenumberSLAU176

MSP430x5xxFamilyUser'sGuide

MSP430x4xxFamilyUser'sGuide

MSP430x3xxFamilyUser'sGuide

MSP430x2xxFamilyUser'sGuide

MSP430x1xxFamilyUser'sGuide

MSP430xxxxdevicedatasheets

eZ430-ChronosDevelopmentToolUser'sGuide,literaturenumberSLAU292

eZ430-RF2500-SEHDevelopmentToolUser'sGuide,literaturenumberSLAU273

eZ430-RF2500DevelopmentToolUser'sGuide,literaturenumberSLAU227

,literaturenumberSLAU049

,literaturenumberSLAU144

,literaturenumberSLAU012

,literaturenumberSLAU056

,literaturenumberSLAU208

IfYouNeedAssistance

ProductInformationCenter(PIC).ContactinformationforthePICcanbefoundontheTIwebsiteat

SupportfortheMSP430devicesandtheFETdevelopmenttoolsisprovidedbytheTexasInstruments

.ACodeComposerStudiospecificWikipage(FAQ)isavailable,andtheTexas

befoundontheMSP430website

interactionwithpeerengineers,TIengineers,andotherexperts.Additionaldevice-specificinformationcan

.

FCCWarning

measuresmayberequiredtocorrectthisinterferenceathisownexpense. causeinterferencewithradiocommunications,inwhichcase,theuserisrequiredtotakewhatever protectionagainstradio-frequencyinterference.Operationofthisequipmentinotherenvironmentsmay

devicespursuanttosubpartJofpart15ofFCCrules,whicharedesignedtoprovidereasonable

radiateradiofrequencyenergyandhasnotbeentestedforcompliancewiththelimitsofcomputing

Thisequipmentisintendedforuseinalaboratorytestenvironmentonly.Itgenerates,uses,andcan

8ReadThisFirstSLAU157K

May2005 –

RevisedAugust2009 –

SLAU157K – May2005 RevisedAugust2009 – Chapter1 GetStartedNow! programs.

SLAU157K

May2005

RevisedAugust2009 –

Chapter1

GetStartedNow!

programs.

Thischapterprovidesinstructionsoninstallingthesoftware,andshowshowtorunthedemonstration

Topic

Page

1.1SoftwareInstallation

10

1.2FlashingtheLED

10

1.3ImportantMSP430DocumentsontheCD-ROMandWeb

11

SLAU157K

May2005

RevisedAugust2009GetStartedNow!9 –

SoftwareInstallation www.ti.com
SoftwareInstallation www.ti.com

SoftwareInstallationwww.ti.com

1.1SoftwareInstallation

duringtheinstallationprocess.

fortheparallel-portFET(MSP-FET430PIF)arenotinstalledbydefault,butcanbeselectedmanually

emulators(MSP-FET430UIFandeZ430series)areinstalledautomaticallywheninstallingCCS.Thedriver

locationandfollowtheinstructionsshownonthescreen.ThehardwaredriversfortheUSBJTAG

ToinstallCodeComposerStudiov4(CCS),runsetup_CCS_4.x.x.x.x.exefromtheDVDordownload

Note:SupportofMSP-FET430PIF(parallelportemulators).

process.

notinstalledbydefault.YouneedtoselectthemmanuallyduringtheCCS4installation

ThedriverandIDEcomponentssupportingtheMSP-FET430PIFparallelportinterfaceare

Table1-1.SystemRequirements

 

RecommendedSystemRequirements

MinimumSystemRequirements

Processor

 

DualCore

   

1.5GHz

 

RAM

 

2GB

 

1GB

FreeDiskSpace

 

2GB

 

300MB(dependsonfeaturesselectedduring

 

installation)

 

OperatingSystem

Microsoft

®

Windows

®

XPwithSP2(32bit)or

Microsoft

®

Windows

®

XPwithSP2(32bit)or

WindowsVista

®

(32bit)

WindowsVista

®

(32bit)

1.2FlashingtheLED

ThissectiondemonstratesontheFETtheequivalentoftheC-language"Helloworld!"introductory

1.StartCodeComposerStudioStart

describeshowanapplicationthatflashestheLEDisdeveloped,downloadedtotheFET,andrun.

program.CCSv4includesplainCandASMcodefilesaswellasfullypreconfiguredprojects.Thefollowing

CodeComposerStudiov4

AllPrograms

TexasInstruments

CodeComposerStudiov4.

6.AddtheflashingLEDcodeexampletotheprojectbyclickingProject

5.ClicknexttwicetogettotheCCSProjectSettingspage.SelecttheDeviceVariantusedintheproject.

4.SetProjectTypetoMSP430

3.Enteraprojectnameandclicknext

2.CreateanewProjectbyselectingFile

New

CCSProject.

AddFilestoActiveProject.

appropriatesourcecodefile:

Codeexamplesarelocatedin<

InstallationRoot

>

\ccs4

\msp430

\examples.UseTable1-2toselectthe

Table1-2.CodeExamples

MSP430Devices

CodeExample

MSP430x1xxdevicefamily

\msp430x1xx > <

\C-Source

\msp430x1xx.c

MSP430x2xxdevicefamily

\msp430x2xx > <

\C-Source

\msp430x2xx.c

MSP430x4xxdevicefamily

\msp430x4xx > <

\C-Source

\msp430x4xx.c

MSP430x5xxdevicefamily

\msp430x5xx > <

\C-Source

\msp430x5xx.c

7.IfusingaUSBFlashEmulationToolsuchastheMSP-FET430UIFortheeZ430DevelopmentTool,

arecorrectlysaved.

Select"savefile"fromthedropdownmenuorclickthe“

casesupportfortheMSP430ParallelPortToolswasselectedduringtheinstallation)connections.

*.ccxmlfileintheproject.Thepull-downmenucontainsTIMSP430USBxandTIMSP430LPTx(in

theyshouldbealreadyconfiguredbydefault.Thedebuginterfacemaybechangedbyopeningthe

save

”icontoensureconfigurationchanges

8.Tocompilethecodeanddownloadtheapplicationtothetargetdevice,gotoTarget

Project.

DebugActive

10GetStartedNow!SLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com ImportantMSP430DocumentsontheCD-ROMandWeb
www.ti.com ImportantMSP430DocumentsontheCD-ROMandWeb

www.ti.comImportantMSP430DocumentsontheCD-ROMandWeb

9.TheapplicationmaybestartedbyselectingTarget

toolbar.

Run(F8)orclickingthePlaybuttononthe

importedbyselectingProject

Predefinedprojects,whicharelocatedin<

Congratulations,youhavejustbuiltandtestedanMSP430application!

SeeFAQDebugging#1iftheCCSdebuggerisunabletocommunicatewiththedevice.

InstallationRoot

>

\msp430

\examples

\exampleprojects,canbe

ImportExistingCCS/CCEEclipseProject.

1.3ImportantMSP430DocumentsontheCD-ROMandWeb

versionofthesedocuments.

ontheCD-ROMincludedwiththistool.TheMSP430website(

Themostup-to-dateversionsofthesedocumentsavailableatthetimeofproductionhavebeenprovided

TheprimarysourcesofMSP430andCCS4informationarethedevice-specificdatasheets,user'sguides.

)containsthelatest

SLAU157K

May2005

RevisedAugust2009GetStartedNow!11 –

12GetStartedNow!SLAU157K

May2005 –

RevisedAugust2009 –

SLAU157K – May2005 RevisedAugust2009 – Chapter2 DevelopmentFlow howtodebugthatsoftware.

SLAU157K

May2005

RevisedAugust2009 –

Chapter2

DevelopmentFlow

howtodebugthatsoftware.

ThischapterdiscusseshowtouseCodeComposerStudio(CCS)todevelopapplicationsoftwareand

Topic

Page

2.1UsingCodeComposerStudio(CCS)

14

2.2UsingtheIntegratedDebugger

16

SLAU157K

May2005

RevisedAugust2009DevelopmentFlow13 –

UsingCodeComposerStudio(CCS) www.ti.com
UsingCodeComposerStudio(CCS) www.ti.com

UsingCodeComposerStudio(CCS)www.ti.com

2.1UsingCodeComposerStudio(CCS)

(

developmentflowwithCCSinassemblyorC,seeMSP430AssemblyLanguageToolsUser

ThefollowingsectionsareabriefoverviewofhowtouseCCS.Forafulldiscussionofsoftware

sGuide ’

)andMSP430OptimizingC/C++CompilerUser

sGuide(

).

2.1.1CreatingaProjectFromScratch

1.StarttheCCS(Start

CodeComposerStudioHelppresentsamorecomprehensiveoverviewoftheprocess.

downloadandruntheapplicationontheMSP430(seeSection2.1.2

Thissectionpresentsstep-by-stepinstructionstocreateanassemblyorCprojectfromscratchandto

,ProjectSettings

).Also,theMSP430

Code

AllPrograms

TexasInstruments

CodeComposerStudiov4

ComposerStudiov4).

2.Createnewproject(File

New

CCSProject).Enterthenamefortheproject,clicknextandset

assemblyonlyproject.

appropriatedevicevariantandclickFinish.Forassemblyonlyprojectsensuretoclick"Configureasan

ProjectTypetoMSP430.ClicknexttwicetogettotheCCSProjectSettingspage.Selectthe

3.Createanewsourcefile(File

New

SourceFile).Enterfilenameandremembertoaddthesuffix

withoutphysicallyaddingittotheprojectdirectory,clickProject

projectcreatesacopyofthefileintheprojectdirectory.Topointtoafileinthedirectorystructure

onthefilenametocompletetheadditionofitintotheprojectfolder.Notethataddingafiletothe

toActiveProjectandbrowsetothefileofinterest.SingleclickonthefileandclickOpenordouble-click

.cor.asm.If,instead,youwanttouseanexistingsourcefileforyourproject,clickProject

AddFiles

LinkFilestoActiveProjectinstead.

4.Entertheprogramtextintothefile.

Note:Use.hfilestosimplifycodedevelopment.

specifiestheMSP430partnumber.

msp430xyyy.h <

Toincludethe.hfilecorrespondingtothetargetdevice,addtheline#include

Usingthesefilesisrecommendedandcangreatlysimplifythetaskofdevelopingaprogram.

CCSissuppliedwithfilesforeachdevicethatdefinethedeviceregistersandthebitnames.

>forCand.cdeclsC,LIST,"msp430xyyy"forassemblycode,wherexyyy

5.Configuretheconnectionoptionsbyopeningthe*.ccxmlfileinyourprojecttoselectdebuginterface,

oracceptthedefaultfactorysettings.

7.Debugtheapplication(Target

6.Buildtheproject(Project

BuildActiveProject).

DebugActiveProject).Thisstartsthedebugger,whichgainscontrol

SeeFAQDebugging#1ifthedebuggerisunabletocommunicatewiththedevice.

thetarget.

ofthetarget,erasesthetargetmemory,programsthetargetmemorywiththeapplication,andresets

8.ClickTarget

Runtostarttheapplication.

9.ClickTarget

TerminateAlltostoptheapplicationandtoexitthedebugger.CCSwillreturntothe

C/C++view(codeeditor)automatically.

10.ClickFile

ExittoexitCCS.

14DevelopmentFlowSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com UsingCodeComposerStudio(CCS)
www.ti.com UsingCodeComposerStudio(CCS)

www.ti.comUsingCodeComposerStudio(CCS)

2.1.2ProjectSettings

Specifythetargetdevicefordebugsession(Project

Propertiesfortheactiveproject.Thefollowingprojectsettingsarerecommended/required:

anddebuggedwithdefaultfactorysettings.TheprojectsettingsareaccessedbyclickingProject

ThesettingsrequiredtoconfiguretheCCSarenumerousanddetailed.Mostprojectscanbecompiled

Properties

CCSBuildSettings

Device

Settings

C/C++Build

automatically.

Variant).ThecorrespondingLinkerCommandFileandRuntimeSupportLibraryareselected

TomoreeasilydebugaCproject,disableoptimization(Project

MSP430Compiler

BasicOptions).

Properties

Tool

SpecifythesearchpathfortheCpreprocessor(Project

MSP430Compiler

IncludeOptions).

Properties

C/C++Build

ToolSettings

Specifythesearchpathforanylibrariesbeingused(Project

Settings

MSP430Linker

FileSearchPath).

Properties

C/C++Build

Tool

Specifythedebuggerinterface.Openthe*.ccxmlfileinproject.InConnectionselectTIMSP430LPTx

fortheparallelFETinterfaceorTIMSP430USBxfortheUSBinterface.

EnabletheerasureoftheMainandInformationmemoriesbeforeobjectcodedownload(Project

Properties

CCSDebugSettings

Target

MSP430Properties

DownloadOptions

Erase

MainandInformationMemory).

Toensureproperstandaloneoperation,disableSoftwareBreakpoints(Project

Properties

connected;otherwise,thetargetmaynotbeoperationalstandalone.

Breakpointsareenabled,ensureproperterminationofeachdebugsessionwhilethetargetis

DebugSettings

Target

MSP430Properties

UseSoftwareBreakpoints).IfSoftware

CCS

2.1.3UsinganExistingCCEv2,CCEv3orCCEv3.1Project

file,inthesection"InterruptVectors".

CCE2.xCcode,removethe"//"infrontof#definestatements,whicharelocatedattheendofeach.h

definitionsusedinCCE2.xarestillgiven,buthavebeencommentedoutinallheaderfiles.Tosupport

slightlytoimprovecompatibilitywiththeIAREmbeddedWorkbench

Whilethesupportforassemblyprojectshasnotchanged,theheaderfilesforCcodehavebeenmodified

Tools(CGT)dependingonthepreviousCGTversion.

TheIDEmayreturnawarningthatanimportedprojectwasbuildwithanotherversionofCodeGeneration

requiremanualworkonthetargetconfigurationfile(*.ccxml)onceimported.

givenworkspace.SpecificProjectscanthenbeselectedandconverted.CCEv2andCCEv3projectsmay

legacyCCEworkspacecontainingtheprojecttobeimported.TheImportWizardlistsallprojectsinthe

theCCS4format(File

CCSv4supportstheconversionofworkspacesandprojectscreatedinversionCCEv2,v3,andv3.1to

Import

General

ExistingProjectsintoWorkspace

Next).Browseto

IDE(interruptvectordefinitions).The ®

2.1.4StackManagement

oftrackingthestacksize.

Notethatthestackcanoverflowduetosmallsizeorapplicationerrors.SeeSection2.2.2.1foramethod

throughRAMfor50to80bytes,dependingontheRAMsizeoftheselecteddevice).

isdefinedtoextendfromthelastlocationofRAMfor50to80bytes(i.e.,thestackextendsdownwards

C/C++Build

Thereservedstacksizecanbeconfiguredthroughtheprojectoptionsdialog(Project

Properties

ToolSettings

MSP430Linker

BasicOptions

SetCSystemStackSize).Stacksize

2.1.5HowtoGenerateBinary-FormatFiles(TI-TXTandINTEL-HEX)

INTEL-HEXformatfilesforTIfactorydeviceprogramming.Thetoolcanbeusedeitherstandaloneina

objectsinTI-TXTformatforusewiththeMSP-GANG430andMSP-PRGS430programmers,aswellas

TheCCSinstallationincludesthehex430.execonversiontool.Itcanbeconfiguredtogenerateoutput

SLAU157K

May2005

RevisedAugust2009DevelopmentFlow15 –

UsingtheIntegratedDebugger www.ti.com the< (Project

UsingtheIntegratedDebuggerwww.ti.com

the<

(Project

selectingpredefinedformatssuchasTI-TXTandINTEL-HEXinthe"ApplyPredefinedStep"menu

lattercase,apost-buildstepcanbeconfiguredtogeneratethefileautomaticallyaftereverybuildby

commandline(locatedin<

InstallationRoot

>

C/C++Build

>

\Debug

\tools

\compiler

\msp430

\bin)ordirectlywithinCCS.Inthe

Properties

BuildSteps

Post-BuildStep).Thegeneratedfileisstoredin

Workspace

>

\

<

Project

\directory.

2.1.6OverviewofExampleProgramsandProjects

importedbyProject

areprovidedin<

Project

Tousetheexamples,createanewprojectandaddtheexamplesourcefiletotheprojectbyclicking

AssemblyandCsourcesareavailableintheappropriatesubdirectory.

ExampleprogramsforMSP430devicesareprovidedin<

InstallationRoot

>

\ccsv4

\msp430

\examples.

AddFilestoActiveProject.Inaddition,exampleprojectscorrespondingtothecodeexamples

InstallationRoot

>

\ccsv4

\msp430

\examples

\exampleprojects.Theprojectscanbe

ImportExistingCCS/CCEEclipseProject(seeSection1.2formoreinformation).

2.2UsingtheIntegratedDebugger

SeeAppendixDforadescriptionofFET-specificmenuswithinCCS.

2.2.1BreakpointTypes

constraints.

Breakpoints),anunlimitednumberofsoftwarebreakpointscanbesetwhilestillmeetingrealtime

enabled(Project

devicespeed(or"realtime").WhengreaterthanNbreakpointsaresetandUseSoftwareBreakpointsis

Nbreakpointregisters,seeTable2-1

Thedebuggerbreakpointmechanismusesalimitednumberofon-chipdebuggingresources(specifically,

).WhenNorfewerbreakpointsareset,theapplicationrunsatfull

Target

MSP430Properties

UseSoftware

Properties

CCSDebugSettings

Note:Asoftwarebreakpointreplacestheinstructionatthebreakpointaddresswithacallto

eachdebugsession;otherwise,theapplicationmaynotbeoperationalstandalone.

breakpoint.Inaddition,theuseofsoftwarebreakpointsalwaysrequiresproperterminationof

interruptthecodeexecution.Therefore,thereisasmalldelaywhensettingasoftware

eachrequiretwoMSP430hardwarebreakpoints.

Bothaddress(code)anddata(value)breakpointsaresupported.Databreakpointsandrangebreakpoints

Table2-1.DeviceArchitecture,BreakpointsandOtherEmulationFeatures

BreakpointRange

DevicesBreakpoin

ArchitectureJTAGJTAG

(1)

(N)ts

MSP4304-Wire2-WireClockStateTrace

ControlSequencerBuffer

CC430F513xMSP430Xv2XX2XX

CC430F612xMSP430Xv2XX2XX

CC430F613xMSP430Xv2XX2XX

MSP430F11x1MSP430X2

MSP430F11x2MSP430X2

MSP430F12xMSP430X2

MSP430F12x2MSP430X2

MSP430F13xMSP430X3X

MSP430F14xMSP430X3X

MSP430F15xMSP430X8XXXX

MSP430F16xMSP430X8XXXX

MSP430F161xMSP430X8XXXX

(1)

programmingtool.TheMSP-FET430PIFparallelportJTAGemulatordoesnotsupportcommunicationin2-wireJTAGmode.

bytheUSBemulators(eZ430-xxxxandMSP-FET430UIFUSBJTAGemulator)andtheMSP-GANG430production

The2-wireJTAGdebuginterfaceisalsoreferredtoasSpy-Bi-Wire(SBW)interface.Notethatthisinterfaceissupportedonly

16DevelopmentFlowSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com UsingtheIntegratedDebugger
www.ti.com UsingtheIntegratedDebugger

www.ti.comUsingtheIntegratedDebugger

Table2-1.DeviceArchitecture,BreakpointsandOtherEmulationFeatures(continued)

BreakpointRange MSP4304-Wire2-WireClockStateTrace

ControlSequencerBuffer

DevicesBreakpoin

ArchitectureJTAGJTAG

(1)

(N)ts

MSP430F20xxMSP430XX2X

MSP430F21x1MSP430X2X

MSP430F21x2MSP430XX2X

MSP430F22x2MSP430XX2X

MSP430F22x4MSP430XX2X

MSP430F23xMSP430X3XX

MSP430F23x0MSP430X2X

MSP430F24xMSP430X3XX

MSP430F241xMSP430XX8XXXX

MSP430F2410MSP430X3XX

MSP430F261xMSP430XX8XXXX

MSP430F41xMSP430X2X

MSP430F41x2MSP430XX2X

MSP430F42xMSP430X2X

MSP430FE42xMSP430X2X

MSP430FE42x2MSP430X2X

MSP430FW42xMSP430X2X

MSP430F42x0MSP430X2X

MSP430FG42x0MSP430X2X

MSP430F43xMSP430X8XXXX

MSP430FG43xMSP430X2X

MSP430F43x1MSP430X2X

MSP430F44xMSP430X8XXXX

MSP430FG461xMSP430XX8XXXX

MSP430F47xMSP430X2X

MSP430FG47xMSP430X2X

MSP430F47x3MSP430X2X

MSP430F47x4MSP430X2X

MSP430F471xxMSP430XX8XXXX

MSP430F54xxMSP430Xv2XX8XXXX

MSP430F54xxAMSP430Xv2XX8XXXX

MSP430F55xxMSP430Xv2XX8XXXX

2.2.2UsingBreakpoints

Properties

in,butyoudonotwishtouseabreakpoint,disableCIOfunctionalitybychangingtheoptioninProject

ConsoleI/O(CIO)functions,suchasprintf,requiretheuseofabreakpoint.Ifthesefunctionsarecompiled

TheRunToCursoroperationtemporarilyrequiresabreakpoint.

CCSDebugSettings

Resettingaprogramrequiresabreakpoint,whichissetontheaddressdefinedinProject

softwarebreakpointsaredisabled,amaximumofNbreakpointscanbesetwithinthedebugger.

anynumberofbreakpointstobeset,regardlessoftheUseSoftwareBreakpointssettingofCCS.If

messageisshownthatinformstheuserthatnotallbreakpointscanbeenabled.NotethatCCSpermits

IfthedebuggerisstartedwithgreaterthanNbreakpointssetandsoftwarebreakpointsaredisabled,a

Properties

Target

GenericDebuggerOptions

RunTo.

CCSDebugSettings

Target

GenericDebugOptions

EnableCIOfunctionuse.

SLAU157K

May2005

RevisedAugust2009DevelopmentFlow17 –

UsingtheIntegratedDebugger www.ti.com
UsingtheIntegratedDebugger www.ti.com

UsingtheIntegratedDebuggerwww.ti.com

2.2.2.1BreakpointsinCCSv4

Breakafterprogramaddress

clickingonthebreakpointandselectingProperties.

addressaccess.Thepropertiesofbreakpoints/watchpointscanbechangedinthedebuggerbyright

totraditionalbreakpoints,CCSallowssettingwatchpointstobreakonadataaddressaccessinsteadofan

nexttotheBreakpointsiconintheBreakpointwindow(Window

CCSsupportsanumberofpredefinedbreakpointtypesthatcanbeselectedbyopeningamenufound

ShowView

Breakpoints).Inaddition

Stopscodeexecutionwhentheprogramattemptstoexecutecodeafteraspecificaddress.

Breakbeforeprogramaddress

Stopscodeexecutionwhentheprogramattemptstoexecutecodebeforeaspecificaddress.

Breakinprogramrange

Stopscodeexecutionwhentheprogramattemptstoexecutecodeinaspecificrange.

BreakonDMAtransferinrange

BreakonDMAtransfer

BreakswhenaDMAaccesswithinaspecifiedaddressrangeoccurs.

Breakonstackoverflow

beadjustedinProject

programexecutionstopsontheinstructionthatcausedthestackoverflow.Thesizeofthestackcan

(rightclickindebugwindowandthenselect"BreakonStackOverflow"inthecontextmenu).The

Itispossibletodebugtheapplicationsthatcausedthestackoverflow.SetBreakonStackOverflow

Properties

C/C++Build

MSP430Linker

BasicOptions.

Breakpoint

Setsabreakpoint.

Hardwarebreakpoint

Forcesahardwarebreakpointifsoftwarebreakpointsarenotdisabled.

Watchondataaddressrange

Stopscodeexecutionwhendataaccesstoanaddressinaspecificrangeoccurs.

Watch

Stopscodeexecutionifaspecificdataaccesstoaspecificaddressismade.

Watchpointwithdata

Restriction2:Watchpointsareapplicabletovariables8bitsand16bitswide.

functionandrun/restarttheapplication. desired(setcodeBPthere).Thensetthewatchpointanddelete(ordisable)thecodebreakpointinthe lattercase,setabreakpoint(BP)tohaltexecutioninthefunctionwhereobservationofthevariableis

Restriction1:Watchpointsareapplicabletoglobalvariablesandnon-registerlocalvariables.Inthe

Stopscodeexecutionifaspecificdataaccesstoaspecificaddressismadewithaspecificvalue.

Note:NotalloptionsareavailableoneveryMSP430derivative(seeTable2-1

).Therefore,the

selecteddevice.

numberofpredefinedbreakpointtypesinthebreakpointmenuvariesdependingonthe

UsingtheEnhancedEmulationModule(EEM)WithCCEVersion3(

FormoreinformationonadvanceddebuggingwithCCS,seetheapplicationreportAdvancedDebugging

).

18DevelopmentFlowSLAU157K

May2005 –

RevisedAugust2009 –

SLAU157K – May2005 RevisedAugust2009 – AppendixA FrequentlyAskedQuestions anddebuggingtools.

SLAU157K

May2005

RevisedAugust2009 –

AppendixA

FrequentlyAskedQuestions

anddebuggingtools.

Thisappendixpresentssolutionstofrequentlyaskedquestionsregardinghardware,programdevelopment

Topic

Page

A.1Hardware

20

A.2ProgramDevelopment(Assembler,C-Compiler,Linker,IDE)

20

A.3Debugging

21

SLAU157K

May2005

RevisedAugust2009FrequentlyAskedQuestions19 –

Hardware www.ti.com
Hardware www.ti.com

Hardwarewww.ti.com

A.1Hardware

ForacompletelistofhardwarerelatedFAQs,seetheMSP430HardwareToolsUser'sGuideSLAU278

.

A.2ProgramDevelopment(Assembler,C-Compiler,Linker,IDE)

Note:ConsidertheCCSReleaseNotes

andlimitationsofthecurrentCCSversion.Thisinformationcanbeaccessedthroughthe

Forthecaseofunexpectedbehavior,seetheCCSReleaseNotesdocumentforknownbugs

menuitemStart

AllPrograms

TexasInstruments

CodeComposerStudiov4

ReleaseNotes.

1.AcommonMSP430"mistake"istofailtodisablethewatchdogmechanism

enabledbydefault,anditresetsthedeviceifnotdisabledorproperlymanagedbytheapplication.

;thewatchdogis

2.WithintheClibraries,GIE(GlobalInterruptEnable)isdisabledbefore(andrestoredafter)the

hardwaremultiplierisused.

3.ItispossibletomixassemblyandCprogramswithinCCS.Seethe"InterfacingC/C++With

numberSLAU132

AssemblyLanguage"chapteroftheMSP430OptimizingC/C++CompilerUser'sGuide(literature

).

4.Constantdefinitions(#define)usedwithinthe.hfilesareeffectivelyreservedandinclude,for

example,C,Z,N,andV.Donotcreateprogramvariableswiththesenames.

5.Compileroptimizationcanremoveunusedvariablesand/orstatementsthathavenoeffectand

volatileinti;

canaffectdebugging.Topreventthis,thesevariablescanbedeclared

.

volatile

;e.g.,

20FrequentlyAskedQuestionsSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com Debugging
www.ti.com Debugging

www.ti.comDebugging

A.3Debugging

whenusingthedebuggerbothstandaloneandfromtheCCSIDE.

ThedebuggerispartofCCSandcanbeusedasastandaloneapplication.Thissectionisapplicable

Note:ConsidertheCCSreleasenotes

Incaseofunexpectedbehavior,seetheCCSReleaseNotesdocumentforknownbugsand

CodeComposerStudiov4

limitationsofthecurrentCCSversion.Toaccessthisinformation,clickStart

TexasInstruments

ReleaseNotes.

AllPrograms

1.Thedebuggerreportsthatitcannotcommunicatewiththedevice.Possiblesolutionstothis

Ensurethatthecorrectdebuginterfaceandcorrespondingportnumberhavebeenselectedinthe

probleminclude:

*.ccxmlfilewithintheprojectandthatthefilewassavedafterachange.

Ensurethatnoothersoftwareapplication(e.g.printerdrivers,etc.)hasreservedortakencontrolof

Ensurethatthejumpersettingsareconfiguredcorrectlyonthetargethardware.

theCOM/parallelport,whichwouldpreventthedebugserverfromcommunicatingwiththedevice.

OpentheDeviceManageranddetermineifthedriverfortheFETtoolhasbeencorrectlyinstalled

locatedatLPT1.

computers,tryportsettingLPT2andLPT3,evenifoperatingsystemreportsthattheparallelportis

fortheparallelportsettings(seeFAQDebugging#5

andiftheCOM/parallelportissuccessfullyrecognizedbytheWindowsOS.CheckthePCBIOS

).ForusersofIBMorLenovoThinkPad

®

thetopsurface)alignswiththe"1"markonthePCB.

completelyengagethepinsofthedevice),andthatitspin1(indicatedwithacircularindentationon

EnsurethattheMSP430deviceissecurelyseatedinthesocket(sothatthe"fingers"ofthesocket

Restartthecomputer.

CAUTION

useless.Also,alwaysobserveandfollowproperESDprecautions. yourfingers,asyoucaneasilybendthedevicepinsandrenderthedevice

AlwayshandleMSP430deviceswithavacuumpick-uptoolonly;donotuse

PossibleDamageToDevice

2.Thedebuggercandebugapplicationsthatutilizeinterruptsandlow-powermodes.SeeFAQ

Debugging#17

).

3.Thedebuggercannotaccessthedeviceregistersandmemorywhilethedeviceisrunning.The

ConnectthedeviceRST

Workarounds:

MSP-FET430UIFbutismainlyseenonMSP-FET430UIF.

securityfusebeingrecognizedasblownalthoughitisnot.ThisoccursforMSP-FET430PIFand

arepoweredexternally.ThisleadstoanaccidentalfusecheckintheMSP430andresultsintheJTAG

andMSP430-FET430UIFJTAGinterfacetools,thereisaweaknesswhenadaptingtargetboardsthat

.WithcurrentMSP-FET430PIF

usermuststopthedevicetoaccessdeviceregistersandmemory.

4.ThedebuggerreportsthatthedeviceJTAGsecurityfuseisblown

/NMIpintoJTAGheader(pin11),MSP-FET430PIF/MSP-FET430UIF

interfacetoolsareabletopulltheRSTline,thisalsoresetsthedeviceinternalfuselogic.

DonotconnectbothV

Tool(pin2)andV CC

Target(pin4)oftheJTAGheader.Specifyavalue CC

forV

inthedebuggerthatisequaltotheexternalsupplyvoltage. CC

5.Theparallelportdesignators(LPTx)havethefollowingphysicaladdresses:LPT1=378h,

solvingcommunicationproblemsbetweenthedebuggerandthedevice.

Normal)isnotsignificant;ECPseemstoworkwell.SeeFAQDebugging#1foradditionalhintson

LPT2=278h,LPT3=3BCh.Theconfigurationoftheparallelport(ECP,Compatible,Bidirectional,

SLAU157K

May2005

RevisedAugust2009FrequentlyAskedQuestions21 –

Debugging www.ti.com 6. ThedebuggerassertsRST /NMItoresetthedevice whenthedebuggerisstartedandwhenthe

Debuggingwww.ti.com

6.ThedebuggerassertsRST

/NMItoresetthedevicewhenthedebuggerisstartedandwhenthe

manuallyreprogrammed(usingReload),andwhentheJTAGisresynchronized(usingResynchronize

deviceisprogrammed.ThedeviceisalsoresetbythedebuggerResetbutton,andwhenthedeviceis

JTAG).WhenRST

/NMIisnotasserted(low),thedebuggersetsthelogicdrivingRST

/NMItohigh

impedance,andRST

/NMIispulledhighviaaresistoronthePCB.

/NMIpin 7.ThedebuggercandebugadevicewhoseprogramreconfiguresthefunctionoftheRST

thenassertedandnegatedasecondtimeafterdeviceinitializationiscomplete. /NMIis /NMIisassertedandnegatedafterpowerisappliedwhenthedebuggerisstarted.RST RST

toNMI.

8.TheleveloftheXOUT/TCLKpinisundefinedwhenthedebuggerresetsthedevice.Thelogic

drivingXOUT/TCLKissettohighimpedanceatallothertimes.

9.Whenmakingcurrentmeasurementsofthedevice,ensurethattheJTAGcontrolsignalsare

erroneous.SeeFAQDebugging#10

released

,otherwisethedeviceispoweredbythesignalsontheJTAGpinsandthemeasurementsare

.

10.Whenthedebuggerhascontrolofthedevice,theCPUison(i.e.,itisnotinlow-powermode)

onrun. devicewhilethedebuggerhascontrolofthedevice.Instead,runtheapplicationusingReleaseJTAG conditionisrestoredpriortoSTEPorGO.Consequently,donotmeasurethepowerconsumedbythe regardlessofthesettingsofthelow-powermodebitsinthestatusregister.Anylow-powermode

11.TheMEMORYwindowcorrectlydisplaysthecontentsofmemorywhereitispresent.However,the

Memoryshouldbeusedonlyintheaddressrangesasspecifiedbythedevicedatasheet. MEMORYwindowincorrectlydisplaysthecontentsofmemorywherethereisnonepresent.

12.Thedebuggerutilizesthesystemclocktocontrolthedeviceduringdebugging.Therefore,device

debugging(Project

Devicesthatsupportclockcontrolcanfurtherminimizetheseeffectsbystoppingtheclock(s)during

EmulationToolisapartiallyintrusivetool. ACLK)andperipheralscontinuetooperatenormallyduringemulation.Inotherwords,theFlash uponthewatchdogtimer.TheCPUcoreregistersarepreserved.Allotherclocksources(SMCLKand whenthedebuggerhascontrolofthedevice.Specialprecautionsaretakentominimizetheeffect countersandothercomponentsthatareclockedbytheMainSystemClock(MCLK)areaffected

Properties

CCSDebugSettings

Target

ClockControl).

14.Multipleinternalmachinecyclesarerequiredtoclearandprogramtheflashmemory.Whensingle

operationwithaNOPandtosetabreakpointontheinstructionfollowingtheNOP. thewritetoflashoperation.Asimplework-aroundtothislimitationistofollowthewritetoflash

13.Whenprogrammingtheflash,donotsetabreakpointontheinstructionimmediatelyfollowing

NOPandthensteppasttheNOPbeforereviewingtheeffectsoftheflashaccessinstruction. erroneousinformation.Aworkaroundforthisbehavioristofollowtheflashaccessinstructionwitha theseoperationsarecomplete.Consequently,thedebuggerupdatesitsmemorywindowwith steppingoverinstructionsthatmanipulatetheflash,controlisgivenbacktothedebuggerbefore

15.Bitsthatareclearedwhenreadduringnormalprogramexecution(i.e.,interruptflags)are

donotbehavethisway(i.e.,thebitsarenotclearedbythedebuggerreadoperations).

UsingcertainMSP430deviceswithenhancedemulationlogicsuchasMSP430F43x/44xdevices,bits

clearedwhenreadwhilebeingdebugged(i.e.,memorydump,peripheralregisters).

16.ThedebuggercannotbeusedtodebugprogramsthatexecuteintheRAMofF12xandF41x

devices.Aworkaroundforthislimitationistodebugprogramsinflash.

17.Whilesinglesteppingwithactiveandenabledinterrupts,itcanappearthatonlytheinterrupt

aninterruptrequest(Project

OndeviceswithClockControl,itmaybepossibletosuspendaclockbetweensinglestepsanddelay Registerwindow. withoutinterrupts).Interruptscanlaterbere-enabledbysettingGIEinthestatusregisterinthe interruptsaredisabledafterexitingtheISR.Thispermitsthenon-ISRcodetobedebugged(but workaroundforthisbehavioris,whilewithintheISR,todisabletheGIEbitonthestack,sothat processesanactiveandenabledinterruptbeforeprocessingnon-ISR(i.e.,mainline)code.A operationstopsonthefirstlineoftheISR).However,thisbehavioriscorrectbecausethedevice serviceroutine(ISR)isactive(i.e.,thenon-ISRcodeneverappearstoexecute,andthesinglestep

Properties

CCSDebugSettings

Target

ClockControl).

22FrequentlyAskedQuestionsSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com Debugging
www.ti.com Debugging

www.ti.comDebugging

18.OndevicesequippedwithaDataTransferController(DTC),thecompletionofadatatransfercycle

instructionfollowingthelow-powermodeinstruction,andthenexecute(Run)tothisbreakpoint. appearsthatthesinglestephasnoeffect.Aworkaroundtothissituationistosetabreakpointonthe low-powermodeinstructiononlyafteraninterruptisprocessed.Untilaninterruptisprocessed,it preemptsasinglestepofalow-powermodeinstruction.Thedeviceadvancesbeyondthe

19.ThetransferofdatabytheDataTransferController(DTC)maynotstoppreciselywhenthe

stoppedinresponsetoasinglesteporabreakpoint. configuredfortwo-blocktransfermode,theDTCmaynotstoppreciselyonablockboundarywhen singlestepisperformed,oneormorebytesofdatacanbetransferred.WhentheDTCisenabledand DTCisstoppedinresponsetoasinglesteporabreakpoint.WhentheDTCisenabledanda

20.Breakpoints.CCSsupportsanumberofpredefinedbreakpointandwatchpointtypes.See

Section2.2.2foradetailedoverview.

SLAU157K

May2005

RevisedAugust2009FrequentlyAskedQuestions23 –

24FrequentlyAskedQuestionsSLAU157K

May2005 –

RevisedAugust2009 –

SLAU157K – May2005 RevisedAugust2009 – AppendixB IAR2.x/3.x/4.xtoCCSC-Migration differencesbetweenthetwocompilers.

SLAU157K

May2005

RevisedAugust2009 –

AppendixB

IAR2.x/3.x/4.xtoCCSC-Migration

differencesbetweenthetwocompilers.

implementation-specificextensionsdifferandneedtobeported.Thisappendixdocumentsthemajor

notfullycompatible.WhilethestandardANSI/ISOCcodeisportablebetweenthesetools,

SourcecodefortheTICCSCcompilerandsourcecodefortheIAREmbeddedWorkbenchcompilerare

Topic

Page

B.1InterruptVectorDefinition

26

B.2IntrinsicFunctions

26

B.3DataandFunctionPlacement

26

B.4CCallingConventions

28

B.5OtherDifferences

28

SLAU157K

May2005

RevisedAugust2009IAR2.x/3.x/4.xtoCCSC-Migration25 –

InterruptVectorDefinition www.ti.com
InterruptVectorDefinition www.ti.com

InterruptVectorDefinitionwww.ti.com

B.1InterruptVectorDefinition

thecaseforallotherIARpragmadirectives.

IARISRdeclarations(usingthe#pragmavector=)arenowfullysupportedinCCS.However,thisisnot

B.2IntrinsicFunctions

CCSandIARtoolsusethesameinstructionsforMSP430processor-specificintrinsicfunctions.

B.3DataandFunctionPlacement

B.3.1DataPlacementatanAbsoluteLocation

/*IARCCode*/

directiveisnotsupportedwiththeCCScompiler:

TheschemeimplementedintheIARcompilerusingeitherthe@operatororthe#pragmalocation

no_initcharalpha@0x0200;/*Place‘

constintbeta;

#pragmalocation=0x0202

alpha'ataddress0x200*/

/*CCSLinkerCommandFileEntry*/

MSP430devicewith128bytesofRAM):

beshifted4bytesfrom0x0200to0x0204,whichreducesthelengthfrom0x0080to0x007C(foran

mustbemodifiedwithinthelinkercommandfile.Forthepreviousexample,theRAMstartaddressmust

overwrittenasthelinkerdynamicallyallocatesaddresses.ThestartaddressandlengthoftheRAMblock

TheabsoluteRAMlocationsmustbeexcludedfromtheRAMsegment;otherwise,theircontentmaybe

externintbeta; externcharalpha; /*CCSCCode*/

beta=0x202;

alpha=0x200;

/*CCSLinkerCommandFileEntry*/

thendeclaringthevariablesasexternintheCcode:

Ifabsolutedataplacementisneeded,thiscanbeachievedwithentriesintothelinkercommandfile,and

/****************************************************************************/

/*SPECIFYTHESYSTEMMEMORYMAP*/

/****************************************************************************/

MEMORY/*assumingadevicewith128bytesofRAM*/

{

RAM:origin=0x0204,length=0x007C/*was:origin=0x200,length=0x0080*/

}

absolutelocations.

device-specificheaderfiles(msp430xxxx.h)thataresuppliedwithCCSareanexampleofplacingdataat

Thedefinitionsoftheperipheralregistermapinthelinkercommandfiles(lnk_msp430xxxx.cmd)andthe

Note:Whenaprojectiscreated,CCScopiesthelinkercommandfilecorrespondingtotheselected

project-specificlinkercommandfilesfordifferentprojectsusingthesamedevice.

linkercommandfilechangesaredoneintheprojectdirectory.Thisallowstheuseof

Root

MSP430derivativefromtheincludedirectory(

Installation <

>

\tools

\compiler

\MSP430

\include)intotheprojectdirectory.Therefore,ensurethatall

26IAR2.x/3.x/4.xtoCCSC-MigrationSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com DataandFunctionPlacement
www.ti.com DataandFunctionPlacement

www.ti.comDataandFunctionPlacement

B.3.2DataPlacementIntoNamedSegments

/*IARCCode*/

directive:

InIAR,itispossibletoplacevariablesintonamedsegmentsusingeitherthe@operatorora#pragma

no_initintalpha@"MYSEGMENT";/*Place‘

constintbeta;

#pragmalocation="MYSEGMENT"/*Place‘

beta'into‘

alpha'into‘

MYSEGMENT'*/

MYSEGMENT'*/

SeeSectionB.5.3forinformationonhowtotranslatememorysegmentnamesbetweenIARandCCS.

constintbeta;

#pragmaDATA_SECTION(beta,"MYSEGMENT")

intalpha;

#pragmaDATA_SECTION(alpha,"MYSEGMENT")

/*CCSCCode*/

WiththeCCScompiler,the#pragmaDATA_SECTION()directivemustbeused:

B.3.3FunctionPlacementIntoNamedSegments

voidg(void)@"MYSEGMENT"

/*IARCCode*/

#pragmalocationdirective:

WiththeIARcompiler,functionscanbeplacedintoanamedsegmentusingthe@operatororthe

}

{

voidh(void)

#pragmalocation="MYSEGMENT"

}

{

voidg(void)

#pragmaCODE_SECTION(g,"MYSEGMENT")

/*CCSCCode*/

used:

WiththeCCScompiler,thefollowingschemewiththe#pragmaCODE_SECTION()directivemustbe

SeeSectionB.5.3forinformationonhowtotranslatememorysegmentnamesbetweenIARandCCS.

}

{

SLAU157K

May2005

RevisedAugust2009IAR2.x/3.x/4.xtoCCSC-Migration27 –

CCallingConventions www.ti.com
CCallingConventions www.ti.com

CCallingConventionswww.ti.com

B.4CCallingConventions

IARVersion:

big-endianbyteorder.Itcanbeseenthattheparameter‘

Thefollowingexampleisafunctionthatwritesthe32-bitword'Data'toagivenmemorylocationin

MSP430C/C++CompilerReferenceGuide

conventions,seetheTIMSP430OptimizingC/C++CompilerUser'sGuide(

functionsneedtobemodifiedtoreflectthesechanges.Fordetailedinformationaboutthecalling

WhenportingamixedCandassemblyprojecttotheTICCScodegenerationtools,theassembly

TheCCSandIARC-compilersusedifferentcallingconventionsforpassingparameterstofunctions.

)andtheIAR

.

Data'ispassedusingdifferentCPUregisters.

;----------------------------------------------------------------------------

;R15UpperWord(Data)

;R14LowerWord(Data)

;IN:R12Address(Add)

;

;memoryaddressMUSTbeword-aligned.

;WritesaDWORDtothegivenmemorylocationinbig-endianformat.The

;

;voidWriteDWBE(unsignedchar*Add,unsignedlongData)

;----------------------------------------------------------------------------

WriteDWBE

ret

mov.wR14,2(R12);Write2ndwordtomemory

mov.wR15,0(R12);Write1stwordtomemory

swpbR15;Swapbytesinupperword

swpbR14;Swapbytesinlowerword

CCSVersion:

;----------------------------------------------------------------------------

;R14UpperWord(Data)

;R13LowerWord(Data)

;IN:R12Address(Add)

;

;memoryaddressMUSTbeword-aligned.

;WritesaDWORDtothegivenmemorylocationinbig-endianformat.The

;

;voidWriteDWBE(unsignedchar*Add,unsignedlongData)

;----------------------------------------------------------------------------

WriteDWBE

ret

mov.wR13,2(R12);Write2ndwordtomemory

mov.wR14,0(R12);Write1stwordtomemory

swpbR14;Swapbytesinupperword

swpbR13;Swapbytesinlowerword

B.5OtherDifferences

B.5.1InitializingStaticandGlobalVariables

intCounter;

/*IAR,globalvariable,initializedto0uponprogramstart*/

programisloadedandisimplementedintheIARcompiler:

mustbepre-initializedto0(beforetheprogrambeginsrunning).Thistaskistypicallyperformedwhenthe

TheANSI/ISOCstandardspecifiesthatstaticandglobal(extern)variableswithoutexplicitinitializations

intCounter=0;

/*CCS,globalvariable,manuallyzero-initialized*/

tofulfillthisrequirement:

However,theTICCScompilerdoesnotpre-initializethesevariables;therefore,itisuptotheapplication

28IAR2.x/3.x/4.xtoCCSC-MigrationSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com OtherDifferences B.5.2CustomBootRoutine int /*IARCCode*/ achievedbyprovidingacustomized

www.ti.comOtherDifferences

B.5.2CustomBootRoutine

int

/*IARCCode*/

achievedbyprovidingacustomized

performearlyinitializationssuchasconfiguringperipherals,oromitdatasegmentinitialization.Thisis

WiththeIARcompiler,theCstartupfunctioncanbecustomized,givingtheapplicationachanceto

low_level_init()function:

low_level_init(void)

{=

/*Insertyourlow-levelinitializationshere*/

return(1);

/*==================================*/

/*1toruninitialization*/

/*Return:0toomitinitialization*/

/*shouldbedoneornot.*/

/*Chooseifsegmentinitialization*/

/*==================================*/

}

int_system_pre_init(void)

/*CCSCCode*/

IARcompiler.

CCSCcompiler,thecustombootroutinenameis_system_pre_init().Itisusedthesamewayasinthe

ThereturnvaluecontrolswhetherornotdatasegmentsareinitializedbytheCstartupcode.Withthe

{

 

/*Insertyourlow-levelinitializationshere*/

/*==================================*/

/*Chooseifsegmentinitialization*/

/*shouldbedoneornot.*/

/*Return:0toomitinitialization*/

/*1toruninitialization*/

/*==================================*/

return(1);

}

initialization.Theusermustensurethatimportantvariablesareinitializedatruntimebeforetheyareused.

Notethatomittingsegmentinitializationwithbothcompilersomitsbothexplicitandnon-explicit

B.5.3PredefinedMemorySegmentNames

commonlyusedsegmentnames.

commandfilesformoredetailedinformation.Thefollowingtableshowshowtoconvertthemost

commandfilesinbothCCSandIARtools.However,differentsegmentnamesareused.Seethelinker

Memorysegmentnamesfordataandfunctionplacementarecontrolledbydevice-specificlinker

Description

CCSSegmentName

IARSegmentName

   

DATA16_N

RAM

.bss

DATA16_I

DATA16_Z

Stack(RAM)

.stack

CSTACK

Mainmemory(flashorROM)

.text

CODE

   

INFOA

Informationmemory(flashorROM)

.infoB

.infoA

INFO

INFOB

 

.int00

 

.int01

Interruptvectors(flashorROM)

INTVEC

.int14

Resetvector(flashorROM)

.reset

RESET

SLAU157K

May2005

RevisedAugust2009IAR2.x/3.x/4.xtoCCSC-Migration29 –

OtherDifferences www.ti.com
OtherDifferences www.ti.com

OtherDifferenceswww.ti.com

B.5.4PredefinedMacroNames

definedusingthe#ifdefdirective.

creatingcodethatcanbecompiledandusedondifferentcompilerplatforms.Checkifamacronameis

BothIARandCCScompilersupportafewnonANSI/ISOstandardpredefinedmacronames,whichhelp

Description

CCSMacroName

IARMacroName

IsMSP430thetargetandisaparticularcompiler

MSP430

ICC430

platformused?

Isaparticularcompilerplatformused?

TI_COMPILER_VERSION

IAR_SYSTEMS_ICC

IsaCheaderfileincludedfromwithinassembly

ASM_HEADER

IAR_SYSTEMS_ASM

sourcecode?

30IAR2.x/3.x/4.xtoCCSC-MigrationSLAU157K

May2005 –

RevisedAugust2009 –

SLAU157K – May2005 RevisedAugust2009 – AppendixC IAR2.x/3.x/4.xtoCCSAssemblerMigration directives.

SLAU157K

May2005

RevisedAugust2009 –

AppendixC

IAR2.x/3.x/4.xtoCCSAssemblerMigration

directives.

documentsthedifferencesbetweentheCCSassemblerdirectivesandtheIAR2.x/3.xassembler

instructionmnemonicsareidentical,whiletheassemblerdirectivesaresomewhatdifferent.Thisappendix

SourcefortheTICCSassemblerandsourcecodefortheIARassemblerarenot100%compatible.The

Topic

Page

C.1SharingC/C++HeaderFilesWithAssemblySource

32

C.2SegmentControl

32

C.3TranslatingA430AssemblerDirectivestoAsm430Directives

33

SLAU157K

May2005

RevisedAugust2009IAR2.x/3.x/4.xtoCCSAssemblerMigration31 –

SharingC/C++HeaderFilesWithAssemblySource www.ti.com
SharingC/C++HeaderFilesWithAssemblySource www.ti.com

SharingC/C++HeaderFilesWithAssemblySourcewww.ti.com

C.1SharingC/C++HeaderFilesWithAssemblySource

#include"msp430x14x.h"//Includedeviceheaderfile

intotheassemblycode:

directincludingofC/C++headerfilessuchastheMSP430device-specificheaderfiles(msp430xxxx.h)

TheIARA430assemblersupportscertainC/C++preprocessordirectivesdirectlyand,thereby,allows

containingdeclarationsandprototypesbetweentheC/C++andassemblycode:

directiveallowsprogrammersinmixedassemblyandC/C++environmentstoshareC/C++headers

WiththeCCSAsm430assembler,adifferentschemethatusesthe.cdeclsdirectivemustbeused.This

.cdeclsC,LIST,"msp430x14x.h";Includedeviceheaderfile

Guide(literaturenumberSLAU131

Moreinformationonthe.cdeclsdirectivecanbefoundintheMSP430AssemblyLanguageToolsUser's

).

C.2SegmentControl

ORG,ASEG,RSEG,andCOMMON.

TheCCSAsm430assemblerdoesnotsupportanyoftheIARA430segmentcontroldirectivessuchas

Description

Asm430Directive(CCS)

Reservespaceinthe.bssuninitializedsection

.bss

Reservespaceinanameduninitializedsection

.usect

Allocateprogramintothedefaultprogramsection(initialized)

.text

Allocatedataintoanamedinitializedsection

.sect

;--------------------------------------------------------------------------

;InterruptVectorsUsedMSP430x11x1/12x(2)–IARAssembler

;--------------------------------------------------------------------------

interruptvectorassignmentinbothIARandCCSassemblytohighlightthedifferences.

create/usememorysectionsdefinedinthelinkercommandfiles.Thefollowingexampledemonstrates

ToallocatecodeanddatasectionstospecificaddresseswiththeCCSassembler,itisnecessaryto

ORG0FFFEh;MSP430RESETVector

DWTA0_ISR;

ORG0FFF2h;Timer_A0Vector

DWRESET;

;--------------------------------------------------------------------------

;InterruptVectorsUsedMSP430x11x1/12x(2)-CCSAssembler

;--------------------------------------------------------------------------

.shortTA0_ISR;

.sect".int09";Timer_A0Vector

.shortRESET;

.sect".reset";MSP430RESETVector

SectionB.5.3forinformationonhowtotranslatememorysegmentnamesbetweenIARandCCS.

used.NotethatthelinkercommandfilesaredifferentbetweenIARandCCSandcannotbereused.See

Bothexamplesassumethatthestandarddevicesupportfiles(headerfiles,linkercommandfiles)are

32IAR2.x/3.x/4.xtoCCSAssemblerMigrationSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives
www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives

www.ti.comTranslatingA430AssemblerDirectivestoAsm430Directives

C.3TranslatingA430AssemblerDirectivestoAsm430Directives

C.3.1Introduction

AssemblerReferenceGuidefromIAR.

AssemblyLanguageToolsUser'sGuide(

intendedonlyasaguidefortranslation.Fordetaileddescriptionsofeachdirective,seeeithertheMSP430

assembler(A430)toTexasInstrumentsCCSAsm430assembler(Asm430)directives.Thesesectionsare

Thefollowingsectionsdescribe,ingeneral,howtoconvertassemblerdirectivesfortheIARA430

),fromTexasInstruments,ortheMSP430IAR

Note:Onlytheassemblerdirectivesrequireconversion

suchasthesectionprogramcounter($)andthecommentdelimiter(;).

assemblersusethesameinstructionmnemonics,operands,operators,andspecialsymbols

Onlytheassemblerdirectivesrequireconversion,nottheassemblerinstructions.Both

uppercasetodistinguishthemfromtheAsm430directives,whichareshowninlowercase.

TheA430assemblerisnotcasesensitivebydefault.ThesesectionsshowtheA430directiveswrittenin

C.3.2CharacterStrings

(

charactertogetherwithquote(

usesCsyntaxforcharacterstrings:Aquoteisrepresentedusingthebackslashcharacterasanescape

Inadditiontousingdifferentdirectives,eachassemblerusesdifferentsyntaxforcharacterstrings.A430

\")andthebackslashitselfisrepresentedbytwoconsecutivebackslashes

\).InAsm430syntax,aquoteisrepresentedbytwoconsecutivequotes("");seeexamples: \

 

CharacterString

 

Asm430Syntax(CCS)

 

A430Syntax(IAR)

PLAN"C"

"PLAN""C"""

"PLAN\"C

\""

\dos

\command.com

"

\dos

\command.com"

"

\dos

\

\command.com"

\

Concatenatedstring(i.e.Error41)

-

"Error""41"

 

SLAU157K

May2005

RevisedAugust2009IAR2.x/3.x/4.xtoCCSAssemblerMigration33 –

TranslatingA430AssemblerDirectivestoAsm430Directives www.ti.com C.3.3SectionControlDirectives

TranslatingA430AssemblerDirectivestoAsm430Directiveswww.ti.com

C.3.3SectionControlDirectives

segmentsmustbeexactlythesamesizeandlayout.

containtheinitializersandwouldbecopiedtoRAMsegmentbyastart-uproutine.Inthiscase,the

Apairofsegmentscanbeusedtomakeinitialized,modifiabledataPROM-able.TheROMsegmentwould

(initialized)data,andCODEforexecutablecode.Thefollowingtableusesthesenames.

toadheretothenamesusedbytheCcompiler:DATA16_Zforuninitializeddata,CONSTforconstant

A430alsousessectionsorsegments,buttherearenopredefinedsegmentnames.Often,itisconvenient

.textsection. dataisassembledintothe.bsssection,initializeddataintothe.datasection,andexecutablecodeintothe

Asm430hasthreepredefinedsectionsintowhichvariouspartsofaprogramareassembled.Uninitialized

Description

 

Asm430Directive(CCS)

A430Directive(IAR)

Reservesizebytesinthe.bss(uninitializeddata)

.bss

(1)

(2)

section

Assembleintothe.data(initializeddata)section

.data

 

RSEGconst

Assembleintoanamed(initialized)section

.sect

 

RSEG

Assembleintothe.text(executablecode)section

.text

RSEGcode

Reservespaceinanamed(uninitialized)section

.usect

(1)

(2)

Alignmentonbyteboundary

.align1

 

(3)

Alignmentonwordboundary

.align2

 

EVEN

(1)

.bssand.usectdonotrequireswitchingbackandforthbetweentheoriginalandtheuninitializedsection.Forexample:

;

IAR

Assembler

Example

 

RSEGDATA16_N;

Switch

to

DATA

segment

EVEN;

Ensure

proper

alignment

 

ADCResult:DS2;

Allocate

word 1

in

RAM

Flags:DS1;

Allocate

byte 1

in

RAM

 

RSEGCODE;

Switch

back

to

CODE

segment

 

;

CCS

Assembler

Example

#1

ADCResult.usect".bss",2,2;

Allocate

word 1

in

RAM

Flags.usect".bss",1;

Allocate

byte 1

in

RAM

;

CCS

Assembler

Example

#2

 

.bssADCResult,2,2;

Allocate

word 1

in

RAM

.bssFlags,1;

Allocate

byte 1

in

RAM

(2)

Spaceisreservedinanuninitializedsegmentbyfirstswitchingtothatsegment,thendefiningtheappropriatememoryblock,

andthenswitchingbacktotheoriginalsegment.Forexample:

 
 

RSEGDATA16_Z

 
 

LABEL:DS16;

Reserve

16

byte

 
 

RSEGCODE

 

(3)

Initializationofbit-fieldconstants(.field)isnotsupported,therefore,thesectioncounterisalwaysbyte-aligned.

C.3.4ConstantInitializationDirectives

Description

Asm430Directive(CCS)

A430Directive(IAR)

Initializeoneormoresuccessivebytesortextstrings

.byteor.string

DB

Initializea32-bitIEEEfloating-pointconstant

.doubleor.float

DF

Initializeavariable-lengthfield

.field

(1)

Reservesizebytesinthecurrentsection

.space

DS

Initializeoneormoretextstrings

Initializeoneormoretextstrings

DB

Initializeoneormore16-bitintegers

.word

DW

Initializeoneormore32-bitintegers

.long

DL

(1)

;

Initializationofbit-fieldconstants(.field)isnotsupported.ConstantsmustbecombinedintocompletewordsusingDW.

Asm430

code;

A430

code

.field

5,3\

.field

12,4|-

>DW

(30

<

<

(4+3))|(12

<

<

3)|5;

equals

3941

.field

30,8/

34IAR2.x/3.x/4.xtoCCSAssemblerMigrationSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives
www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives

www.ti.comTranslatingA430AssemblerDirectivestoAsm430Directives

C.3.5ListingControlDirectives

Description

Asm430Directive(CCS)

A430Directive(IAR)

Allowfalseconditionalcodeblocklisting

.fclist

LSTCND-

Inhibitfalseconditionalcodeblocklisting

.fcnolist

LSTCND+

Setthepagelengthofthesourcelisting

.length

PAGSIZ

Setthepagewidthofthesourcelisting

.width

COL

Restartthesourcelisting

.list

LSTOUT+

Stopthesourcelisting

.nolist

LSTOUT-

Allowmacrolistingsandloopblocks

.mlist

LSTEXP+(macro)

LSTREP+(loopblocks)

Inhibitmacrolistingsandloopblocks

.mnolist

LSTEXP-(macro)

LSTREP-(loopblocks)

Selectoutputlistingoptions

.option

(1)

Ejectapageinthesourcelisting

.page

PAGE

Allowexpandedsubstitutionsymbollisting

.sslist

(2)

Inhibitexpandedsubstitutionsymbollisting

.ssnolist

(2)

Printatitleinthelistingpageheader

.title

(3)

(1)

(3)

(2)

Thetitleinthelistingpageheaderisthesourcefilename. Thereisnodirectivethatdirectlycorrespondsto.sslist/.ssnolist. (withsuboptions)shouldbeusedtoreplacethe.optiondirective.

NoA430directivedirectlycorrespondsto.option.Theindividuallistingcontroldirectives(above)orthecommand-lineoption-c

C.3.6FileReferenceDirectives

Description

Asm430Directive(CCS)

A430Directive(IAR)

Includesourcestatementsfromanotherfile

.copyor.include

#includeor$

Identifyoneormoresymbolsthataredefinedinthe

.def

PUBLICorEXPORT

currentmoduleandusedinothermodules

Identifyoneormoreglobal(external)symbols

.global

(1)

Defineamacrolibrary

.mlib

(2)

Identifyoneormoresymbolsthatareusedinthe

.ref

EXTERNorIMPORT

currentmodulebutdefinedinanothermodule

(1)

(2)

Theconceptofmacrolibrariesisnotsupported.Includefileswithmacrodefinitionsmustbeusedforthisfunctionality.

EXTERNmustbeusedasapplicablewiththeA430assemblertoreplacethe.globaldirective.

Thedirective.globalfunctionsaseither.defifthesymbolisdefinedinthecurrentmodule,or.refotherwise.PUBLICor

endofmodulesintheA430assembler.

symbolinthemoduleisreferencedexternally.Thefollowingdirectivesareusedtomarkthebeginningand linkedconditionally.Thismeansthatalibrarymoduleisincludedinthelinkedexecutableonlyifapublic preprocessordirective)orMACROare"undefined"atmoduleend.Librarymodulesare,furthermore, containmultiplemodulesorroutines.AllsymbolsexceptthosecreatedbyDEFINE,#define(IAR

ModulesmaybeusedwiththeAsm430assemblertocreateindividuallylinkableroutines.Afilemay

AdditionalA430Directives(IAR)

A430Directive(IAR)

Startaprogrammodule

NAMEorPROGRAM

Startalibrarymodule

MODULEorLIBRARY

Terminatethecurrentprogramorlibrarymodule

ENDMOD

SLAU157K

May2005

RevisedAugust2009IAR2.x/3.x/4.xtoCCSAssemblerMigration35 –

TranslatingA430AssemblerDirectivestoAsm430Directives www.ti.com
TranslatingA430AssemblerDirectivestoAsm430Directives www.ti.com

TranslatingA430AssemblerDirectivestoAsm430Directiveswww.ti.com

C.3.7ConditionalAssemblyDirectives

Description

Asm430Directive(CCS)

A430Directive(IAR)

Optionalrepeatableblockassembly

.break

(1)

Beginconditionalassembly

.if

IF

Optionalconditionalassembly

.else

ELSE

Optionalconditionalassembly

.elseif

ELSEIF

Endconditionalassembly

.endif

ENDIF

Endrepeatableblockassembly

.endloop

ENDR

Beginrepeatableblockassembly

.loop

REPT

(1)

SEQMACROFROM,TO;

repeatableblockassemblyisusedinamacro,asshown:

Thereisnodirectivethatdirectlycorrespondsto.break.However,theEXITMdirectivecanbeusedwithotherconditionalsif

Initialize

a

sequence

of

byte

constants

LOCALX

XSETFROM

XSETX+1;

DBX;

ENDIF

EXITM

>255;

REPTTO-FROM+1;

IFX

Break

Repeat

X

from

exceeds

FROM

to

255

TO

if

Increment

Initialize

counter

bytes

to

FROM

TO

ENDM

ENDR

C.3.8SymbolControlDirectives

Inaddition,thepreprocessordirective#definealsocanbeusedtodefinelocalsymbols.

A430,symbolsareeitherlocaltoamacro(LOCAL),localtoamodule(EQU),orglobaltoafile(DEFINE).

toafileorlocaltoamoduleormacro.Localsymbolscanbeundefinedwiththe.newblockdirective.In

Thescopeofassembly-timesymbolsdiffersinthetwoassemblers.InAsm430,definitionscanbeglobal

Description

Asm430Directive(CCS)

A430Directive(IAR)

Assignacharacterstringtoasubstitutionsymbol

.asg

SETorVARorASSIGN

Undefinelocalsymbols

.newblock

(1)

Equateavaluewithasymbol

.equor.set

EQUor=

Performarithmeticonnumericsubstitutionsymbols

.eval

SETorVARorASSIGN

Endstructuredefinition

.endstruct

(2)

Beginastructuredefinition

.struct

(2)

Assignstructureattributestoalabel

.tag

(2)

(1)

(2)

baseaddressplussymbolicoffset,asshown:

Definitionofstructuretypesisnotsupported.Similarfunctionalityisachievedbyusingmacrostoallocateaggregatedataand

implicitlyundefinedattheendofamacroormodule. #definedirective.Also,macrosormodulesmaybeusedtoachievethe.newblockfunctionalitybecauselocalsymbolsare

NoA430directivedirectlycorrespondsto.newblock.However,#undefmaybeusedtoresetasymbolthatwasdefinedwiththe

MYSTRUCT:

MACRO

DS

4

ENDM

HIDEFINE2

LODEFINE0

RSEGDATA16_Z

RSEGCODE XMYSTRUCT

MOVX+LO,R4

36IAR2.x/3.x/4.xtoCCSAssemblerMigrationSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives
www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives

www.ti.comTranslatingA430AssemblerDirectivestoAsm430Directives

C.3.9MacroDirectives

Description

Asm430Directive(CCS)

 

A430Directive(IAR)

Defineamacro

.macro

MACRO

 

Exitprematurelyfromamacro

.mexit

EXITM

Endmacrodefinition

.endm

ENDM

Description

Asm430Directive(CCS)

 

A430Directive(IAR)

Senduser-definederrormessagestotheoutput

 

#error

 

device

.emsg

Senduser-definedmessagestotheoutputdevice

.mmsg

#message

(1)

Senduser-definedwarningmessagestothe

 

(2)

outputdevice

.wmsg

Definealoadaddresslabel

.label

(3)

Directiveproducedbyabsolutelister

.setsect

ASEG

(4)

Directiveproducedbyabsolutelister

.setsym

EQUor=

(4)

Programend

.end

END

C.3.10MiscellaneousDirectives

(1)

(3)

(2)

(4)

achievethesameeffect,labelscanbegivenabsolute(run-time)addressesbytheEQUdirectives.

Theconceptofload-timeaddressesisnotsupported.Run-timeandload-timeaddressesareassumedtobethesame.To

Warningmessagescannotbeuser-defined.#messagemaybeused,butthewarningcounterisnotincremented.

Thiscauses'#message<

>"

Thesyntaxofthe#messagedirectiveis:#message"

<

string

string

>'tobeoutputtotheprojectbuildwindowduringassemble/compiletime.

.labelload_startload_start:

;

Asm430

code;

A430

code

Run_start:<

code

>

code <

>load_end:

symbols.

AlthoughnotproducedbytheabsolutelisterASEGdefinesabsolutesegmentsandEQUcanbeusedtodefineabsolute .labelload_endrun_end:EQUrun_start+load_end-load_start

Run_end:run_start:EQU240H

MYFLAGEQU23EH;

MYFLAG

is

located

at

23E

ASEG240H;

Absolute

segment

at

240

MAIN:MOV#23CH,SP;

MAIN

is

located

at

240

SLAU157K

May2005

RevisedAugust2009IAR2.x/3.x/4.xtoCCSAssemblerMigration37 –

TranslatingA430AssemblerDirectivestoAsm430Directives www.ti.com
TranslatingA430AssemblerDirectivestoAsm430Directives www.ti.com

TranslatingA430AssemblerDirectivestoAsm430Directiveswww.ti.com

C.3.11AlphabeticalListingandCrossReferenceofAsm430Directives

Asm430Directive

Asm430Directive

(CCS)

A430Directive(IAR)

(CCS)

A430Directive(IAR)

.alignALIGN

.loopREPT

.asgSETorVARorASSIGN

.macroMACRO

.breakSeeConditionalAssemblyDirectives

.mexitEXITM

.bssSeeSymbolControlDirectives

.mlibSeeFileReferencingDirectives

.byteor.stringDB

.mlistLSTEXP+(macro)

.cdecls

Cpre-processordeclarationsare

 

LSTREP+(loopblocks)

inherentlysupported.

.copyor.include#includeor$

.mmsg#message(XXXXXX)

.dataRSEG

.mnolistLSTEXP-(macro)

.defPUBLICorEXPORT

 

LSTREP-(loopblocks)

.doubleNotsupported

.newblockSeeSymbolControlDirectives

.elseELSE

.nolistLSTOUT-

.elseifELSEIF

.optionSeeListingControlDirectives

.emsg#error

.pagePAGE

.endEND

.refEXTERNorIMPORT

.endifENDIF

.sectRSEG

.endloopENDR

.setsectSeeMiscellaneousDirectives

.endmENDM

.setsymSeeMiscellaneousDirectives

.endstructSeeSymbolControlDirectives

.spaceDS

.equor.setEQUor=

.sslistNotsupported

.evalSETorVARorASSIGN

.ssnolistNotsupported

.evenEVEN

.stringDB

.fclistLSTCND-

.structSeeSymbolControlDirectives

.fcnolistLSTCND+

.tagSeeSymbolControlDirectives

.fieldSeeConstantInitializationDirectives

.textRSEG

.floatSeeConstantInitializationDirectives

.titleSeeListingControlDirectives

.globalSeeFileReferencingDirectives

.usectSeeSymbolControlDirectives

.ifIF

.widthCOL

.labelSeeMiscellaneousDirectives

.wmsgSeeMiscellaneousDirectives

.lengthPAGSIZ

.wordDW

.listLSTOUT+

 

38IAR2.x/3.x/4.xtoCCSAssemblerMigrationSLAU157K

May2005 –

RevisedAugust2009 –

www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives
www.ti.com TranslatingA430AssemblerDirectivestoAsm430Directives

www.ti.comTranslatingA430AssemblerDirectivestoAsm430Directives

C.3.12UnsupportedA430Directives(IAR)

ThefollowingIARassemblerdirectivesarenotsupportedintheCCSAsm430assembler:

ConditionalAssemblyDirectives

MacroDirectives

   

REPTC

(1)

LOCAL

(2)

 

REPTI

   

FileReferencingDirectives

MiscellaneousDirectives

 

SymbolControlDirectives

NAMEorPROGRAM

RADIX

DEFINE

MODULEorLIBRARY

CASEON

SFRB

ENDMOD

CASEOFF

 

SFRW

ListingControlDirectives

C-StylePreprocessorDirectives

(3)

SymbolControlDirectives

LSTMAC(+/-)

#define

ASEG

LSTCOD(+/-)

#undef

RSEG

LSTPAG(+/-)

#if,#else,#elif

 

COMMON

LSTXREF(+/-)

#ifdef,#ifndef

 

STACK

 

#endif

ORG

 

#include

 
 

#error

 

(1)