Hi, Bill

1) why not try to place your delay comp. just BEFORE the loop ??? ( could help for debugging too ... )

2) you can assign your variables banking ... see $ 7.3



Now, 16µS @ 20 MHz is ~ 60-80 assembler lines ... that make a lot of bank switchings ... if it is bank switching.

What's your processor ???

Alain