You are on page 1of 2

3/19/2017 MicrcontrollerProgrammingUsingCWithKeilIDE|

MicrcontrollerProgrammingUsingC March25,2011
WithKeilIDE

KEILuVisionisthenameofasoftwarededicatedtothedevelopmentandtestingofa
familyofmicrocontrollersbasedon8051technology,whichwearegoingtousealongthis
tutorial.YoucancandownloadanevaluationversionofKEILattheir
website:http://www.keil.com/c51/.Mostversionssharemerelythesameinterface,this
tutorialusesKEILC51uVision4withtheC51compiler.

Tocreateproject,writeandtestthesourcecodeandalsocreatehexfile,followthe
followingsteps:

OpenKeilandStartanewproject:

Youwillpromptedtochoseanameforyournewproject,choseanameand
clicksave.Thefollowingwindowwillappear,whereyouwillbeaskedtoselectadevicefor
TargetTarget1:

Fromthelist,selectATMELandchoseyourmicrocntroller.TheAT89s52willbecalled
yourTargetdevice,whichisthefinaldestinationofyoursourcecode.Youwillbeasked

https://vshamu.wordpress.com/2011/03/25/micrcontrollerprogrammingusingcwithkeilide/ 1/2
3/19/2017 MicrcontrollerProgrammingUsingCWithKeilIDE|

whethertocopystandard8051startupcodeclickNo.

ClickFile,Newandsimilartothefollowingwindowshouldappear.Theblankspacewhere
yourcodeshouldbewritten.

Now,YouhavetoclickFile,Saveasandchoseafilenameforcodeendingwiththe
extension.candclicksave.Thenyouhavetoaddthisfiletoyourprojectworkspaceas
showninthefollowingscreen:

Afterrightclickingonsourcegroup1,clickonAddfilestogroup,thenyouwillbe
promptedtobrowsethefiletoaddtosourcegroup1,chosethefilethatyoujustsaved
andaddittothesourcegroup.Youwillnoticethatthefileisaddedtotheprojecttreeat
theleft.

InsomeversionsofthissoftwareyouhavetoturnONmanuallytheoptiontogenerate
HEXfiles.makesureitisturnedON,byrightclickingontarget1,Optionsfortarget
target1,thenundertheoutputtab,bycheckingtheboxgenerateHEXfile.Thisstep
isveryimportantastheHEXfileisthecompiledoutputofyourprojectthatisgoingtobe
transferredtothemicrocontroller.

Youcanthenstarttowritethesourcecodeinthewindowthenbeforetestingyoursource
code,youhavetocompileyoursourcecode,andcorrecteventualsyntaxerrors.InKEIL
IDE,thisstepiscalledrebuildalltargets.

https://vshamu.wordpress.com/2011/03/25/micrcontrollerprogrammingusingcwithkeilide/ 2/2

You might also like