In order to get some of the features like serial ports and I2C working on my atmega1284p chips, I needed to update the Sanguino core I have been using. The latest one published is based off arduino 0018 which works ok, but 0018 is before they had added strings and other useful features built into the core. I initially started updating the Sanguino core to 0021 which is what I was using as my dev environment but was having some issues with some conflicts in stdio and stdlib. From looking at the release notes the arduino team moved to register based pre-compiler directives rather then the CPU based ones used before. This method seems to be much better suited to alternative processors and is illustrated well here.
So I moved forward updating the Sanguino core files to 0023 which is the current version on arduino.cc. The modifications are pretty simple, update the pin outs in
pins_arduino.c and everything else just falls into place.
I am currently working through testing functions on the atmega1284p I have gotten both UARTs working with out issue. I did need to make some modifications to the Wire library to get I2C working. Just needed to have it add pullups to the correct pins, this could have been done in hardware but I like using the software pullups. I believe SPI will work, but am still testing that.
Here are the modified Sanguino files which support 644p,1284p,and 1284p @8mhz and also the updated Wire library: