WhyusingC? Cisahigh g levelp programming g glanguage: g g Ccodeiseasiertounderstand comparedtootherlanguages. Csupports pp lowlevelp programming: g g WecanuseCtoaccessall hardwarecomponentsofthemicrocontroller. Chasstandardlibrariesforcomplex p tasks:datatype yp conversions, , standardinput/output,longintegerarithmetic. TheAtmelAVRinstructionsetisdesigned g tosupport pp Ccompilers: p C codecanbeconvertedefficientlytoassemblycode.
C TOOLS
WeneedtwotoolsforCdevelopment:AtmelAVRStudioand WinAVR. AtmelAVRStudio AnintegrateddevelopmentenvironmentforAtmelAVR microcontroller. Itincludes i l d editor, di assembler, bl emulator, l HEXfile fil d downloader. l d Availableat:www.atmel.com/tools/studioarchive.aspx ACcompilerforAVRmicrocontrollers. Canbeusedalone,orasap plug ginforAtmelAVRStudio. Availableat:winavr.sourceforge.net
WinAVR
Installing C tools
Usethefollowingversions: *AtmelAVRStudioversion4.18build692 *WinAVRrelease2010 2010.01.10 01 10
1)DownloadsetupfilesforAtmelAVRStudioandWinAVR
Review of C programming
Step1:Createwinavrproject projectname StructureofaCprogram typesandoperators DataFlow l control lin i C Cfunctions Here,areviewofaspectsoftheCprogramminglanguage.
Structure of C program
C comments
C operators
Arithmetic Operators
Relational operators
Logical operators
Miscellaneous operators
Flow control in c
If-else statement
Switch Statement
While statement
For statement
do statement
Continue statement
C arrays
Functions in C
Guidelines on c coding