Clock speed error 18LF2520

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
Can someone put this through the Oshonsoft SIM, please. I can't get the Start up LEDs to flash at 1 sec ON/OFF.
Thanks.
Camerart
 

Attachments

  • 18LF2520 INT4MHz SIMPLE SERVO LOOP 160618 1700.bas
    1.4 KB · Views: 238
Correct!! I get 3.972 seconds... Something is amiss... I'll take a look see.
 
Okay... Swapping OSC = HS to OSC = XT brings it back to 1 second..
 
Hi,
Can someone put this through the Oshonsoft SIM, please. I can't get the Start up LEDs to flash at 1 sec ON/OFF.
Thanks.
Camerart
If you are using the internal oscillator, then you have to set the frequency to 4Mhz in OSCCON register.
Define clock_frequency = 4 only tells the compiler what the frequency is to be used in waitus, waitms delays, not to set it.
 
No... You need to set it to internal clock... Can't remember the setting!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…