Anda di halaman 1dari 52

UniversityofFlorida ElectricalandComputerEngineering EEL3923&EEL4924

MicrochipMPLABandC18compilersetup.


StarttheMPLABsetupprogram.

Clicknext.

Acceptandclicknext.

Clicknext.

Clicknext.

Clicknext.

Clicknext.

Clicknext. Thesoftwarewillnowinstall.

ClickNo.

ClickNoandthentheFinishbutton,wewillrestartlater.

Nextwewillinstallthecompiler.NavigatetotheMPLABC18Litedirectoryandstarttheapplication.

ClickNext.

SelectIAcceptandclicknext.

Clicknext.

ClickNext.

Selectallfourboxesandclicknext.

Selectallfourboxesandclicknext.

Clicknext. Thesoftwarewillnowinstall.

NextclickFinish. Unselecttheboxesyoudontwanttoopenandread.

Nowreboot.

Afteryouloginthiswindowwillpopup. Youcanjustcloseit.

ClickthisicontostartMPLABIDE.

Thesoftwareisnowinstalled. Thenextsectionwillcoverthesetting upandbuildingofanewproject.

Thisiswhatyoushouldseewhentheprogramstarts.

InthetoolbarselectProjectandthenProjectWizard.

ClickNext.

SelectPIC18F1320.

MakesurethattheActiveToolsuiteisMicrochipC18Toolsuite.

Alsomakesurethatthetoolsuitecontentsandthelocationsmatch. ClickNext.

NextSelecttheProgrambuttonfromthetoolbarandclickonProjectwizard. Enterthenameofyourproject.18F1320Wizardinthiscase.

YoucanalsoselecttheprojectlocationwiththeBrowsebutton.

Thisiswhereyoucanaddyourmain.cfile.

ThisistheMain.cfilethatisusedforthisexample.

Youmustalsoaddthelinkerfiletomatchyourprocessor.

Inthiscaseitisa18F1320.Afterclickingthe18F1320_gfileclickAdd.

ClickFinish.

NextselecttheProjecttoolboxandthenselecttheSetLanguageToolLocationstool.

SelecttheMicrochipC18Toolsuitetoolbox.

Opentheexecutablesbox.

Checkthattheexecutablesarepointedtothecorrectlocationsasabove.

NextselecttheprojecttoolandthenselecttheBuildOptionsProject.

NowselecttheDirectoriestab.ThenselecttheIncludeSearchPathinthedropdownbox.Nextclick new.

ClickthisbuttontoopenuptheDirectorytoselectthefiles.

Setthesearchpathfortheincludeandthelibrarytomatchtheabove. ClickapplyandthenOK.

ClicktheBuildAllbuttonshownabove. Thiswillbuildandcompileyourproject.

ThelastlineintheoutputboxshouldreadBUILDSUCCEEDED.

SelecttheDebuggertool_SelectTool_4MPLABSIMasabove.

SelecttheViewtoolandthenselecttheWatchoption.Thiswillopenanewwindow.

Inthewatchwindowyoucanselectthesymbolsectionandselectavariabletomonitor.Xhasbeen selectedhere.AfterthevariableisselectedclicktheAddSymbolbutton.

InthewatchwindowyoucanselecttheSFRsectionandselectaSFRtomonitor.PortBhasbeen selectedhere.AftertheSFRisselectedclicktheAddSFRbutton.

Onthetopofthepagefindtherunbuttonandclickit.

Pausethesim.Youshouldbeabletoseeyourportandvariabledatainthewatchwindow.

NextselecttheDebuggertoolandclickthesettingsbutton.

ClicktheUART1IOtabandsettheboxesasshownabove.ThiswillroutetheprintfdatatotheOutput screen.

Runningyourprogramonyourtargetdevice.

SelectthedebuggertoolandclickonSelectDeviceandthen7PICkit2.

Selectthedebuggertoolagainandthenclickthesettingsbutton.

Adjustyoursettingstomatchtheabovewindow.

Yourprogramshouldberunningonyourhardwarenow.

Ifyourightclickinyourmain.cwindowyoucansetabreakpoint.

YouwillseearedcirclewithaBmarkingthebreakpoint.Theprogramwillrununtilitreachesthis pointandthenitwillstop.Tocontinueclicktherunbuttonagain.

YoucansinglestepyourprogrambypressingthestepIntobuttonhere.

Anda mungkin juga menyukai