Jan-Erik wrote: > And if so, Lawrence method should be safe even from an > RBIF standpoint (I still don't understand what the problem > would be...). > >> Jan-Erik gave a very good treatise on why any operation on >> the port affects the RBIF flag, which did answer the original >> question. About the only thing he did not point out is that >>this "bug" (or "feature", depending on how you look at it) >> limits the usefulness of the Interrupt on Port Change >> feature unless very careful coding practices are used. > > I'm not that sure... > Any read from PORTB with clear the *condition* that set > RBIF in the first place. It will not clear RBIF as such and the > interrupt will still fire. I'm not sure either, but it seems to me that there might be a chance for a missed interrupt in the case that the input changes after Q1 (when the port input latch gets updated) but before Q3 (when the port change detection latch gets updated). Whether such a change sets RBIF depends on the synchronization of the setting of RBIF, for which I didn't find any documentation. I don't use the RBIF interrupt a lot; I'm trusting the advice that it's not safe unless you don't read port B at all (outside of the change detection mechanism). Gerhard _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist