ATmega DIP40 in Arduino IDE 1.6.4


38,604

39

36

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!

1 Person Made This Project!

Recommendations

  • Make it Glow Contest

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

36 Discussions

0
Nomank16
Nomank16

2 years ago

i am getting this error again and again. when i wanted to download AVR board in ardiuno IDE.

FEQ6D1HJKN8OUC2.LARGE.jpg
0
Silvius
Silvius

Reply 2 years ago

Try now... for some (unknown) reason zip file no longer exist on site.

Now I reloaded again.

0
AhmedY61
AhmedY61

3 years ago

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

0.PNG
0
AhmedY61
AhmedY61

Reply 3 years ago

trying to download the link

1.PNG
0
Silvius
Silvius

Reply 3 years ago

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

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

0
Nomank16
Nomank16

Reply 2 years ago

i am getting this error again and again. when i wanted to download AVR board in ardiono ide

1.PNG
0
Silvius
Silvius

Reply 3 years ago

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

You can try again now.

0
AhmedY61
AhmedY61

Reply 3 years ago

thank you it works

0
kps004
kps004

3 years 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

0
Silvius
Silvius

Reply 3 years ago

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.

0
kps004
kps004

3 years 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

}

0
JakubM38
JakubM38

3 years ago

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

0
Silvius
Silvius

Reply 3 years ago

You're welcome!

I'm glad to hear that. Good luck!

0
MoizA11
MoizA11

4 years ago

I am receiving an error, " avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' 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.

0
Silvius
Silvius

Reply 4 years ago

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"

0
MoizA11
MoizA11

Reply 4 years ago

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

0
Silvius
Silvius

Reply 4 years ago

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...

0
MoizA11
MoizA11

Reply 4 years ago

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...

0
HosseinM8
HosseinM8

4 years ago

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

0
VishalM17
VishalM17

4 years ago

HEY TIMERONE LIBRARY IS NOT WORKING IN ARDUINO ATMEGA32 DO ANY ONE HAVE SOLUTION I NEED TO USE TIMER FOR DELAY, MY MAIL ID IS vishal.mhatre390@gmail.com