I'm currently in the process of porting the Arduino platform to ATmega169P.
So far, I have
- created variants/atmega169p/pins_arduino.h and
- updated cores/arduino/wiring_analog.c (based on arduino 1.0.5).
I attached both files.
Then there are the following files in cores/arduino/ for which it seems (at first glance) that they don't need any update. But I will check them again, once I need any of the functionality or I find the time:
I don't have a bootloader yet. But it's possible to use JTAG and the "Upload using programmer" menu item, for this I created the following entry in /etc/programmers.txt:
I also had to update the "desc" in the m169 section of /etc/avrdude/avrdude.conf:
id = "m169";
desc = "ATMEGA169P";
I.e. I added a "P" to the desc. This is because - as far as I understand - the Arduino IDE uses the "xxx.build.mcu" entry from the boards.txt for both compiling and uploading. In case of the ATmega169P it _should_ use "atmega169p" for compiling and "m169" or "atmega169" (without "p") for uploading. But I could not find a way to configure this in the boards.txt. Hence I changed the avrdude.conf as described above. Better ideas are appreciated.
In addition I have created a board.txt section for the HR20 (a radiator thermostat) which uses an ATmega169P:
hr20.name=HR20 (not Open Hardware)
I've compiled, uploaded and run a first sketch (blink of course). Did I forget something? Is anyone else interested in this? I'd like to have optiboot on the ATmega169P at one point in the future, but that's a low priority task for me.