Ok, on to Atmega32

Gents,

I've been messing around with arduino-0011-core.zip in an effort to port it to ATMega32 and ATMega644 chips. I finally managed to get it to work and was able to successfully test it with ATMega32 by essentially running code written for ATMega168 with a minor tweak at the application level (PDE file) that does PWM register initialization. I think that tweak can be safely ignored for the purpose of code/chip interoperability since its application specific. ATMega644 support still requires more work and testing.

I have successfully validated following things myself on ATMega32:
I2C master mode (PC0,PC1)
8 and 16 bit PWM on (PB3,PD4,PD5,PD7)
Hardware Serial (PD0,PD1)
Software Serial (PB0)
Analog reads PA0-2

Clock speed used for tests is 8Mhz.

I would really appreciate if someone could review/try this code for interoperability correctness as well as get creative with it and hopefully provide me with some feedback.

List of modded files:
pins_arduino.c
pins_arduino.h
wiring.c
wiring_analog.c
wiring_digital.c

To get things to work, I had to actually copy these five files into $ARDUINO_IDE_HOME/hardware/cores/arduino directory. But before you do it, make sure that you backup originals so you have something to roll-back to :wink: in case things get messy.

This is were you can download the files http://www.robotcraft.ca/webshop/p7/Robot-Software-Downloads/pages.html
Modded version of arduino-0011-core.zip -> http://www.robotcraft.ca/webshop/download/zip/arduino-mega32-644-modded-public.zip
Modded files only -> http://www.robotcraft.ca/webshop/download/zip/arduino-mega32-644-mod.zip

Cheers...

Andre