Notes on AVR interrupt
Conversion between IAR style interrupts and AVR-GCC style
Note: Please also see this updated article about differences between IAR and GCC
Change the IAR style of:
#pragma vector=ADC_vect __interrupt void ADCinterrupt(void)
to the avr-gcc style of
INTERRUPT(SIG_ADC)
or
SIGNAL
and change
enable_interrupt()to
sei()
and
disable_interrupt()to
cli()
The interrupt codes can be found in the avr-gcc header files for the particular device in question. For example iom8.h for ATmega8 and iotn13.h for ATtiny13. The corresponding IAR interrupts are as described in the AVR datasheets. Both of these names are found in the header file and so can be matched up there.
Perhaps I should have made this entry more broad than just interrupts. There now is a need to cover other keywords. The IAR manual states that objects declared with the
__flash
keyword will be placed in the the segment:
-Z(CODE)NEAR_F=0-1FFF
and a port of AVR butterfly from IAR to AVR-GCC by Martin Thomas seems to use const int to replace the flash int keyword. So that flash unsigned char might become
const unsigned char
Thu, 12 Jan 2006 15:38 Posted in AVR Techniques