When you enter the Loop1 routine you sit at the WHILE-WEND loop waiting for a pulse. When a pulse comes along you run thru the rest of the routine and finally pull PortB.0 low....then what happens?
There's no GOTO or END or anything after the Loop1 routine so the program will continue and continue and continue thru the (empty) codespace untill it reaches the end, then it'll wrap around and start over at the beginning and what happens there? Yep - you reset the count (i = 0) ;-)
By the way, you're now incrementing and displaying the i variable and not the TMR0 count but I guess that's intentional for now?
/Henrik.
Bookmarks