cancel
Showing results for 
Search instead for 
Did you mean: 

interrupts with ST72F

vianney
Associate II
Posted on July 04, 2003 at 04:40

interrupts with ST72F

4 REPLIES 4
vianney
Associate II
Posted on July 03, 2003 at 11:07

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.

Junior
itsmejatinus
Associate II
Posted on July 03, 2003 at 11:53

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 interrupts
vianney
Associate II
Posted on July 03, 2003 at 13:21

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?

Junior
shreya
Associate II
Posted on July 04, 2003 at 04:40

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.