Compiling for AVR Devices

Another small note for myself here.

In order to compile for AVR devices it is essential that you define which AVR you are targeting on the command line with your version of GCC. Chances are you will be targeting an ATmega168 (use the -mmcu=atmega168 command line switch) as that seems to be the most prevalent hobby chip. It should also be noted that it is even more important when compiling code for embedded devices to use the -Wall command line option.

Also for future use the avr/delay.h file is now util/delay.h (which gets me every time).

Leave a Reply