ATMEGA32A-PU in place of ATMEGA328

  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)