----- Original Message ----- From: "Bob Blick" To: Sent: Monday, July 14, 2003 11:18 PM Subject: Re: [PIC]: Multiple interrupt sources "style" > On 14 Jul 2003 at 21:42, Bob Ammerman wrote: > > You should only have to check the CCP2IF in your interrupt handler. > Except the inputs are from a transducer and there will be stray interrupts - I only want > to capture when I have sent a signal and wait for the return. > > > Simply clear CCP2IE and CCP2IF in your mainline code when you don't want to > > use the capture. > But that won't prevent CCP2IF from being set if an external event occurs, and there > are other interrupt sources (timer, for example) so I really need to prevent CCP2IF > from being set. So I really think I need to disable capture completely. Oh, now I see what you mean.... In interrupt handler: only check CCP2IF To turn off capture: Disable capture Clear CCP2IF To turn on capture: Enable capture mode desired. Note: You can leave CCP2IE on all the time, I expect. > > > To reenable capturing set CCP2IF > This is probably a typo and you meant CCP2IE. Sure was :-( > Thanks, > > Bob Bob Ammerman RAm Systems -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu