您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 其它文档 > 用一块Arduino给另一块Arduino烧写bootloader
UsinganArduinoasanAVRISP(In-SystemProgrammer)ThistutorialexplainshowtouseanArduinoboardasanAVRISP(in-systemprogrammer).ThisallowsyoutousetheboardtoburnthebootloaderontoanAVR(e.g.theATmega168orATmega328usedinArduino).Thecodeinthisexampleisbasedonthemega-ispfirmwarebyRandallBohn.InstructionsTouseyourArduinoboardtoburnabootloaderontoanAVR,youneedtofollowafewsimplesteps.1.OpentheArduinoISPfirmware(inExamples)toyourArduinoboard.2.NoteforArduino1.0:youneedtomakeonesmallchangetotheArduinoISPcode.Findthelineintheheartbeat()functionthatsaysdelay(40);andchangeittodelay(20);.3.SelecttheitemsintheToolsBoardandSerialPortmenusthatcorrespondtotheboardyouareusingastheprogrammer(nottheboardbeingprogrammed).4.UploadtheArduinoISPsketch.5.WireyourArduinoboardtothetargetasshowninthediagrambelow.(NotefortheArduinoUno:you'llneedtoadda10uFcapacitorbetweenresetandground.)6.SelecttheitemintheToolsBoardmenuthatcorrespondstotheboardonwhichyouwanttoburnthebootloader(nottheboardthatyou'reusingastheprogrammer).Seetheboarddescriptionsontheenvironmentpagefordetails.7.SelecttheArduinoasISPintheToolsProgrammermenu.8.UsetheBurnBootloadercommand.NoteThisprocedureworkswiththeboardsthathavetheSPIsignalsontheindicatedpins.Forboardsforwhichthisisn'tvalid(32u4boardslikeLeonardo)theSPIsignalshavetobeconnectedtotheISPconnectorwhosepinoutisreportedbelow.Circuit(targetingArduinoUno,Duemilanove,orDiecimila)AnArduinoboardservingasanISPtoprogramtheATmegaonanotherArduinoboard.OntheArduinoUno,you'llneedtoconnecta10uFcapacitorbetweenresetandground(afteruploadingtheArduinoISPsketch).Notethatyouneedaccesstotheresetpinonthetargetboard,whichisn'tavailableonNGorolderboards.Circuit(targetingArduinoNGorolder)OnNGorolderboards,connecttheresetwiretopin1oftheAtmegachipontheboard,asshownabove.Circuit(targetinganAVRonabreadboard)SeetheArduinotoBreadboardtutorialfordetails.UsinganArduinoboardtoprogramanATmega.Becausenoexternalclocksourceisconnected,theATmegamustbeconfiguredtouseitsinternalclock.UsinganArduinoboardtoprogramanATmega,withexternalcrystalandassociatedcapacitors(18or22picofarads).
本文标题:用一块Arduino给另一块Arduino烧写bootloader
链接地址:https://www.777doc.com/doc-4742232 .html