~ ~ & \ i \) I\ l;-\ '\ ·1 :\ Y I' l H) I I'll I\ I I\ II I I\\ Introduction to Embedded Systems Using ANSI C and the Arduino Development Environment David Russell Introduction to Embedded Systems Using ANSI C and the Arduino Development Environment Copyright© 2010byMorgan&Claypool Allrightsreserved.Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedin anyformorbyanymeans—electronic,mechanical,photocopy,recording,oranyotherexceptforbriefquotationsin printedreviews,withoutthepriorpermissionofthepublisher. IntroductiontoEmbeddedSystems:UsingANSICandtheArduinoDevelopmentEnvironment DavidJ.Russell www.morganclaypool.com ISBN:9781608454983 paperback ISBN:9781608454990 ebook DOI10.2200/S00291ED1V01Y201007DCS030 APublicationintheMorgan&ClaypoolPublishersseries SYNTHESISLECTURESONDIGITALCIRCUITSANDSYSTEMS Lecture#30 SeriesEditor:MitchellA.Thornton,SouthernMethodistUniversity SeriesISSN SynthesisLecturesonDigitalCircuitsandSystems Print1932-3166 Electronic1932-3174 Synthesis Lectures on Digital Circuits and Systems Editor MitchellA.Thornton,SouthernMethodistUniversity TheSynthesisLecturesonDigitalCircuitsandSystemsseriesiscomprisedof50-to100-pagebooks targetedforaudiencememberswithawide-rangingbackground.TheLecturesincludetopicsthatare ofinteresttostudents,professionals,andresearchersintheareaofdesignandanalysisofdigitalcircuits andsystems.EachLectureisself-containedandfocusesonthebackgroundinformationrequiredto understandthesubjectmatterandpracticalcasestudiesthatillustrateapplications.Theformatofa Lectureisstructuredsuchthateachwillbedevotedtoaspecifictopicindigitalcircuitsandsystems ratherthanalargeroverviewofseveraltopicssuchasthatfoundinacomprehensivehandbook.The Lecturescoverbothwell-establishedareasaswellasnewlydevelopedoremergingmaterialindigital circuitsandsystemsdesignandanalysis. IntroductiontoEmbeddedSystems:UsingANSICandtheArduinoDevelopment Environment DavidJ.Russell 2010 ArduinoMicrocontroller:ProcessingforEveryone!PartII StevenF.Barrett 2010 ArduinoMicrocontrollerProcessingforEveryone!PartI StevenF.Barrett 2010 DigitalSystemVerification:ACombinedFormalMethodsandSimulationFramework LunLiandMitchellA.Thornton 2010 ProgressinApplicationsofBooleanFunctions TsutomuSasaoandJonT.Butler 2009 EmbeddedSystemsDesignwiththeAtmelAVRMicrocontroller:PartII StevenF.Barrett 2009 iv EmbeddedSystemsDesignwiththeAtmelAVRMicrocontroller:PartI StevenF.Barrett 2009 EmbeddedSystemsInterfacingforEngineersusingtheFreescaleHCS08MicrocontrollerII: DigitalandAnalogHardwareInterfacing DouglasH.Summerville 2009 DesigningAsynchronousCircuitsusingNULLConventionLogic(NCL) ScottC.SmithandJiaDi 2009 EmbeddedSystemsInterfacingforEngineersusingtheFreescaleHCS08MicrocontrollerI: AssemblyLanguageProgramming DouglasH.Summerville 2009 DevelopingEmbeddedSoftwareusingDaVinci&OMAPTechnology B.I.(Raj)Pawate 2009 MismatchandNoiseinModernICProcesses AndrewMarshall 2009 AsynchronousSequentialMachineDesignandAnalysis:AComprehensiveDevelopmentof theDesignandAnalysisofClock-IndependentStateMachinesandSystems RichardF.Tinder 2009 AnIntroductiontoLogicCircuitTesting ParagK.Lala 2008 PragmaticPower WilliamJ.Eccles 2008 MultipleValuedLogic:ConceptsandRepresentations D.MichaelMillerandMitchellA.Thornton 2007 FiniteStateMachineDatapathDesign,Optimization,andImplementation JustinDavisandRobertReese 2007 v AtmelAVRMicrocontrollerPrimer:ProgrammingandInterfacing StevenF.BarrettandDanielJ.Pack 2007 PragmaticLogic WilliamJ.Eccles 2007 PSpiceforFiltersandTransmissionLines PaulTobin 2007 PSpiceforDigitalSignalProcessing PaulTobin 2007 PSpiceforAnalogCommunicationsEngineering PaulTobin 2007 PSpiceforDigitalCommunicationsEngineering PaulTobin 2007 PSpiceforCircuitTheoryandElectronicDevices PaulTobin 2007 PragmaticCircuits:DCandTimeDomain WilliamJ.Eccles 2006 PragmaticCircuits:FrequencyDomain WilliamJ.Eccles 2006 PragmaticCircuits:SignalsandFilters WilliamJ.Eccles 2006 High-SpeedDigitalSystemDesign JustinDavis 2006 vi IntroductiontoLogicSynthesisusingVerilogHDL RobertB.ReeseandMitchellA.Thornton 2006 MicrocontrollersFundamentalsforEngineersandScientists StevenF.BarrettandDanielJ.Pack 2006 Introduction to Embedded Systems Using ANSI C and the Arduino Development Environment David J.Russell UniversityofNebraska-Lincoln SYNTHESISLECTURESONDIGITALCIRCUITSANDSYSTEMS#30 M &C Morgan &cLaypool publishers ABSTRACT Manyelectricalandcomputerengineeringprojectsinvolvesomekindofembeddedsysteminwhich amicrocontrollersitsatthecenterastheprimarysourceofcontrol.Therecently-developedArduino development platform includes an inexpensive hardware development board hosting an eight-bit ATMEL ATmega-family processor and a Java-based software-development environment.These featuresallowanembeddedsystemsbeginnertheabilitytofocustheirattentiononlearninghowto writeembeddedsoftwareinsteadofwastingtimeovercomingtheengineeringCADtoolslearning curve. Thegoalofthistextistointroducefundamentalmethodsforcreatingembeddedsoftwarein general,with a focus on ANSI C.The Arduino development platform provides a great means for accomplishingthistask.Assuch,thisworkpresentsembeddedsoftwaredevelopmentusing100% ANSI C for the Arduino’s ATmega328P processor. We deviate from using the Arduino-specific Wiringlibrariesinanattempttoprovidethemostgeneralembeddedmethods.Inthisway,thereader will acquire essential knowledge necessary for work on future projects involving other processors. ParticularattentionispaidtothenotoriousissueofusingCpointersinordertogaindirectaccess tomicroprocessorregisters,whichultimatelyallowcontroloverallperipheralinterfacing. KEYWORDS embeddedsystems,embeddedsoftware,embeddeddevelopment,microcontroller,mi- croprocessor,ANSIC,Arduino,ATmega328P To my best friend Jamie and our three wonderful kids: Gates, Gracen, and Gavin
Description: