ATmega DIP40 in Arduino IDE 1.6.4





Introduction: ATmega DIP40 in Arduino IDE 1.6.4

Quick solution for use some ATmega microcontrollers in newer Arduino IDE ver. 1.6.4

As we know, recent changes in the Arduino world have boosted development of Arduino IDE, now reached version 1.6.4.

I do not want to talk at all of the war Arduino LLC vs Arduino SRL (not now, not here). In fact I think my opinion on this topic is not important.

So, I downloaded and try versions 1.6.2/1.6.4 from and 1.7.2 from (1.7.3 not tested yet).

And I decided to go ahead with 1.6.4 from / Arduino LLC

I took the opportunity and did some cleaning in the files pins_arduino.h for ATmega1284, ATmega32 and ATmega16. I remove defines for A0-A7. We can access all 32 digital pins with digitalRead(0 ... 31) / digitalWrite (0 ... 31,[...]) and ADC pins with analogRead(0..7).

Let's start!

Step 1: Select Preferences

Select Preferences from File menu.

Step 2:

Edit Additional Boards Manager URLs field and put this link:

Step 3: Open Board Manager

And wait a little...

Step 4: Install Boards

Yes it is easier now.

Step 5: Done

Now it's done. Almost :)

For ATmega1284 any change is no longer necessary.

For ATmega32 and ATmega16 we need to edit


we will replace:

#if defined(__AVR_ATmega8__)
	config |= 0x80; // select UCSRC register (shared with UBRRH) 


#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega32__) || defined(__AVR_ATmega16__)
	config |= 0x80; // select UCSRC register (shared with UBRRH) 

Step 6: Finally

Please note: This is a project in progress. It may have some errors. I tested compiling and uploading some examples for ATmega1284/32/16.

At this moment are defined six "boards"(usually I work with these microcontrollers.):

  • ATmega16-8MHz
  • ATmega16-16MHz
  • ATmega32-8MHz
  • ATmega32-16MHz
  • ATmega1284-16MHz
  • ATmega1284-20MHz

I intend to include ATmega644 and ATmega1284P, but it will take some time (I have no one handy). I plan to buy two of every and and put them on these small boards like above.

You can also read:

Have fun!



  • Water Contest

    Water Contest
  • Creative Misuse Contest

    Creative Misuse Contest
  • Oil Contest

    Oil Contest

33 Discussions


7 months ago

avrdude: Yikes! Invalid device signature.

Double check connections and try again, or use -F to override

this check.

An error occurred while uploading the sketch

help me to recover this error

1 reply

What microcontroller do you use? And what programmer?

It looks like AVRDUDE does not correctly identify the microcontroller. There may be other components connected to the SPI or RESET pins (used for ISP programming) which may interfere with the programming process. It seems more like a hardware problem than software.


7 months ago

i have done all the above steps u get , but am getting upload error in arduino ide .....{

avrdude: Yikes! Invalid device signature.

use -F to override

this check.

An error occurred while uploading the sketch


Everything work for me fine. My own board blink very nice. Thank You very much.

1 reply

You're welcome!

I'm glad to hear that. Good luck!

i get this error when i am trying to install the package.

4 replies

Problem solved. Still I do not know why the file has disappeared.

You can try again now.

You are right. I do not know why the file has disappeared.

I'll see what it's about in a matter of hours.

I am receiving an error, " avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='' product='USBasp' ". I am using ATMEGA32... I use the same USBasp to write hex files created by Atmel studio (using Extreme AVR burner)... in this case its not working... please help.

4 replies

It seems that avrdude not "see" USBasp device. Maybe was "locked" by "Extreme AVR burner" program (You have not closed the program?)... or USBasp device have a different vid/pid form what avrdude is configured? I notice that device is working device... but message is from avrdude included in Arduino IDE... I sugest to try a separate version of avrdude... to see if working...

...or restart, plug USBasp in another USB socket an try first with Arduino IDE...

...look after usb devices in your operating system configuration to see how this device is used... what are vid/pid... and other info...

Some USBasp clones (I use them too) do not have the "official" version of firmware... mine worked also in linux and windows... but maybe an updated firmware will solve this problem... you can try to update usbasp with another usbasp... and a known working program like Extreme burner"

this " error" I talked earlier was in Arduino IDE 1.6... (I did not use avrdude)

I know that error was in Arduino IDE... more precisely in avrdude that is bundled with Arduino IDE 1.6.xx... You can search in Arduino IDE installation folders and you will see... somewhere in .../arduino-1.6.x/hardware/tools/avr/bin... there are avrdude files...

after the latest additions(of informations) you've made I only see that Arduino IDE not installed properly ... or has altered thereafter... I don't think that has to do with definitions for DIP Atmega 40, because these definitions use tools and config files that are already there...

Right now I use 1.6.7 under Linux Ubuntu... and method/files from this instructable...

a strange thing happened... I (just out of curiosity) used an older version of Arduino IDE 1.5.2 and this same USBasp device worked perfectly...

hi. i want to monitor values on IDE serial monitor but it not working. would you help me please.


Hi Guys,

I developed a scketch to work on Arduino Mega and I need to compile in an AtMega1284p-pu
- Can I compile the same scketch in Atmega1284p-pu?
- Is it necessary to change anything on the scketh? pins for example?
- The AtMega1284p-pu is still a "virgin", which Arduino's bootloader is better to burn in?


Angelo Ventura

1 reply

Thank you very much for this instructable! I recently asked the groups a question on how to use a AtMega 32. Then I saw your instructable how to make a DIP 40 mini board, and this instructable. I hope I can finally get those ATMegas running! Just 1 question: I would use FTDI chips to connect the board to the PC, would that work?