On Mon, 25 Apr 2005 10:31:12 -0400, you wrote: >On Mon, 2005-04-25 at 17:15 +1200, 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 need to fully understand the timing constraints of your system, in particular whet is the worst interrupt response time that can be tolerated. e.g. a serial receive int needs to be serviced within one byte time to guarantee no data loss. High-priority ints will always be serviced in a predictable time. Low-priority ints may get delayed if a high-priority one is being serviced at the same time. You only really need to worry about int priority if there is an interrupty that cannot tolerate either the delay, or delay unpredictability of the slowest other interrupt service routine. A good example would be bit-bashed RS232 serial transmit/receive code, where data would be lost if timing jitter exceeds about 5% - a high-priority int would be needed for all but the slowest baudrates if there are any other interrupts possible. A second good reason to use high-priority ints is that the context-save for high-priority ints is much faster, so would be appropriate for very frequently occurring ints to reduce overall CPU loading. Generally, a reasonable approach is to use low-priority ints unless there is a very good reason to do otherwise, and then only have one high-priority one. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist