Repost with correct tag. I am running a controller on an 18F452. I am using a 4Mhz clock, with a 32Khz crystal on timer1. The controller is battery operated, and sleeps when not in use. The clock is maintained by timer1 waking the unit up and updating. My problem is that I have several high priority tasks that need to be serviced regularly in relatively short time frames. For example, several times per second, several sensors need to be read and the results acted upon. Also the lcd display needs to be updated, and I need to respond to buttons. These tasks are not very long, but so far, I am just checking whether they need to be run in the timer1 isr, and then running them as required in the mainline. I have now added a task that takes several seconds to run. Worse, the time it takes to run depends on external conditions. Sometimes it will take one second, and sometimes it will take 15 seconds. There is also another long task, but not as long. It is run before the longer task. My current thoughts are to run the clock by itself on timer1 as a high priority interrupt. The buttons would also be on high priority interrupts. Then the other short tasks would be on another timer at a lower priority. The whole task would run in the isr. I would then have two long tasks run one after another in the mainline. Is this the right way to do this. Bruce Partridge --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.543 / Virus Database: 337 - Release Date: 11/21/2003 -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics