Ok, on to Atmega32

Andre,

I'm not sure what happened to Zach server, so I put up my version of the files here:

http://macjordomo.fuortes.net/atmega644/

if you copy the two atmega644 folders in cores and bootloaders in the hardware folder and append_to_board.txt to board.txt file you should get a new board menu called atmega644 in the Arduino IDE.

A few notes:

This is working on a DevBoard-32 with a Atmega644 and a 16 MHz resonator. It connects to my Mac with a Arduino Mini USB Adapter with the DTR connected to the reset pin by a 100 nano-farad capacitor and a 10K pull-up resistor (as per the Diecimila). It's working well and i can upload the sketches straight from the Arduino IDE after having uploaded the bootloader once (the Devboard-32 came with a different one) with a USBTiny connector.

Most of the code in the "core" folder is the Arduino original as changed by robotcraft.ca (without all the conditinals). Zach made most changes and I made some in the pinouts (due to my choice of board).
The bootloader was modified and made working by Zach (I made extremely little changes). The boot loader hex file is currently compiled for a 16 Mhz external clock and a 3 seconds delay after reset before starting the sketch. The delay is plenty with the setup as above in which the reset is started by the Arduino IDE. If you need to change these two things (e.g.manual reset, different clock) you can change two variables in the Make file of the bootlader. Change the AVR_FREQ to your clock frequency and the -DMAX_TIME_COUNT to a higher value (with 1/4 of AVR_FREQ is about 3 secs) to increase the delay. Also change the atmega644.build.f_cpu=16000000L value in the boards.txt

Also the current baud rate is 57600, it seems to work well if you have problems you can decrease it to 19200 by changing the 57600 both in the boards.txt and the bootloader .c file.

Make sure you look at pins_arduino.c because currently the "logical" pin in Arduino do not correspond to physical pin in the ATmega644 and that's where the correspondence is dictated. I'm currently working on a new board with a ATMega644 which would keep the same physical and logical pinouts of the Diecimila so you could just pop in shields and sketches and have it working. (Current code name is Quarantamila)

Finally if your clock is not external you might also need to change the fuses setup in boards.txt. I got them wrong at the beginning and my

digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off

was taking about 16 seconds to turn off!!

(I apologize if most of these instructions were already clear to you, but ........ just in case :wink:

Michele