High Speed Oscillator question


Results 1 to 3 of 3

Threaded View

  1. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: High Speed Oscillator question

    Quote Originally Posted by Tina10 View Post
    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
    Code:
    _HS_OSC
    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.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts