Zhaoyue Wang wrote : > My question is if ccp capture external signal and at the same > time timer1 timeout, then both interrupt flag > will be set, Yes. > or the TMR1IF is set earlier or else? Might be set earlier or later, that depends on *when* the two interrupt happens, but TMR1IF will not prevent any other xxxxIF flagt be set. There are no cross-dependences between the xxxxIF flags. Just remember to check *which* xxxxIF got you into the ISR !! And at the end of your ISR, *only* clear the IF that you have just served! I have seen ISR's that, at the end, cleared multiple IF flags, and then missed any interrupt (other then the currently served) that had fired during the current execution of the ISR... Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist