piclist 2001\01\02\095352a >
Thread: help please on correct Multiple Interupt handling,
www.piclist.com/techref/microchip/devices.htm?key=pic
face picon face BY : Olin Lathrop email (remove spam text)



> I am trying to test multiple interupts (T0IF BRIF and INTF)
> I need to=20
>                     btfss    INTCON,TOIF
>                     goto     test_next          ;THIS Doesn't seem very =
> elegant!
>                     goto     toifint                ;handle toif int
> test_next      btfss    INTCON,BRIF    ;test for next
>
> is there a more elegant way?

Yes:

   btfsc  intcon, t0if
   goto   toifint
   btfsc  intcon, ...
   goto   ...

> Also after handling (say)toif and clearing toiFlag
> should I jump back and continue testing flags or just RETFIE and if =
> multiple flags were set
> is it ok to then just re-enter as a new inturupt as the other flag would =
> cause it re interupt?

I usually do the latter.  You give up a little efficiency if the two
interrupts happen to come together, but you don't waste cycles every time
when they don't.  It's also just a little less complex, and therefore
maintainable, which is usually more important that a few cycles anyway.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, .....olin.....spamEraseMEembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


<001101c074cb$2c302630$260bf6cd@pc> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) help please on correct Multiple Interupt handling,

month overview.

new search...