Richard R. Pope wrote 2014-07-19 21:26: > Jan-Erik, > Do I put the interrupt routine in side main()... Did I do that in my example? Maybe you did not see that post from me before writing *this* post? I'll post (part of) the same code example again: ------------------------------------------------ void interrupt myint (void) { .... return; } void init(void){ .... return; } void main(void) { init(); ei(); while (1) {} } ------------------------------------------------ main() calls init() where everything is setup including the bits and pieces that initiate the interrupts. myint() (you might give it any name) is then automaticly called by the interrupt hardware when needed. > and then put the > while() inside the interrupt routine, inside the while loop or inside > the for loop? I do not understand that. What "while()"? The "while(1)" in *my* example is just to get the code to "do nothing" or "spinn" until an interrupt happens. Usualy you have you main() doing something also. I haven't had time to read 5.9.x yet... Since you already have the PDF file available (right?) it's a matter of seconds to open it in the reader and jump to the rellevant chapter. Takes less time then writing a post here. :-) Jan-Erik. --=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 .