I am perhaps going at this in the wrong way. It is a watering system and=20 I need delays in the range of 10's of minutes up to many hours. The chip is a 16F887 and for the delays I use=20 the HI-TEC C __delay_ms() macro. This macro can handle delays up to about 50 seconds and I use a loop=20 with it to get the necessary total delay. I would like to be able to interrupt via RS323 and change the parameters=20 for the watering. The precision of the timing is not important. I am afraid that my experience with PIC is very limited and my last=20 programming in C was many years ago. Goran On 2012-04-21 14:28, alan.b.pearce@stfc.ac.uk wrote: >> A better way to do that would be to have a flag (a binary semaphore in >> concurrent processing nomenclature) which is set by the interrupt when >> the jump should be performed. The delay loop (which is by nature >> executing instructions continuously) can poll the flag and execute the >> GOTO from the main code. Since testing for a flag can be done in a >> fixed number of cycles (two for a BTFSS) the timing delay can be >> adjusted to accommodate the extra instructions. > I agree - in fact it sounds like the OP should be using a state machine i= n the code where delays are being used, and look to the interrupt to notify= a change of state, unless the delay times out giving a different change of= state. > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .