Beruflich Dokumente
Kultur Dokumente
DennisDeyen,CTOCEENBoTInc.
Sept.30,2011
Purpose:TodescribethestepsnecessarytocreateanewdesignprojectwithAVRStudio4enablingprintf(),mathematic
andfloatingpointfirmwaresupport.
Assumptions:AVRStudio4andWinAVRarecurrentlyinstalledonthetargetmachine.SeeappendixforsourcesofAVR
Studio4andWinAVR.
Step1:LaunchAVRStudio4andcreateanewproject.SelectProject>NewProject.
Doc:AN022.PDFRevisionAPage1of8
Step2:Definetheprojecttype.ForthisexerciseselecttheAVRGCCprojecttype.
TheProjectnameandInitialfilepromptswillthenallowuserentryintothosefields.Seebelow.
Doc:AN022.PDFRevisionAPage2of8
EnteraProjectnameandInitialfilenameandselectNext>>.TheProjectnameandInitialfilenamedonothavetobethe
same.
Step3:IfusingtheAVRISPmkIItoprogramthetargetmicrocontroller,selectthisUSBdebuggerandthetarget
microcontroller.ThenselectFinish.
Doc:AN022.PDFRevisionAPage3of8
Step4:Thelibraryoptionsneedtobeconfiguredtoenableprintf(),mathematicandfloatingpointsupport.Select
Project>ConfigurationOptions.
ThefollowingwindowwillshowGeneralsettings.TheGeneralsettingswillremainthesame.
Doc:AN022.PDFRevisionAPage4of8
SelectLibraries.Themathematicandprintf()librarieswillbeaddedaslinkoptionshere.Selectlibm.aand
libprintf_flt.aandaddthemtothe"LinkwithTheseObjects:"columnusingtheAddLibrary>button.
NextselectCustomOptions.ThistabisbelowtheLibrariestabintheleftcolumnofthewindow.
Doc:AN022.PDFRevisionAPage5of8
Select[LinkerOptions]undertheCustomCompilationOptionscolumn.EnterWl,u,vfprintfinthefieldtotheleftof
theAddbuttonandselectAdd.TheWl,option,option,...parameterpassestheoptionstothelinker.Therecanbeone
ormoreoptions.Weareusingtwooptions,uandvprintf.
AfterselectingAddthelinkeroptionswillbeaddedtotheoptionlist.SelectOKtoexittheoptionswindow.
Doc:AN022.PDFRevisionAPage6of8
Thelibraryandlinkeroptionswillnotbesavedunlesstheprojectissaved.Fromthemainwindow,selectFile>Save
All.
Insummarythepreviousstepsaccomplished:
a.CreatedanewAVRStudio4project.
b.CreatedanewCfile.
c.Specifiedlibrariestobeincludedduringlinking.Thissupportsprintf(),mathematicalandfloatingpointoperations.
d.Definedlinkeroptionstoprovidesupportforprintf().
Doc:AN022.PDFRevisionAPage7of8
Appendix
Thefollowingsoftwarepackagesmaybedownloadedfromthefollowingsites.DownloadingAVRStudio4requires
registrationonAtmel'ssite.
ThelatestversionofAVRStudio4isV4.19build730.ThelatestreleaseofWinAVRisversion20100110.
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725&category_id=163&family_id=607&subfamily_id=760
http://sourceforge.net/projects/winavr/files/
Doc:AN022.PDFRevisionAPage8of8