—_—_—_——__————— 45 projects for PIC, AVR and ARM Bert van Dam e lektor Microcontroller Systems Engineering Ths bock about asate of the art tool, Fowcade. edhow you cen une Pomc develop micocatraler applemons The ‘eersiralywtha stcral projet and steaby stn instructions As you go along te pres creat ind new concepts ae aplained. Each projec has a oftware nit pictures anc dagrams hic" expla ne jst now ting or cone bi eo yl sources remeber Since Fiowcode i high level lnguege the iticaces of microcontroller progriming ane Ihesen from vc or thet ease docans rake much ierenc: whether the prota Ror ARM mirocontrlle. O73 hig eel te programs fr these stuctur ate cena. or tat reason ths book on mcrScantrlle sal ction desian in areal not ait or one type Ct microzensale: you dons ct the meracontole descr sed ina project you cat lusaly convert te anethermirocorto lr qute etl blocks wil be used as hardvare forthe projects nts book This way te hadare cane pat sogethe vicky ane ish Fully teste writs simaly connect together wing beginners and exoers such 2= parstence of vision ound aesianes swt call prone rorete contol Canes youth éeerent Iossnes webse-ver Cs rach sndemach more pie wecth macuatec motar contol You an elt ata projets boos and buld Me proses for your cum we. OF you can se + 25st gude to lear woe soautietoconcalle sytem engineer and he PC, AYR and ARY merocenealer. Microcontroller Systems Engineering 46 projets for PIC, AVR sd ARM Bert van Dam Elektor Intemational Media BV Postous 11 6114 ZG Susteron ‘The Netherlands All nuhis reserved, Nepal of this haole may he tepmdhiced im any material Zon, Jnclus ng. hemnennng, on storing in acy medium by electronic zene aad wither ft tanniccly av incidentally ts wont otter se ef eis publication, witfagt 2he sre Peonissioe of tee copyright Folcer except in aeeontance wich the smvviscons uf Uae Coperigh Resigne and Patents Act TAR uc ane: the tera of 4 genes sued hy the Copyrigh: Liconsing Agency Lid. 90 Tousabem Coutr Res, L.seon, Eng nd WP SOME. Applications (or the wopyuight holders writon parmissis to reproduce any par. of ‘i publican should be adenessed to the publishers “The poblishers hace uae shoe et efforts in ensuring the correctoess ul ke nctneton sontained in this book, They do not soma. and hoch seam, aby hasty eo any puly To any Bose or slmage emser hy ers or omissans in thin book whether such {EFS OF ign rol ro negligence aides wean other ease Uris Lsrany Catsluyuing * Publietion Pata Asatsiogu teen tr dhs hone is available fre he Bris Libeay ISBN 978-0-906706-75.0 evs putt: Ate, lation First published inthe [ard Kangen 068 Print the Netherlands by Wile. Amersroore 1. Hektor lremasianal Media RY 2008, Content Peologse ‘Wat yoa wl neo 21 23 Suftwaw 2s Sivalaian 25 Downlecding 26 Opecuival Basis LCD spay ua’ ight Senet corel Seria: comune: ner ust. Aran ta Digits (om Dav accivtod itch ‘vomit deteert Sud astvared sweet ‘Nii ti Digitel check ecu Sumulalive Susi poanocton Boat str Advanced Veet occ shox! sound Ciel High ouliy version Low eva version Custoxa Character: Aimaion 360 Render 124 47 Aton PWM ie AX Porsienes of vision is 49 Flush emery ie 2.41 LUSART eennection er Si GPS maecing we 2112 The PPP lo soress EEPROM Iss 13 Pocuyivax 16 434 Vorecommand Wi 5. Infeved abjset deestine igo 52° Phulomster is 53 Uesouis ace tader 78 $4 Digi esmomstor et 33 Dau sucaping be fridge be 54 Hr Ingein a residential bang 18 $0) Capnure sound feeueney 202 ES Tweaway atic 22 © Call phone Ga Nand tent message 62 Recelvea rear message 63 Rerane conc CAN be a 1 Romine LENS a 72 virion aa rect aay Pag are you “Ror? 24s Webserver 2 Serva alarm ais 285 EDP rears conte! 26 9 Design your uw T-blls 2a 84 Analog tes signal ae. 92 Micropire prowrsplier 2 10 Btigeatio: between PIC, AVE une ARM 2 11 Safire og 10.2 Uantivare 2 103 Eseagie 23 Going ims proton ‘Youth deterrent (outin@) Appendix ASCT ble ‘Vieaal Rais comenunisaions ips and ticks Mivcecoatioler Mulbesalies Fehlock sormetions Ides Prologue Prologue oo have teow others eur Tacha what others don't lmonmons \Waen Tvs young my Gal favght me how In prograca a kstge taifiunss comyruer. Fist ‘yu need i Uh hugh what you sane Tbe prograra to du. Then drse: a flowcat, Tid is geephicalropreseanaion athe program Mle, Tr eansits oP smbols wort by lines ils ess, The program will owe Fram sycahol wo syaabol tallnw-ag the stows Lal smo ofthe Novica bes specific meaning. The nscangle cor example Sau apontion the dsrcous isa seein the ence a conascioe twa Uifeenr par of the pear. Figure 1, Flowchart template low chovting isan deel seay fa avelep ns prograrn, because rt alles aryoue, uot fast proprcamers, fo uudorstand what ihe propia will da, Onee evazyans invelvod i isGed hat shit ne the proyrian (hoy an, the Nuwar. mus Be interne in Thies of code. Then each line is copied cy a eacdboard care ih hind of typewricer that pancses “lee in the card, Uhy slack of cards fed into « punceardroadr becouse tun sate oniy ray te pet Ess prngian into the eae. The exrmputer ise ws in tdifssee roi ati fistan enn oon cal eotralle hy people in wie ab ets Noone was allowed to ge near it, les une vough it The ests of the program woul! be Fated large shests of raciarfed paper. And ofley there would omly be une shect ith fone Hine, such a: Bor iaTine 2916, executive donee ‘have comes arrg wey. Seve of the ar oa allow you wo dravea lowchatéoetly om ‘our computer sven, sa erter in each synbe) dots of ym yom wont the peugraun 39 ‘hat ha ovation, With w peess na funn she prougcun“¢sivnlted allowing to easy dehupang, Aad 7h sheskerhatton the eile prngrars fs compiled ard dwnlowded ina u mivavoonnler, «cooler (ne sige oa rngerasl. You vat gor a igre. up atl fui 9 acer oF sinus Prologue Figure 2. Flowcode stoe ofthe ort sofware design. ‘This book is about such state ofthe ut to, Flows”, and how you can use Floscode tw develup microcuntaller applications, The book slans very simply with a torial Droject and step-by-step instructions. As you go along the prejgcts increase in diiculty and only the new concepts are explainel. Lach project has a clear description of Both Irrdware and software with piewres and diagrams, which expla not just how fhings are done but also wiiy. AIL soulces aze available for toe download, incling the support sollovae! blocks” willbe used as hardware for the projots inthis book, This way’ hardware ean be put toner quickly and roiaby. Fully tested units simply coanest together using camectors oF short Nat sitbun cables t9 form completed prvjels. No soldering is required. Since Flowcode isa high level language the intacasies ef microcontroller prgramming fare hidden fiom view: For that reason it doesn't make mush difference whelher the program is meant fora PIC, AVR or ARM micraconicller. Cn high level te programs for chese microcontcellers, elthough vastly different in inceensl seustut, are identi. For that reason this book is on aaierucantoller systems engineering in general, ot just for ‘one type of microcontroller. If you don't own the micricontaller described in # pret yout ean usually conver! it fo unohermierocorralier quite easily a explained in chapter 10. lowende isnot acta and rs be purchased sparta 10 Prologue This hone covers stig ut se ag and fn reyets such as seer nore a youth tetemec, GPS uehing, ll phone rere coilaL sunistencs oF isin and an Iiemet tretvervst Yon enn asian amore buck, and build és proices for your ewn use. Or yon san wee it a6 sady guide to Ioan bite afoul Foxscue systems gineering al Ue DIC. AYR ARM elororontollen, | inl ike to anh Bi Reveana, Sean King, Sie nety and sugpust while Ww” eng thie bok, and Alex Dobson for hie help wl the 7 cling “Tandy aaé Jun Dobson fr beic a eat an Phe onsen. 2008