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 Arduino.cc and 1.7.2 from Arduino.org (1.7.3 not tested yet).

And I decided to go ahead with 1.6.4 from Arduino.cc / Arduino LLC http://www.arduino.cc/en/Main/Software.

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:

http://openhardware.ro/boards/package_openhardwarero_index.json

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

...\arduino-1.6.4\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp

we will replace:

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

with:

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

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: https://www.instructables.com/id/ATmega-DIP40-Mini...

Have fun!