Hmmm, I'm not sure Adrian.
I've double checked it here on a 16F88 and I can go up to 12khz with a 20mhz OSC. Or 25khz by changing the Handler's "TYPE" to ASM.
I did find some inaccuracy in the math,
This line ...
TimerReload = MaxCount - ((25000 / Freq) * (OSC*10/Prescaler))
Should be like this...
TimerReload = MaxCount - OSC*1000000/4/Prescaler/Freq
but that shouldn't cause what you've described.
Which PIC are you using?
<br>




Bookmarks