Programming ATMEGA32 (or Any Other AVR) Using Arduino IDE

The Arduino is a very cool development board where you could create hundreds of projects. But it doesnā€™t mean that for every project you create, you would need an Arduino board dedicated to that project alone. A hundred projects and a hundred Arduinos? Thatā€™s a waste of money! Depending upon the requirements of your project, you could choose from a wide array of microcontrollers ā€“ try AVRs from Atmel (now Microchip, yes the maker of the PIC). One microcontroller which is very tinkerer-friendly is the ATMEGA32, which is offered in a 40-pin PDIP package. This makes it very easy to be incorporated in prototype board and breadboard set-ups. In this ā€˜ible, ATMEGA32 will be used but the same flow applies to other AVRs.
Programming ATMEGA32 (or Any Other AVR) Using Arduino IDE

Step 1: Convert Your Arduino Into a Debugger/programmer

Thereā€™s a sketch that you could load to your Arduino which can transform this development board into a debugger or programmer. This means we can use the Arduino to load a program to another microcontroller ā€“ in this case, the ATMEGA32. Programs (yes, sketches) can be created and compiled using the Arduino IDE then flashed to the ATMEGA32. If things go well, you can eliminate the Arduino development board from your project and the ATMEGA32 does all the work from that point on. Go to Examples and find the ArduinoISP sketch. Make sure everything is set up correctly. In my case, Iā€™m using an UNO board and to program the sketch to my UNO board, Iā€™ll use the AVRISP mkII (my default). Go to Sketch then click Upload.
Unzip. Inspect the files. The things we need are the ā€œboards.txtā€ and the contents of the ā€œvariantsā€ folder. Open your Arduino folder in Program Files. Go to hardware>arduino>avr. You will see the ā€œboard.txtā€ file. This file lists all boards available for use on your Arduino. We need to add boards for ATMEGA32 into this file. To do this,append the contents of the downloaded board.txt file to the original board.txt file. CAUTION: You need not include the first few lines (see image).
Next, go to hardware>arduino>avr>variants. Copy into this folder the contents of the downloaded ā€œvariantsā€ folder. It is named mega32.
Now, check to see that ATMEGA32 boards are now available for use in the Arduino IDE. Go to Tools>Board.
Programming ATMEGA32 (or Any Other AVR) Using Arduino IDE Schematic
Read More: Programming ATMEGA32 (or Any Other AVR) Using Arduino IDE


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top