Tina10
- 2nd July 2012, 10:58
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:
DEFINE OSC 20 ' Added this define
Under Config statement I used
_HS_OSC
I tried the following 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 :)
DEFINE OSC 20 ' Added this define
Under Config statement I used
_HS_OSC
I tried the following 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 :)