pauseus behaviour, 18f2455
Hi,
I'm having a strange problem with inconsistent timing using pauseus. I wrote the following test program:
Code:
define OSC 08
osccon = %01110010
for i = 1 to 10
high statusled
for j = 1 to X
pauseus Y
next j
low statusled
for j = 1 to X
pauseus Y
next j
next i
and tested it, substituting for the following X,Y pairs
1000,5000
2500,2000
5000,1000
10000,500
25000,200
For Y=2000 and above, I get exactly what I expect: an LED flashing
once a second for 10 seconds. For lower parameters to pauseus, however
i get the following results:
1000,5000 -> 10s
2500,2000 -> 10s
5000,1000 -> 5s
10000,500 -> 2.6s
25000,200 -> 1.0s
pauseus is meant to work down to 12 us for my 8mhz clock, according to
the PicBasic manual: can anyone suggest what might be wrong, or what
tests I might run to narrow it down?
Mark
Mea culpa, mea culpa, mea maxima culpa
Thanks, I'll remember that. But the root cause of the problem was forgetting that you can't fit "10000" into a byte. Oops...