Re: High Speed Oscillator question

Originally Posted by
Tina10
I never went beyond 4MHz before but want to find out about using the 20MHz Oscillator. I have few questions as they way I did it did not produced accurate results while simulating on proteus. I did the following:
Code:
DEFINE OSC 20 ' Added this define
Under Config statement I used
I tried the following code:
Code:
Main:
Toggle LED
Pause 1000
Goto Main
My LED did not blinked @ 1 sec interval but was a bit slower.
--------------------------------------------------------------
I also tried the similar settings with 8 MHz oscillator (I used _XT_OSC in Config this time & DEFINE OSC 8) and found out that my LED again was slightly slower than 1 Sec. So my question is-:
A) Is there something I am missing to get timings right
B) Just want to confirm that once DEFINE is added correctly, all pause statements and serial commands using baud rates are written as normal as the PIC automatically adjusts the timing.
Thanks

Everything Heinrick posted is right, your code should be on for 1 second and off for 1 second (2 second cycle).The chip you use may have OSCON or other way to adjust the osc. PS always use HS_OSC if using 3 term resonators at any speed . . .
Last edited by Archangel; - 9th July 2012 at 10:32.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks