Josh Koffman wrote: > On INT0 I have a sensor that is producing and interrupt about every > 1/12s (0.083s). Or 83 ms as a real engineer would say. > Once I connect up the sensor, I find that INT2 doesn't > consistently set the flag anymore. It's rather hard to believe the hardware isn't setting INT2IF. Instead of invoking strange gremlins in the PIC, think about what in your firmware could cause this symptom. Could something be resetting the flag? Could th= e flag be getting set but the code not looking at it or getting to it? > The sensor is dealt with in the ISR > and triggers a burst of data out the UART. Is this UART data sent from the INT0 interrupt? If so, then it would be spinning on the UART ready in the interrupt routine, which is not a good idea. Usually it's best to handle the immediate hardware issue in the interrupt routine, then leave state around so that the foreground code can do more time consuming but less latency-sensitive processing later. It sounds like sending this burst of data over the UART falls into the latter catagory. Are you really sure the INT0 interrupt routine properly saves/restores all state it trashes, including any FSR registers? Again, it sounds like you'r= e trying to do too much in the interrupt, which also leaves more possibility of trashed state or calling a common routine that is not really re-entrant. Since you're on a PIC 18, how about using the high priority interrupt for INT0 and the low priority for INT2? Why is INT0 so high priority if it's s= o slow (83ms) and is going to do something slow like send data over the UART? It sounds like INT2 is actually your higher priority. > Instead of polling, I've > tried dealing with it in the ISR. So now "it" is back to being INT2, not INT0? ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .