Pages: [1] 2   Go Down
Author Topic: Burning Arduino to ATmega32A  (Read 5452 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear Friends,

I have an USBASP programmer and a couple of ATmega32A(unfortunately this is the most sold controller at my place) lying around. I wish to know if i can burn an Arduino Bootloader onto it to take advantage of using Arduino framework for writing my applications. Because more than AVR, Arduino suits me better for the greater society, ease in learning curve on the programming front (sorry i find Arduino a bit easier than AVR). Also I found a site where they have given the pin mapping of the ATMega32 http://retrointerfacing.com/?p=30.

Can someone help me through this? I do not mind burning my application hex files manually or to discard the Arduino IDE. All i need is a way to figure out running my Arduino framework based programs on my ATmega32 for which I believe the Arduino bootloader has to be burned into before.

Regards,

Ashok Srinivasan.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Go to www.avr-developers.com and download the files for ATMega32.
May need to create a new board type in boards.txt and make an entry in avrdude.conf after that.
IDE 1.0.1 has an updated structure that supports "variants" of microcontrollers. I'm not knowledgeable enough really descibe it better for you.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Go to www.avr-developers.com and download the files for ATMega32.
May need to create a new board type in boards.txt and make an entry in avrdude.conf after that.
IDE 1.0.1 has an updated structure that supports "variants" of microcontrollers. I'm not knowledgeable enough really descibe it better for you.

Firstly, thanks for your time and reply. Got it boss. One more thing to boot up the process, will this version work under 1.0.1 or do I have to use any specific version(ex., in the site you have mentioned 0.20)

Regards,

Ashok Srinivasan

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Give it a try with 1.0.1, can always go back to -0020 if it doesn't work.

avrdude.conf already has the info for atmega32.
You'll have to make a new boards.txt entry for the device.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the link. But the website seems to be old enough. Cant find the proper files. The described link is also dead. Any help on that, please?
http://www.avr-developers.com/bootloaderdocs/index.html
http://www.icy.com.au/
Cant find ATmega32A core files in Arduino-extras.zip file.
Any solutions?
Thanks.



Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Found another page with ATmega32 configuration files. http://retrointerfacing.com/?p=30=1
Downloaded the .zip files.
In the boards.txt file included in the zip, it shows the configuration for mega32 chip. But the 32 & 32A are different chips. I used that page to find out the fusebit config.  http://www.engbedded.com/fusecalc
Well, they have also listed 2 different pages for 2 different chips.

What should I do in that situation? I'll be using the 32A chip trying to implement the "playing tones based on micros()" http://forum.arduino.cc//index.php?topic=179761.0

Both the ATmega1284 & 32A are 40 pin IC with same port pin numbers. 32A is having few less pwm pins & other functionalities.



Will the code run on my 32A chip anyhow? any suggestions please.
Thanks for the support.
Good day.
« Last Edit: December 27, 2013, 02:58:07 am by nightcrawler218 » Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I tried to upload the ATmega32 bootloader on my ATmega32A chip using arduino & usbasp programmer.

The error I'm getting is
Code:
"efuse" memory type not defined for part "ATMEGA32"

Procedure followed:
Downloaded the attached zip file. (included in the post)
copied the ATmegaBOOT_32.hex & .c file to "C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\bootloaders\atmega32\"
Added the modified code to boards.txt
Opened arduino 1.0.5
Tools> Boards> ATmega32board
Tools> Programmer> USBasp

The modified & added part of boards.txt
Code:
##############################################################

atmega32.name=ATmega32board
atmega32.upload.protocol=arduino  // Changed it from "STK500" to "arduino"
atmega32.upload.maximum_size=28336
atmega32.upload.speed=115200 // changed it from "19200" to "115200"
atmega32.bootloader.low_fuses=0xff
atmega32.bootloader.high_fuses=0xdd
atmega32.bootloader.extended_fuses=0x00
atmega32.bootloader.path=atmega32            // default was "atmega8", I created an atmega32 folder under  the
atmega32.bootloader.file=ATmegaBOOT.hex             //bootloader folder & changed the path.
atmega32.bootloader.unlock_bits=0x3F
atmega32.bootloader.lock_bits=0x0F
atmega32.build.mcu=atmega32
atmega32.build.f_cpu=16000000L
atmega32.build.core=arduino
uno328.build.variant=standard

##############################################################

It is the issue I suppose.
Code:
atmega32.bootloader.extended_fuses=0x00
The fusecalc web page doesn't show any trace of extended fuse feature in both ATmega32 & 32A.
http://www.engbedded.com/fusecalc

* ArduinoBootloader.zip (15.29 KB - downloaded 89 times.)
« Last Edit: December 27, 2013, 05:49:25 am by nightcrawler218 » Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Deleted the efuse configuration & the bootloader successfully uploaded to ATmega32A.
Having issue with uploading the blink sketch into that chip. The error report says...
Code:
In file included from Blink.ino:10:
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:213:26: error: pins_arduino.h: No such file or directory
Any suggestions?
Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I put the arduino-mega32-mod.zip file (included in the post) contents  to the arduino core directory "C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino". The zip has the "pins_arduino.h" file that was to be there in the "core" folder. I overlooked the step then finally fixed it. now the issue lies on an other point.

I am trying to upload the blink sketch & now the error shown is...
Code:
In file included from C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:213,
                 from Blink.ino:10:
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/pins_arduino.h:45: error: conflicting declaration 'const uint8_t port_to_mode_PGM []'
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:127: error: 'port_to_mode_PGM' has a previous declaration as 'const uint16_t port_to_mode_PGM []'
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/pins_arduino.h:46: error: conflicting declaration 'const uint8_t port_to_input_PGM []'
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:128: error: 'port_to_input_PGM' has a previous declaration as 'const uint16_t port_to_input_PGM []'
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/pins_arduino.h:47: error: conflicting declaration 'const uint8_t port_to_output_PGM []'
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:129: error: 'port_to_output_PGM' has a previous declaration as 'const uint16_t port_to_output_PGM []'

The page from where I get the ATmega32 arduino files is...
http://retrointerfacing.com/?p=30=1

Any clue on how to fix that?
Thanks for the co-operation.

* arduino-mega32-mod.zip (11.83 KB - downloaded 49 times.)
« Last Edit: December 27, 2013, 01:09:41 pm by nightcrawler218 » Logged

"Imagination is more important than knowledge."
-Einstein

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27434
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Keep slogging away! You'll get the little things fixed ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your reply CrossRoads. Well, I think that there is somekind of conflict in between Arduino.h & pins_Arduino.h file. I opened the pins_Arduino.h file in notepad++ tried to find out whats wrong but the contents are like huge mountains of puzzles. Still searching for the right direction.

Should I try with the 0020 version? Need to find it over internet. Official download page (http://arduino.cc/en/Main/Software) does not have the older versions before 1.0.
Give it a try with 1.0.1, can always go back to -0020 if it doesn't work.
avrdude.conf already has the info for atmega32.
You'll have to make a new boards.txt entry for the device.
Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Found something relevant... http://wiki.edwindertien.nl/doku.php?id=software:bootloaders
The mod.zip file is non existent http://www.robotcraft.ca/webshop/download/zip/arduino-mega32-644-mod.zip
Tried this thread too..
http://forum.arduino.cc/index.php?topic=24073.30 (2nd post)
Still no trace of the mod file. If anyone have saved this , kindly repost the mod.
Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After a long search finally get the mod file from 4shared. http://www.4shared.com/get/0faTto-i/arduino-mega32-644.html
put the content in the arduino core folder & overwrote the existing files. Then tried the described step of relacing the 
Code:
#if defined(__ATmega8__)
in all .c files. Unfortunately the ctrl+F cant find anything as such. & finally the arduino IDE is showing the same error report while I'm trying to upload any sketch to ATmega328p chips with either the default settings "ARVISP mkII" or "USBasp". smiley-sad
I also tried that page http://www.freetronics.com/pages/usbasp-icsp-programmer-quickstart-guide#.Ur347OLbySA for Zadig solution. No way out.
At this point I'm really perplexed. Please help.
Should I try modifying the preference.txt? I'm using Arduino IDE 1.0.5
« Last Edit: December 27, 2013, 05:25:12 pm by nightcrawler218 » Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tried Gen7
http://reprap.org/wiki/Gen7_Arduino_IDE_Support
Hopeless!
The same error with pins_arduino.h
Code:
In file included from C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/Arduino.h:220,
                 from C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/wiring_private.h:33,
                 from C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\wiring_digital.c:28:
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/pins_arduino.h:103: error: 'DDRA' undeclared here (not in a function)
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/pins_arduino.h:111: error: 'PORTA' undeclared here (not in a function)
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/pins_arduino.h:111: error: initializer element is not constant
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/pins_arduino.h:111: error: (near initialization for 'port_to_output_PGM[1]')
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/pins_arduino.h:119: error: 'PINA' undeclared here (not in a function)
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/pins_arduino.h:119: error: initializer element is not constant
C:\Users\Roy\Desktop\arduino-1.0.5\hardware\arduino\cores\arduino\/pins_arduino.h:119: error: (near initialization for 'port_to_input_PGM[1]')
Logged

"Imagination is more important than knowledge."
-Einstein

Offline Offline
Sr. Member
****
Karma: 2
Posts: 344
YES! It is possible. Even Impossible Says I m Possible. :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've read your post in this thread http://forum.arduino.cc/index.php?topic=78057.0 (3rd from bottom). I made those changes but due to that pin mapping file, the blink sketch wont even compile. Any updated repository of those configuration files? Any clue or any hints please?
Logged

"Imagination is more important than knowledge."
-Einstein

Pages: [1] 2   Go Up
Jump to: