Hi Alice,
Thanks for the quick reply.
I have an Oscilloscope connected to the port bit. The scope has a handy trigger function of trigger if > n. With a 1ms PIT, I set the trigger to > 1.1ms and see a period that is actually a multiple of 1ms once in awhile.
The only thing in the isr is the toggle LED. I do use PE macros for the I/O bit control.
With almost nothing going on in the main loop, the period of the > 1.1ms event is periodic at around 1 second. There is a software counter in the main loop with a period of about 1 second also. This is all within a while(1) loop. Curious coincidence?
I originally had some A/D reads, print statements and some floating point in the while loop. In this condition the PIT "misses" were quite often. I incrementally commented out code in the while(1) and the miss incidence went down.
If I comment out the entire contents of the while loop except one function call the issue goes away. I suppose that at some point the compiler is optimizing out the entire while loop but I have not dug into this aspect of the question.
I did just realize that I am actually using CW 10.6 and not KDS so I'm thinking this might be an issue in sending you the project or even having posted the question here?
Regards
Larry