Arduino Code on AVR

Can the Arduino IDE and Programming languange be used on any AVR? If I were to building my own board with an ATMega328 could I use some arduino code on it?

Can the Arduino IDE and Programming languange be used on any AVR?

Not without a modified core and bootloader.

If I were to building my own board with an ATMega328 could I use some arduino code on it?

The 328 is used by the duemilanove: http://arduino.cc/en/Main/ArduinoBoardDuemilanove

Burn the appropriate bootloader, and select duemilanove w 328 from the boards menu in the IDE. :)

Can the Arduino IDE and Programming languange be used on any AVR?

Not without a modified core and bootloader.

Just to clarify, modifying the core and bootloader is only necessary for chips that are not already supported. That is to say you cannot use the IDE and language for all AVR chips, only ones that have been loaded with an appropriate bootloader and are supported by the version of the core that you are using.

As stated, the current version of the IDE includes both of these things for the Atmega328, because it is used in the Duemilanove.

Alright cool, so If I want to use an ATTiny I probably couldn't do that because it's not supported to begin with.

No, but there has been some work in the area of getting Arduino and ATTiny to play nice. There's more info here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236434254