PIC running way too slow ?

Started by holopoint.rm July 29, 2003
I have a PIC18F452 with a 20mhz crystal.
I setup timer0 interrupt with a DIV multiplier of 256
20,000,000/4/256/256 = 76 interrputs per second.
I flip the state of a led each interrupt.
from the led blink rate I can see that the interrupt is
called once every 3 seconds or so.

Like, What the **** ?
Is my pic running 100 times slower than it should ?
My delay functions are working perfectly.

Anyone can think of a good way to test if the pic
is running at the correct speed , without a scope ?
(speaking of scopes, I've seen some software scopes
for the PC, are they any good ?)

Help.
Thanks,
Shachar Weis.



 
Powering that LED 76 times a second should just give the appearence of always being on, maybe somewhat dim. I am sure you know that, maybe you have your oscillator setup wrong? or perhaps (well not likely but) a long initialization and then your WDT is resetting the uC
 
Charles
 
-----Original Message-----
From: holopoint.rm [mailto:h...@rocketmail.com]
Sent: Tuesday, July 29, 2003 12:20 AM
To: p...@yahoogroups.com
Subject: [piclist] PIC running way too slow ?

I have a PIC18F452 with a 20mhz crystal.
I setup timer0 interrupt with a DIV multiplier of 256
20,000,000/4/256/256 = 76 interrputs per second.
I flip the state of a led each interrupt.
from the led blink rate I can see that the interrupt is
called once every 3 seconds or so.

Like, What the **** ?
Is my pic running 100 times slower than it should ?
My delay functions are working perfectly.

Anyone can think of a good way to test if the pic
is running at the correct speed , without a scope ?
(speaking of scopes, I've seen some software scopes
for the PC, are they any good ?)

Help.
Thanks,
Shachar Weis.



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

">Yahoo! Terms of Service.