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



>I am trying to test multiple interupts (T0IF BRIF and INTF)
>I need to
>                     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

I never really heard of the computed goto used for interrupt polling.  I
suppose it would be useful if you wanted to go to different routines
depending on multiple flag bits set each time.  If you want to poll for one
single flag bit, though, your way is fine, with one exception:

btfsc INTCON, T0IF  ;  Note that this uses a ZERO, not an "O" in the flag
goto t0ifint
btfsc INTCON, RBIF
goto rbint
etc...

Don't create a label just to test the next bit.  Skip over the goto if the
bit is clear rather than checking for it being set.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

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


<F180gXLsxpTljBOh8s40000b557@hotmail.com>

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...