I have corrected your logic: On 3 July 2013 06:25, Electronic Consultation < electronic.consultation.au@gmail.com> wrote: > I want to have a second interrupt, it's allright if it's not exactly 1 s > > Init > while forever: > State 1 > led on > // -- replace this: counter to 100 ( tick from background on timer) check if counter is equal or greater than 100 if yes clear counter and switch to State 2 > // -- replace this: return > continue to the beginning of the while loop > State 2 > led off > // -- replace this: counter to 100 ( tick from background on timer) > check if counter is equal or greater than 100 if yes clear counter and switch to State 1 > // -- replace this: goto state1 > continue to the beginning of the while loop > // -- remove this as you have an infinite loop: return > In the meanwhile, in your free running Interrupt Handler: if counter is less than 255 then increment counter Tamas --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .