SlideShare a Scribd company logo
Programming Atmega using BootLoader 
 

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.  The key to self‐programming is Atmega’s bootloader capability. 

Gather resources 
Ensure that you have the following resources ready: 

    1.   Atmega 324 (bootloader hex files are provided ) 
    2.   Ensure 16Mhz external crystal because bootloader is programmed for this frequency setting 
    3.   STK500 or AVR ISP MKII USB Programmer (one‐time use) 
    4.   Latest version of AVR Studio – Download from Atmel’s website 
    5.   Install MegaLoad.Net program (provided) 
    6.   Make a note of the location of bootLoader_512Byte_Atmega324_9600bps.hex file. 
    7.   Power up your PCB and connect the ISP programming cable to your PCB. 

Program the BootLoader  
    1. Open AVR Studio and choose to connect to your Atmega to program the bootloader 
       AVR Studio   Tools   Program AVR   Connect 
    2. Either choose STK500 and COM port or AVR ISP MKII USB depending on your programmer 
    3. Ensure correct chip type is selected by going to “Program” tab and selecting “Atmega324P” 




SJVE                                                                                               Page 1 of 4 
4. Go to “Board” Tab and select “125Khz” ISP Frequency and click “Write” 




                                                      
   5. Go to “Fuses” tab and choose the following configuration ‐ note the 5 check marks and uncheck 
      everything else: 




                                                                                                    
   6. Choose “Program” to program the fuse bits. 
   7. Go back to “Board” Tab and select “1Mhz” and click “Write” 




SJVE                                                                                     Page 2 of 4 
8. Go to the “Program” Tab and click on the “…” button next to “Input HEX File” under FLASH 
       section and browse to bootLoader_Atmega324_9600bps.hex  file and hit Program button: 




                                                       
    9. You have successfully loaded the bootloader software. 

                                




SJVE                                                                                      Page 3 of 4 
Program the chip using the self­programming bootloader software 
After loading the bootloader program, the actual programming hex file can be loaded easily using the 
MegaLoad.Net program. 

    1. Compile your project in CodeVision or similar compiler. 
    2. Locate your program’s HEX file in your CodeVision project directory 
    3. Connect your serial cable to microcontroller’s serial input which is PD0 and PD1.  Reference your 
       PCB manual for details on how to setup serial input and output. 
    4. Turn on your microcontroller. 
    5. Open MegaLoad.Net and click on “OPEN” for FLASH file and browse to the hex file from step 2. 
    6. Click on “Open Port” button until Port opens up. 
    7. Your Atmega should have programmed automatically after the COM PORT opened up, if not, 
       then hit the “reset” switch on the PCB. 
    8. To load new programming file, compile your project in CodeVision and hit Atmega’s reset switch 
       and MegaLoad.Net will automatically install the new file.  If you do not want to program the 
       chip, simply close MegaLoad.Net to avoid unintentional programming. 

 
Tips for advanced users 
    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, you would need to change the Xbee’s transmission rate to 38400bps as well.  You can 
       use  XCTU  to  easily  do  it.    In  theory,  wireless  transmission  errors  occur  more  at  higher  bps  so 
       consider it before you use 38400, although Xbee’s tend to be very reliable. 

References 
http://www.microsyl.com/ 
http://www.imagecraft.com/ 

 




SJVE                                                                                                     Page 4 of 4 

More Related Content

What's hot (20)

PDF
Microcontroller part 1
Keroles karam khalil
 
ODP
ClusterDesktop how-to transfer sound on your remote device
Emil Parashkevov
 
DOCX
Configuracionde router camilaloaiza
Once Redes
 
PDF
3 g modem_tutorial
aljarous
 
PDF
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup
 
PDF
Microcontroller part 9_v1
Keroles karam khalil
 
PDF
Server Room Configuration
Chandler Morgan
 
PDF
Microcontroller part 7_v1
Keroles karam khalil
 
TXT
rpi_audio configuration steps
Kenny (netman)
 
PPTX
Top 10 Microcontrollers and Development Boards for Students
Madhavi Sharma
 
PDF
Microcontroller part 2
Keroles karam khalil
 
PDF
C pci 3971-datasheet_en_1
Yasir Mehmood
 
PDF
Microcontroller part 8_v1
Keroles karam khalil
 
TXT
Readme e
anonidj
 
PDF
Instructions for Use of the Renesas C Compiler for the Robo Interface
Paulo Marcelo Pontes
 
PPTX
Installing and deploying ubuntu server box
Juan Carlos Pérez Pardo
 
PDF
Quick start vera with rfx_com
Domotica daVinci
 
PDF
Remotely Attacking System Firmware
Priyanka Aash
 
Microcontroller part 1
Keroles karam khalil
 
ClusterDesktop how-to transfer sound on your remote device
Emil Parashkevov
 
Configuracionde router camilaloaiza
Once Redes
 
3 g modem_tutorial
aljarous
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup
 
Microcontroller part 9_v1
Keroles karam khalil
 
Server Room Configuration
Chandler Morgan
 
Microcontroller part 7_v1
Keroles karam khalil
 
rpi_audio configuration steps
Kenny (netman)
 
Top 10 Microcontrollers and Development Boards for Students
Madhavi Sharma
 
Microcontroller part 2
Keroles karam khalil
 
C pci 3971-datasheet_en_1
Yasir Mehmood
 
Microcontroller part 8_v1
Keroles karam khalil
 
Readme e
anonidj
 
Instructions for Use of the Renesas C Compiler for the Robo Interface
Paulo Marcelo Pontes
 
Installing and deploying ubuntu server box
Juan Carlos Pérez Pardo
 
Quick start vera with rfx_com
Domotica daVinci
 
Remotely Attacking System Firmware
Priyanka Aash
 

Similar to Programming atmega using boot loader (20)

PDF
Creating an Embedded System Lab
Nonamepro
 
PDF
Pic programming gettingstarted
Ajit Padmarajan
 
PPT
Android Application Development Environment Setup
Ian Pinto
 
PDF
AutoDock, AutoGrid, AutoDockTools (GUI), and Open Babel Tutorial
John Cahill
 
DOCX
ABC Consolidated Financial InfoABC Companys current financial inf.docx
ransayo
 
PDF
Get Starte with MicroPython ESP32
fanghe22
 
PDF
Get Started with MicroPython ESP32
fanghe22
 
DOC
Taishaun_OwnensCNS-533_Lab
Taishaun Owens
 
PDF
2018.02.11 installation guide rhapsody in c and cpp
Frank Braun
 
DOCX
Diyobd2 solved fa qs for fgtech galletto 2 master
spobd2
 
PDF
Larson and toubro
anoopc1998
 
PDF
InstallationGuide.pdf
sahirzakaria
 
DOCX
MDT Step public
Jonathan Reckner
 
PPT
verilog basics.ppt
8885684828
 
PDF
Getting started with IBM Rational Rhapsody in Ada
Frank Braun
 
PDF
How to work with code blocks
Tech Bikram
 
PDF
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
PDF
07_04_2023_33676344534444567643345667.pdf
JaveedKhan59
 
PDF
STM -32
SeoTechnoscripts
 
PDF
learning STM -32
SeoTechnoscripts
 
Creating an Embedded System Lab
Nonamepro
 
Pic programming gettingstarted
Ajit Padmarajan
 
Android Application Development Environment Setup
Ian Pinto
 
AutoDock, AutoGrid, AutoDockTools (GUI), and Open Babel Tutorial
John Cahill
 
ABC Consolidated Financial InfoABC Companys current financial inf.docx
ransayo
 
Get Starte with MicroPython ESP32
fanghe22
 
Get Started with MicroPython ESP32
fanghe22
 
Taishaun_OwnensCNS-533_Lab
Taishaun Owens
 
2018.02.11 installation guide rhapsody in c and cpp
Frank Braun
 
Diyobd2 solved fa qs for fgtech galletto 2 master
spobd2
 
Larson and toubro
anoopc1998
 
InstallationGuide.pdf
sahirzakaria
 
MDT Step public
Jonathan Reckner
 
verilog basics.ppt
8885684828
 
Getting started with IBM Rational Rhapsody in Ada
Frank Braun
 
How to work with code blocks
Tech Bikram
 
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
07_04_2023_33676344534444567643345667.pdf
JaveedKhan59
 
learning STM -32
SeoTechnoscripts
 
Ad

Programming atmega using boot loader

  • 1. Programming Atmega using BootLoader    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.  The key to self‐programming is Atmega’s bootloader capability.  Gather resources  Ensure that you have the following resources ready:  1. Atmega 324 (bootloader hex files are provided )  2. Ensure 16Mhz external crystal because bootloader is programmed for this frequency setting  3. STK500 or AVR ISP MKII USB Programmer (one‐time use)  4. Latest version of AVR Studio – Download from Atmel’s website  5. Install MegaLoad.Net program (provided)  6. Make a note of the location of bootLoader_512Byte_Atmega324_9600bps.hex file.  7. Power up your PCB and connect the ISP programming cable to your PCB.  Program the BootLoader   1. Open AVR Studio and choose to connect to your Atmega to program the bootloader  AVR Studio   Tools   Program AVR   Connect  2. Either choose STK500 and COM port or AVR ISP MKII USB depending on your programmer  3. Ensure correct chip type is selected by going to “Program” tab and selecting “Atmega324P”  SJVE    Page 1 of 4 
  • 2. 4. Go to “Board” Tab and select “125Khz” ISP Frequency and click “Write”    5. Go to “Fuses” tab and choose the following configuration ‐ note the 5 check marks and uncheck  everything else:    6. Choose “Program” to program the fuse bits.  7. Go back to “Board” Tab and select “1Mhz” and click “Write”  SJVE    Page 2 of 4 
  • 3. 8. Go to the “Program” Tab and click on the “…” button next to “Input HEX File” under FLASH  section and browse to bootLoader_Atmega324_9600bps.hex  file and hit Program button:    9. You have successfully loaded the bootloader software.      SJVE    Page 3 of 4 
  • 4. Program the chip using the self­programming bootloader software  After loading the bootloader program, the actual programming hex file can be loaded easily using the  MegaLoad.Net program.  1. Compile your project in CodeVision or similar compiler.  2. Locate your program’s HEX file in your CodeVision project directory  3. Connect your serial cable to microcontroller’s serial input which is PD0 and PD1.  Reference your  PCB manual for details on how to setup serial input and output.  4. Turn on your microcontroller.  5. Open MegaLoad.Net and click on “OPEN” for FLASH file and browse to the hex file from step 2.  6. Click on “Open Port” button until Port opens up.  7. Your Atmega should have programmed automatically after the COM PORT opened up, if not,  then hit the “reset” switch on the PCB.  8. To load new programming file, compile your project in CodeVision and hit Atmega’s reset switch  and MegaLoad.Net will automatically install the new file.  If you do not want to program the  chip, simply close MegaLoad.Net to avoid unintentional programming.    Tips for advanced users  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, you would need to change the Xbee’s transmission rate to 38400bps as well.  You can  use  XCTU  to  easily  do  it.    In  theory,  wireless  transmission  errors  occur  more  at  higher  bps  so  consider it before you use 38400, although Xbee’s tend to be very reliable.  References  http://www.microsyl.com/  http://www.imagecraft.com/    SJVE    Page 4 of 4