pic & interrupt

Sep 27, 2003 1 Replies

Come faccio a gestire gli interrupt? Uso MPLAB e programmo in C.



Ho scritto questo, ma come faccio ad assegnare una routine di interrupt a uno specifico interrupt (Ad esempio quando la seriale riceve un dato):



#pragma interrupt ricezione_isr save = PRODL,PRODH // Locate ISR handler code at interrupt vector #pragma code isrcode=0x0008 void isrhandler(void) // This function directs execution to the { // actual interrupt code _asm goto ricezione_isr _endasm } #pragma code



Grazie,



Igor.


Il Sat, 27 Sep 2003 07:16:54 GMT, "Igor" ha scritto:

semplicemente dopo che sei entrato nella interrupt service routine controlli i bit di flag degli interrupt, ed in funzione di quale e' settato salti ad una specifica funzione che ti gestisce quell'interrupt... ciao

-- Saluti Paolo Squaratti "Speak softly and carry a big stick: you will go far..." - Theodore Roosevelt

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required