用一块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).

1 / 4
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功