ATMEGA32A-PU in place of ATMEGA328

Hello :slight_smile:
I have been working with the arduino uno board for quite some time now, and am ready to try my hand at making one now. But I have access to only the ATMEGA32A-PU 40-pin DIP here :(. Is it possible to make an Uno out of this chip? This is more of a necessity than an experiment, as I need to get some arduinos, and I can't afford to buy the original boards.
I have searched through the forum and found this thread:
http://forum.arduino.cc/index.php/topic,149677.0.html

Regards!
Trishit :slight_smile:

lastRites:
Hello :slight_smile:
I have been working with the arduino uno board for quite some time now, and am ready to try my hand at making one now. But I have access to only the ATMEGA32A-PU 40-pin DIP here :(. Is it possible to make an Uno out of this chip?

The functionality is the same, they just have different power requirements. An 'A' chip won't work at 1.8V like a 'P' chip can (P="Picopower") but that doesn't matter much in a 5V Arduino.

You may find the Arduino IDE doesn't like burning bootloaders on the chip because it has a different device signature. You can fix that by editing avrdude.conf while you burn them.

This is a 40pin DIP whereas the P is 28 pins. So the pinouts are different as well. Are there any tutorials out there on how to get other chips to work with the UNO?

lastRites:
This is a 40pin DIP whereas the P is 28 pins. So the pinouts are different as well.

Yes. I assumed you'd just skip the non-arduino ones.

lastRites:
Are there any tutorials out there on how to get other chips to work with the UNO?

Lots of them. Google for "standalone arduino"/

Most, if not all of the well documented "standalone arduinos" use the standard atmegas. Is there a procedure to follow when we are trying to make the arduino ide work with non standard chips?

lastRites:
Most, if not all of the well documented "standalone arduinos" use the standard atmegas. Is there a procedure to follow when we are trying to make the arduino ide work with non standard chips?

You may have to edit "boards.txt" and "avrdude.conf".

also create a new hardware/arduino/variants, and pins_arduino.h...

But first check out:
http://www.avr-developers.com/

Because some work has already been done.

Thank you for the replies :slight_smile: I see a lot of work done here for the Atmega32, which has the same pinout(40 pin DIP) as the Atmega32A-PU. But the fuse settings are different.What modifications will I have to make so that my chip works correctly? I will use ICSP with an USBASP or an usbTinyisp as I do not own an usb to serial cable.
Another thing is that, most of the work done here seems to be for the older versions of the IDE. I use the "arduino-1.0.5". Will this cause any problems?
Thank you again for taking the time to reply :slight_smile:

Another thing is that, most of the work done here seems to be for the older versions of the IDE. I use the "arduino-1.0.5". Will this cause any problems?

Yes many things since the Arduino's 0022 are changed, although everytime a new update rolls out there's something new in it or changes are there, methods like Serial.flush() are all deprecated along with various changes that I can't even remember.

ATmega32A-PU compared with ATmega328P

The ATmega32 is totally similar to the ATmega8 as much I remember the datasheet and as ATmega8 is totally supported so with minor changes like "boards.txt" and "avrdude.conf" must work its just some fuses different and flash x4 on the ATmega32.
for example The 8 suffixed to the ATmega88 provides complete compatibility with the Arduino IDE given all the timers and PWM channels etc are same just the difference in flash is there so with above minor changes if one can support ATmega88 one can also support ATmega32 in the same way!

I have seen the custom core files for the for the atmega 32 on http://www.avr-developers.com/ (the pin map/ most other features of the atmega 32a is identical except the fuse bits), but again, all of the work done there is for the older ide. Has anyone used non-standard chips for making an arduino using the newer IDEs? Is there any write up/article on how to use other MCUs with arduino? I am yet to grasp the basics of doing this :frowning:

What are the steps one should follow while trying to add a new mcu to the arduino ide?

A very brief summary to add support for other AVRs to the Arduino IDE:

  1. You need to tell the IDE about it, via the boards.txt file.
  2. You need to have some core code support for the AVR.
    (If the new AVR is close enough to some existing supported AVR family you might be able to borrow core code from there and use a variants pins_arduino.h file for different pinout support)
  3. You need to make sure the AVR toolchain has support for it.
    (You may need to replace the older WINAVR2008 (inlcuded with the IDE) with WINAVR2010, or use the latest AVRTOOLCHAIN from Atmel.)
  4. You need to make sure avrdude has support for it.
    (Update the avrdude.conf file to include suppport for it.)
  5. Optional - Create a bootloader for it for serial upload support.

Thank you! :slight_smile:
I will try it this weekend and post the results :slight_smile:

See
http://forum.arduino.cc/index.php?topic=149677.0

The newest optiboot does support atmeaga32..

The thread you listed seems incomplete :frowning: Moreover I am trying to use the 32A. So the fuse bits will be different. Can anyone provide a step-by-step guide on how to interface new chips to the newer IDE (1.0.5)?

  1. You need to tell the IDE about it, via the boards.txt file.
    a) Create a boards.txt file under \sketches\hardware\mymega32\boards.txt. (see attach below)
    b) Create a pins_arduino.h file under \sketches\hardware\mymega32\variants\mega32\pins_arduino.h. (see attach below)

  2. You need to have some core code support for the AVR.
    a) Install the mighty-1284p core under \sketches\hardware\mighty-1284p\ from GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino

  3. You need to make sure the AVR toolchain has support for it.
    a) The default AVR toolchain included with Arduino IDE 1.0.5 has support for the ATmega32. The ATmega32A is a drop in replacement for the ATmega32, with the same signature and fuse settings.

  4. You need to make sure avrdude has support for it.
    a) The default avrdude v5.11 included with Arduino IDE 1.0.5 has support for the ATmega32.

  5. Optional - Create a bootloader for it for serial upload support.
    a) The latest Optiboot v5.0a has support for the ATmega32. Google Code Archive - Long-term storage for Google Code Project Hosting.
    b) Note - If you build it for 8MHz use 115,200 BAUD. The 57600 BAUD setting does not work reliably with Optiboots default double-rate UART setting.
    c) For 16MHz external clock:

make atmega32 AVR_FREQ=16000000L BAUD_RATE=115200 UART=0 LED=B7 LED_START_FLASHES=3
(rename optiboot_atmega32.hex to optiboot_atmega32_16MHz.hex) (see attach below)
For 8MHz internal/external clock:
make atmega32 AVR_FREQ=8000000L BAUD_RATE=115200 UART=0 LED=B7 LED_START_FLASHES=3
(rename optiboot_atmega32.hex to optiboot_atmega32_8MHz.hex) (see attach below)
e) copy the bootloader hex files to \sketches\hardware\mymega32\bootloaders\optiboot\

boards.txt (1.43 KB)

pins_arduino.h (4.64 KB)

optiboot_atmega32_16MHz.hex (1.32 KB)

optiboot_atmega32_8MHz.hex (1.32 KB)

Thanks!!! XD
This is exactly what I was looking for!
I will post results as soon as I get it done. One more query though, I will use the "upload using programmer" function as I don't need the serial interface. I have an usbasp. It will work, right? :stuck_out_tongue:

Yes, that should be okay. Just remember to burn bootloader at least once, to get the fuses set. Or you could also do it manually from command line with avrdude.

hiduino:
The ATmega32A is a drop in replacement for the ATmega32, with the same signature and fuse settings.

The default fuse settings are different for the 32 and the 32A.
Atmega 32:
HIGH FUSE: 0x99
LOW FUSE: 0xE1

Atmega 32A
HIGH FUSE: 0x99
LOW FUSE: 0xF1

Where do I change these? Would a change in the boards.txt file suffice?

@lastRites:

Your sanity would be preserved if you elected to not jump into deep water until you can swim. Try starting with a board'duio based on a cheap 328P-PU. The Chips are cheap, the Internet has numerous and easy to follow directions, and you can use your existing Arduino as an ISP.

Example: Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board

After you master the backstroke, then move on to the more complicated.

  • Ray