After I wrote several articles about using ATmega microcontrollers (DIP40) in Arduino environment I had some feedback that I was asked how to be effectively put into operation this project. As I came into the Arduino world from classical microcontrollers development world, I have not found necessary to elaborate a method or hardware project for this.

Meanwhile I realized that in Arduino world as there are many users who not have a background in digital electronics / microcontrollers development. This is the great advantage of Arduino, it is so easy to use that even if someone have no knowledge or experience with electronics or programming, can get a simple project running in hours (or minutes).

Personally, I use the Arduino as a platform for experimentation. Even if most of the times I bypass hardware "abstraction layer" (and working directly with microcontroller hardware) I continue to use the Arduino IDE because is so simple(and fast) to start experimenting with different algorithms or techniques to control various peripherals.

I must admit that sometimes I use Arduino IDE as a replacement for AVR Studio, as long as USBASP is well supported. So I think that this project will not be useless, although there are many similar projects, each with advantages and disadvantages.


  • Can be used with DIP40 ATmega Microcontrollers: ATmega16, ATmega32, ATmega644, ATmega1284, ATmega1284P
  • Thru-hole components / easy to solder
  • Can be used with Arduino IDE (or other IDE / programmer / compiler )
  • Include filtering of AVCC for better analog input.
  • Include 10pin ISP connector / easy to use with USBASP (or another compatible programmer)
  • More freedom in the choice of connections with external modules
  • ... I almost forgot ... price...


  • No bootloader (limitation or advantage, depends on how you look at). However a bootloader can be easily added (...some hardware is required)
  • No standard Arduino footprint. (We can not plug directly standard shields, but can still use them in more traditional way, with jumper wires)

Step 1: Comparison

Here is a comparison between various common microcontrollers (DIP40 package) from ATmega family.

Please note that ATmega328P and ATmega2560 are not DIP40. I put them here for comparison (ATmega328P ~ Aruino Uno / ATmega2560 ~ Arduino Mega 2560).

I also emphasized column for ATmega1284 / 1284P, this is the most capable microcontroller for ATmega in DIP40 package (at least at the time I wrote the article).

<p>Hi Guys,</p><p><br>I developed a scketch to work on Arduino Mega and I need to compile in an AtMega1284p-pu<br>- Can I compile the same scketch in Atmega1284p-pu? <br>- Is it necessary to change anything on the scketh? pins for example?<br>- The AtMega1284p-pu is still a &quot;virgin&quot;, which Arduino's bootloader is better to burn in?<br><br>Thanks <br><br>Angelo Ventura</p>
<p>I tried to answer your question here:</p><p><a href="http://openhardware.ro/using-atmega32-arduino-ide/#comment-156" rel="nofollow">http://openhardware.ro/using-atmega32-arduino-ide/...</a></p>
<p>Thank you, you really helped me out! I use the board that diy-bloke mentioned. With some more help from your site, some thinking... And setting the right controller I finally made it to program a &quot;stand alone atMega32A&quot;. I'll need to tweak the fuses a bit, to have the exact 1sec delay. Oh, your site is really worth a lot!</p>
<p>nice! :)</p>
<p>Great Ibble. For those who want to venture in 40 DIP ATMEL microcontrollers but are weary to grab a soldering iron: you might be interested in a really cheap 40 dip experimenter board: </p><p><a href="http://www.aliexpress.com/item/C18-Newest-2014-1set-ATMEL-For-ATMEGA16-ATmega32-AVR-Minimum-System-Board-USB-ISP-USBasp-Programme/32224290518.html" rel="nofollow">http://www.aliexpress.com/item/C18-Newest-2014-1se...</a><br><br>The crystalfrequency of it is 8MHz I think. it comes with a programmer</p>
<p>Thanks for feedback! :)</p><p>I ordered myself one of them few months ago. Can be purchased with or without USBASP programmer. </p><p>They are incredibly cheap, considering that have ZIF socket onboard...And if you order it without USBASP, there are cheaper. </p><p>Some are equipped with 8MHz crystal some with 12MHz... or even16MHz </p><p>But the crystal can be changed easily, there is a socket for it ...look at the pictures attached. I overcloked an ATmega1284 at 24MHz this way...</p><p>Advantage: ZIF soket... :)</p><p>Drawback: ZIF socket... :)</p><p>Yes, sometimes ZIF socket bothers me, sometimes helps me a lot...depends on what I use board... for the final version of a project I prefer without ZIF ... </p><p>Regards!</p>
<p>darn, you are right. I had not even seen the socket for the crystal.<br>Yes I agree, i like a regular socket on my final board. only use zif for programmers.<br>in a quick setup with the USBasp I havent been able to get the USBASP to work yet, but that was on an attiny just with some wires plugged in. I expect it to wok on this board once I decided what chip to order. Maybe the 32 is good enough for what I needs. Your perfboard build looks definitely great</p>
<p>noo .. no 32. If you are starting in this kind of projects .. start with 1284 /1284P or 644. These are the newer microcontrollers and have PCINT interrupts...</p><p>Atmega32 and 16 does not have PCINT ...You'll need PCINT if you use SoftwareSerial or some Rotary encoders libraries.</p><p>Also timers registers are slightly different and you need to adapt some arduino libraries to function.(for 32 and 16) </p><p>I suggest you start with the most powerful microcontroller in development /research phase and downgrade for final project only if it permits this.</p><p>Have fun!</p>
<p>thanks. the 1284 it will be. <br>From your openhardware link I understood I may need the iom1248.h file. <br>Eventhough I have the arduino 1.06, i only hav the iom1248p.h file.<br>odd. Guess i will stick to the 1284p. :-)</p>

About This Instructable




More by Silvius:Reading 15 Rotary Encoders with Arduino and ATmega1284 Open Source TV Box - GeekBox AVR Transistor Tester 
Add instructable to: