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)

Microcontroller part 1
Microcontroller part 1Microcontroller part 1
Microcontroller part 1
Keroles karam khalil
 
ClusterDesktop how-to transfer sound on your remote device
ClusterDesktop how-to transfer sound on your remote deviceClusterDesktop how-to transfer sound on your remote device
ClusterDesktop how-to transfer sound on your remote device
Emil Parashkevov
 
Configuracionde router camilaloaiza
Configuracionde router camilaloaizaConfiguracionde router camilaloaiza
Configuracionde router camilaloaiza
Once Redes
 
Read me
Read meRead me
Read me
Carlos A de Oliveira
 
3 g modem_tutorial
3 g modem_tutorial3 g modem_tutorial
3 g modem_tutorial
aljarous
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup
 
Microcontroller part 9_v1
Microcontroller part 9_v1Microcontroller part 9_v1
Microcontroller part 9_v1
Keroles karam khalil
 
Server Room Configuration
Server Room ConfigurationServer Room Configuration
Server Room Configuration
Chandler Morgan
 
Microcontroller part 7_v1
Microcontroller part 7_v1Microcontroller part 7_v1
Microcontroller part 7_v1
Keroles karam khalil
 
rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration steps
Kenny (netman)
 
Top 10 Microcontrollers and Development Boards for Students
Top 10 Microcontrollers and Development Boards for StudentsTop 10 Microcontrollers and Development Boards for Students
Top 10 Microcontrollers and Development Boards for Students
Madhavi Sharma
 
Microcontroller part 2
Microcontroller part 2Microcontroller part 2
Microcontroller part 2
Keroles karam khalil
 
C pci 3971-datasheet_en_1
C pci 3971-datasheet_en_1C pci 3971-datasheet_en_1
C pci 3971-datasheet_en_1
Yasir Mehmood
 
Microcontroller part 8_v1
Microcontroller part 8_v1Microcontroller part 8_v1
Microcontroller part 8_v1
Keroles karam khalil
 
Readme e
Readme eReadme e
Readme e
anonidj
 
Instructions for Use of the Renesas C Compiler for the Robo Interface
Instructions for Use of the Renesas C Compiler for the Robo InterfaceInstructions for Use of the Renesas C Compiler for the Robo Interface
Instructions for Use of the Renesas C Compiler for the Robo Interface
Paulo Marcelo Pontes
 
Installing and deploying ubuntu server box
Installing and deploying ubuntu server boxInstalling and deploying ubuntu server box
Installing and deploying ubuntu server box
Juan Carlos Pérez Pardo
 
Quick start vera with rfx_com
Quick start vera with rfx_comQuick start vera with rfx_com
Quick start vera with rfx_com
Domotica daVinci
 
Azbox me
Azbox meAzbox me
Azbox me
TELE-audiovision eng
 
Remotely Attacking System Firmware
Remotely Attacking System FirmwareRemotely Attacking System Firmware
Remotely Attacking System Firmware
Priyanka Aash
 
ClusterDesktop how-to transfer sound on your remote device
ClusterDesktop how-to transfer sound on your remote deviceClusterDesktop how-to transfer sound on your remote device
ClusterDesktop how-to transfer sound on your remote device
Emil Parashkevov
 
Configuracionde router camilaloaiza
Configuracionde router camilaloaizaConfiguracionde router camilaloaiza
Configuracionde router camilaloaiza
Once Redes
 
3 g modem_tutorial
3 g modem_tutorial3 g modem_tutorial
3 g modem_tutorial
aljarous
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup
 
Server Room Configuration
Server Room ConfigurationServer Room Configuration
Server Room Configuration
Chandler Morgan
 
rpi_audio configuration steps
rpi_audio configuration stepsrpi_audio configuration steps
rpi_audio configuration steps
Kenny (netman)
 
Top 10 Microcontrollers and Development Boards for Students
Top 10 Microcontrollers and Development Boards for StudentsTop 10 Microcontrollers and Development Boards for Students
Top 10 Microcontrollers and Development Boards for Students
Madhavi Sharma
 
C pci 3971-datasheet_en_1
C pci 3971-datasheet_en_1C pci 3971-datasheet_en_1
C pci 3971-datasheet_en_1
Yasir Mehmood
 
Readme e
Readme eReadme e
Readme e
anonidj
 
Instructions for Use of the Renesas C Compiler for the Robo Interface
Instructions for Use of the Renesas C Compiler for the Robo InterfaceInstructions for Use of the Renesas C Compiler for the Robo Interface
Instructions for Use of the Renesas C Compiler for the Robo Interface
Paulo Marcelo Pontes
 
Installing and deploying ubuntu server box
Installing and deploying ubuntu server boxInstalling and deploying ubuntu server box
Installing and deploying ubuntu server box
Juan Carlos Pérez Pardo
 
Quick start vera with rfx_com
Quick start vera with rfx_comQuick start vera with rfx_com
Quick start vera with rfx_com
Domotica daVinci
 
Remotely Attacking System Firmware
Remotely Attacking System FirmwareRemotely Attacking System Firmware
Remotely Attacking System Firmware
Priyanka Aash
 

Similar to Programming atmega using boot loader (20)

Atmeag328 bootloading
Atmeag328 bootloadingAtmeag328 bootloading
Atmeag328 bootloading
Rakesh Sawan
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
Dhruwank Vankawala
 
Microcontroladores: Uso de placas Arduino en Atmel Studio
Microcontroladores: Uso de placas Arduino en Atmel StudioMicrocontroladores: Uso de placas Arduino en Atmel Studio
Microcontroladores: Uso de placas Arduino en Atmel Studio
SANTIAGO PABLO ALBERTO
 
Atmega tutorial
Atmega tutorialAtmega tutorial
Atmega tutorial
Rajan Gautam
 
Presentation fpgakit
Presentation fpgakitPresentation fpgakit
Presentation fpgakit
aroosa khan
 
Start with arduino
Start with arduinoStart with arduino
Start with arduino
Open.Embedded
 
Building a robot with the .Net Micro Framework
Building a robot with the .Net Micro FrameworkBuilding a robot with the .Net Micro Framework
Building a robot with the .Net Micro Framework
Ducas Francis
 
Microcontroladores: programación de microcontroladores PIC de 8 bits en C
Microcontroladores: programación de microcontroladores PIC de 8 bits en CMicrocontroladores: programación de microcontroladores PIC de 8 bits en C
Microcontroladores: programación de microcontroladores PIC de 8 bits en C
SANTIAGO PABLO ALBERTO
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)
Mashood
 
Avr trainer kit manual
Avr trainer kit manualAvr trainer kit manual
Avr trainer kit manual
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
Dinesh Damodar
 
I pod new
I pod newI pod new
I pod new
Abhijit Ghosh
 
Atmega Mini project Board
Atmega Mini project BoardAtmega Mini project Board
Atmega Mini project Board
Raghav Shetty
 
Touch Switch (Smart Switches) by arduino Project report file
Touch Switch (Smart Switches) by arduino  Project  report fileTouch Switch (Smart Switches) by arduino  Project  report file
Touch Switch (Smart Switches) by arduino Project report file
imkanhaiyalal
 
embedded system and AVR
embedded system and AVRembedded system and AVR
embedded system and AVR
Urvashi Khandelwal
 
Project eprom progr
Project eprom progrProject eprom progr
Project eprom progr
Anurag Farkya
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
Arduino: Open Source Hardware Hacking from the Software Nerd Perspective
Arduino: Open Source Hardware Hacking from the Software Nerd PerspectiveArduino: Open Source Hardware Hacking from the Software Nerd Perspective
Arduino: Open Source Hardware Hacking from the Software Nerd Perspective
Howard Lewis Ship
 
3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesis3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesis
Thanh Nguyen
 
Atmeag328 bootloading
Atmeag328 bootloadingAtmeag328 bootloading
Atmeag328 bootloading
Rakesh Sawan
 
Microcontroladores: Uso de placas Arduino en Atmel Studio
Microcontroladores: Uso de placas Arduino en Atmel StudioMicrocontroladores: Uso de placas Arduino en Atmel Studio
Microcontroladores: Uso de placas Arduino en Atmel Studio
SANTIAGO PABLO ALBERTO
 
Presentation fpgakit
Presentation fpgakitPresentation fpgakit
Presentation fpgakit
aroosa khan
 
Building a robot with the .Net Micro Framework
Building a robot with the .Net Micro FrameworkBuilding a robot with the .Net Micro Framework
Building a robot with the .Net Micro Framework
Ducas Francis
 
Microcontroladores: programación de microcontroladores PIC de 8 bits en C
Microcontroladores: programación de microcontroladores PIC de 8 bits en CMicrocontroladores: programación de microcontroladores PIC de 8 bits en C
Microcontroladores: programación de microcontroladores PIC de 8 bits en C
SANTIAGO PABLO ALBERTO
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)
Mashood
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Atmega Mini project Board
Atmega Mini project BoardAtmega Mini project Board
Atmega Mini project Board
Raghav Shetty
 
Touch Switch (Smart Switches) by arduino Project report file
Touch Switch (Smart Switches) by arduino  Project  report fileTouch Switch (Smart Switches) by arduino  Project  report file
Touch Switch (Smart Switches) by arduino Project report file
imkanhaiyalal
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
Arduino: Open Source Hardware Hacking from the Software Nerd Perspective
Arduino: Open Source Hardware Hacking from the Software Nerd PerspectiveArduino: Open Source Hardware Hacking from the Software Nerd Perspective
Arduino: Open Source Hardware Hacking from the Software Nerd Perspective
Howard Lewis Ship
 
3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesis3245731 tele-controlled-steper-motor-thesis
3245731 tele-controlled-steper-motor-thesis
Thanh Nguyen
 
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