You are on page 1of 4

ProgrammingAtmegausingBootLoader

Many expensive programmers exist for the Atmega, but after many hours of research, we have put
together this guide to explain how to program the Atmega without the use of a programmer. The
programmer like AVR ISP MKII USB or STK500 is required only once before the Atmega can program
itself.ThekeytoselfprogrammingisAtmegasbootloadercapability.
Gatherresources
Ensurethatyouhavethefollowingresourcesready:
1. Atmega324(bootloaderhexfilesareprovided)
2. Ensure16Mhzexternalcrystalbecausebootloaderisprogrammedforthisfrequencysetting
3. STK500orAVRISPMKIIUSBProgrammer(onetimeuse)
4. LatestversionofAVRStudioDownloadfromAtmelswebsite
5. InstallMegaLoad.Netprogram(provided)
6. MakeanoteofthelocationofbootLoader_512Byte_Atmega324_9600bps.hexfile.
7. PowerupyourPCBandconnecttheISPprogrammingcabletoyourPCB.
ProgramtheBootLoader
1. OpenAVRStudioandchoosetoconnecttoyourAtmegatoprogramthebootloader
AVRStudioToolsProgramAVRConnect
2. EitherchooseSTK500andCOMportorAVRISPMKIIUSBdependingonyourprogrammer
3. EnsurecorrectchiptypeisselectedbygoingtoProgramtabandselectingAtmega324P
SJVE Page1of4
4. GotoBoardTabandselect125KhzISPFrequencyandclickWrite

5. GotoFusestabandchoosethefollowingconfigurationnotethe5checkmarksanduncheck
everythingelse:

6. ChooseProgramtoprogramthefusebits.
7. GobacktoBoardTabandselect1MhzandclickWrite
SJVE Page2of4
8. GototheProgramTabandclickonthebuttonnexttoInputHEXFileunderFLASH
sectionandbrowsetobootLoader_Atmega324_9600bps.hexfileandhitProgrambutton:

9. Youhavesuccessfullyloadedthebootloadersoftware.

SJVE Page3of4
SJVE Page4of4
Programthechipusingtheselfprogrammingbootloadersoftware
Afterloadingthebootloaderprogram,theactualprogramminghexfilecanbeloadedeasilyusingthe
MegaLoad.Netprogram.
1. CompileyourprojectinCodeVisionorsimilarcompiler.
2. LocateyourprogramsHEXfileinyourCodeVisionprojectdirectory
3. ConnectyourserialcabletomicrocontrollersserialinputwhichisPD0andPD1.Referenceyour
PCBmanualfordetailsonhowtosetupserialinputandoutput.
4. Turnonyourmicrocontroller.
5. OpenMegaLoad.NetandclickonOPENforFLASHfileandbrowsetothehexfilefromstep2.
6. ClickonOpenPortbuttonuntilPortopensup.
7. YourAtmegashouldhaveprogrammedautomaticallyaftertheCOMPORTopenedup,ifnot,
thenhittheresetswitchonthePCB.
8. Toloadnewprogrammingfile,compileyourprojectinCodeVisionandhitAtmegasresetswitch
andMegaLoad.Netwillautomaticallyinstallthenewfile.Ifyoudonotwanttoprogramthe
chip,simplycloseMegaLoad.Nettoavoidunintentionalprogramming.

Tipsforadvancedusers
1. You could use bootLoader_Atmega324_38400bps.hex file when you programmed the boot
loader. This way, MegaLoad.net would program 4 times faster when you open the COM PORT
at 38400bps. The only slight problem is that if you are using Xbee wireless transceivers to
program,youwouldneedtochangetheXbeestransmissionrateto38400bpsaswell.Youcan
use XCTU to easily do it. In theory, wireless transmission errors occur more at higher bps so
consideritbeforeyouuse38400,althoughXbeestendtobeveryreliable.
References
http://www.microsyl.com/
http://www.imagecraft.com/

You might also like