Well, I was going to go through your code and verify your Timer settings, but not knowing what chip you are using that makes it kinda difficult.
So, 'assuming' you are genuinely running at 20MHz (this now depends on your OSC and Configuration setting for your chosen PIC - and if you don't get that correct then everything is screwed thereafter...)...
I tick = 200nS (FOsc/4), so an empty 16-bit Timer will execute in 65536 x 200nS = 13.1mS then multiplied by any scalers you have previously enabled.
If you think your PIC speed is running oddly, then a simple blinky with PAUSE 10000 and your wristwatch should verify that your speed settings (which includes the DEFINE OSC 20) are all correct give or take.




Bookmarks