Hello everyone, This is my first message to this forum. I was using IAR-KICKSTART, but now I want to give a try to Code Composer Essentials, but I did not find good information to implement Interrupts. In IAR to make an interrupt I use the following syntax: #pragma vectorSICTIMER_VECTOR __interrupt void basic_timer(void) { //interrupt function } In Code Composer I received: unrecognized #pragma I tried many variations but I was not succeeded. Could someone help me? Thank you in advance. Humberto Santos
Interrupt syntax in Code Composer Essentials
Started by ●October 24, 2005
Reply by ●October 24, 20052005-10-24
Humberto, I also have been going back and forth with IAR and CCE. I settled on IAR as I think its performance is way better than CCE. I set some macros to make this easier. For example: #ifdef IAR #pragma vectorC_VECTOR #else __interrupt void ADC_ISR (void); ADC12_ISR(ADC_ISR) #endif #ifndef IAR __interrupt void ADC_ISR (void) #else __interrupt void ADC12ISR (void) #endif { . . . } /Bill
Reply by ●October 24, 20052005-10-24
Thank you Bill, you make my day. Humberto Santos -----Original Message----- From: msp430@msp4... [mailto:msp430@msp4...] On Behalf Of w.sell@w.se... Sent: segunda-feira, 24 de Outubro de 2005 22:22 To: msp430@msp4... Subject: Re: [msp430] Interrupt syntax in Code Composer Essentials Humberto, I also have been going back and forth with IAR and CCE. I settled on IAR as I think its performance is way better than CCE. I set some macros to make this easier. For example: #ifdef IAR #pragma vectorC_VECTOR #else __interrupt void ADC_ISR (void); ADC12_ISR(ADC_ISR) #endif #ifndef IAR __interrupt void ADC_ISR (void) #else __interrupt void ADC12ISR (void) #endif { . . . } /Bill ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/CFFolB/TM --------------------------------~-> . Yahoo! Groups Links
Reply by ●October 24, 20052005-10-24
Hi, i do prefer compiler independent .c-files with a short macro: // WatchDog Timer is used as normal Timer ISR (WDT, timer_wd (void)) { u32_rtc_time++; // next second/n return; } with isr_compat.h from mspgcc: #if defined(__GNUC__) && defined(__MSP430__) /* This is the MSPGCC compiler */ #define ISR(a,b) interrupt(a ## _VECTOR) b(void) #elif defined(__CROSSWORKS_MSP430) /* This is the Rowley Crossworks compiler */ #define ISR(a,b) void b __interrupt[a ## _VECTOR](void) ... With that macro the C code is more compact, easier to read and can also be compiled with mspgcc, crossworks, iar, quadravox, etc.. And if you have to port the code to other platforms, e. g. ARM, you only have to port the macros and not the C code (if you use only stdint.h and little endian). Regards, Rolf ------ http://true-random.com/freelancing msp430@msp4... schrieb am 25.10.05 00:08:18: > > Humberto, > I also have been going back and forth with IAR and CCE. I settled on IAR as I think its performance is way better than CCE. I set some macros to make this easier. For example: > > #ifdef IAR > #pragma vectorC_VECTOR > #else > __interrupt void ADC_ISR (void); > ADC12_ISR(ADC_ISR) > #endif > > #ifndef IAR > __interrupt void ADC_ISR (void) > #else > __interrupt void ADC12ISR (void) > #endif > { > . > . > . > } > > /Bill > > > > > > > > > > > > . > > > Yahoo! Groups Links > > > > > >
Reply by ●October 25, 20052005-10-25
Hi, I think, In IAR you have included "MSP430f15x.h" if you do not have the file you could put exact interrupt address in hex. BR Amir --- In msp430@msp4..., "Humberto Santos" <humberto@u...> wrote: > > Hello everyone, > > This is my first message to this forum. I was using IAR-KICKSTART, but now I > want to give a try to Code Composer Essentials, but I did not find good > information to implement Interrupts. > In IAR to make an interrupt I use the following syntax: > > #pragma vectorSICTIMER_VECTOR > __interrupt void basic_timer(void) > { > //interrupt function > } > > In Code Composer I received: unrecognized #pragma > I tried many variations but I was not succeeded. Could someone help me? > > Thank you in advance. > > > Humberto Santos >
Reply by ●October 28, 20052005-10-28
Hi Bill and Humberto It works in a `.c' file! But in a `.cpp' file, the message "badly formed pragma" is showed. Anyone knows how can I fix it? Thank you! Afonso. --- In msp430@msp4..., w.sell@c... wrote: > > Humberto, > I also have been going back and forth with IAR and CCE. I settled on IAR as I think its performance is way better than CCE. I set some macros to make this easier. For example: > > #ifdef IAR > #pragma vectorC_VECTOR > #else > __interrupt void ADC_ISR (void); > ADC12_ISR(ADC_ISR) > #endif > > #ifndef IAR > __interrupt void ADC_ISR (void) > #else > __interrupt void ADC12ISR (void) > #endif > { > . > . > . > } > > /Bill > > > > > > > >
Reply by ●October 31, 20052005-10-31
I didn't use in C++, only in C and it work fine. Humberto -----Original Message----- From: msp430@msp4... [mailto:msp430@msp4...] On Behalf Of Afonso Sent: sexta-feira, 28 de Outubro de 2005 23:15 To: msp430@msp4... Subject: [msp430] Re: Interrupt syntax in Code Composer Essentials - [CPP file] Hi Bill and Humberto It works in a `.c' file! But in a `.cpp' file, the message "badly formed pragma" is showed. Anyone knows how can I fix it? Thank you! Afonso. --- In msp430@msp4..., w.sell@c... wrote: > > Humberto, > I also have been going back and forth with IAR and CCE. I settled on IAR as I think its performance is way better than CCE. I set some macros to make this easier. For example: > > #ifdef IAR > #pragma vectorC_VECTOR > #else > __interrupt void ADC_ISR (void); > ADC12_ISR(ADC_ISR) > #endif > > #ifndef IAR > __interrupt void ADC_ISR (void) > #else > __interrupt void ADC12ISR (void) > #endif > { > . > . > . > } > > /Bill > > > > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/CFFolB/TM --------------------------------~-> . Yahoo! Groups Links