With the code above. The code on the while(1) block is executed in parallel with the timer1 code block? some asyncronous relation or while routines in the timer1 block are executing, the code in the main 'while' loop waits till it ends?
I'm a little confused about it. Can anyone help me?
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
Posted: Sun Aug 12, 2007 11:56 pm
The 16F877A is in the infinite loop while(1). It will stay there forever however periodically the timer will generate an interrupt. When the interrupt occurs the 16F877A suspends the while(1) operation saving its state and then executes the timer1 interrupt service routine at the end of the execution of the interrupt service routine the while(1) state of the 16F877A is restored and the infinite loop continues until the next timer interrupt. It is not truly parallel it is just normal serial operations of the PIC are suspended when the interrupt occurs and resumed after the service routine is done. There is a measure of parallelism in the hardware since the hardware of the 16F877A can both execute the program instructions and at the same time operate the timer and its interrupt.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum