Hi Jerson,
I agree that ISR code isn't necessary or even desirable in this case because of the high resolution required and the ISR context save/restore 'overhead'.
Andrew mentioned in his first post that the pulse width range could be several microseconds up to about one millisecond.
I believe the pulse width resolution for your example would be the loop code 'overhead' plus the 16-bit compare code 'overhead' plus the delay. The 16-bit compare code 'overhead' may well be the biggest limiting factor affecting resolution and the delay may not be necessary. Have you checked to see how many cycles are used for 1 loop cycle in your example Sir?
Regards, Mike
Bookmarks