2003-07-03 07:40 PM
2003-07-03 02:07 AM
Hi,
I'm using ST72F521, I use metrowerks compiler and I am working on interrupts management. I saw on ST7 datasheet that the dedicated interrupt instruction set was given on page 37. Has someone got the the equivalent of theese instructions in C language, please? I would appreciate if someone would be able to give me a sample of code please. Thanks you for answering. Best regards. Junior2003-07-03 02:53 AM
For Hiware Compiler use
asm RIM; // To enable interrupts asm SIM; // To disable interrupts For Cosmic Compiler use _asm(''RIM''); // To enable interrupts _asm(''SIM''); // To disable interrupts2003-07-03 04:21 AM
Thank you!!
So it means that if I put the instruction ''asm RIM;'' in the main function of my program and if I add a function like : '' interrupt void main_interrupt(void) {.... }'' The instruction in this function will be executed if an interrupt occurs? Junior2003-07-03 07:40 PM
Don't forget that
1) for HIWARE you need to use the #pragma TRAP_PROC 2) for COSMIC you need to use @interrupt directives. Refer your Compiler documentation for more details.