Jose Da Silva wrote: > On April 24, 2005 10:15 pm, Hopkins wrote: >> In the 18F series there are High & Low priority interrupts. >> >> This may seem a bit silly :-) but when should you use each type of >> interrupt? > You would use a low priority on a slow device, for example, a keyboard > interrupt. The keyboard can wait another couple milliseconds while you > service something which needs immediate attention. In addition to the emergency type examples Jose cited, I'd add anything where low jitter is important. Using the keyboard interrupt as an example, you can safely ignore a few ms jitter on such an interrupt. But you can't ignore a few ms jitter on an async rx/tx interrupt that implements firmware communication, or when sampling data for a FFT or some such. Whether you actually need the two levels depends a lot on your overall application design. If your application has a quick main loop, your interrupts don't do much besides caching byte data and flipping bits and most of the work is done in the main loop, you probably won't need the two levels. The lower level is mainly meant for interrupt-driven actions that may take a while and therefore may have to be interrupted by the "real" interrupts (which would be the high-priority interrupts). You can think of the lower level interrupts as an additional application level between the main loop (which they can interrupt) and what you put into interrupts (which would be the high-priority interrupts). Or you can think of the low-priority interrupts as your normal interrupt level, and put a select few of those interrupts (the extremely time-critical, maybe the ones where you had jitter problems so far) into the high-priority level. Whether this brings real advantage depends a lot on the application. Probably low-power applications (with generally low clock speeds relative to the requirements) are among those that can make good use of this feature. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist