OSCTUNE and 12F683


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    If you set INTOSC instead of INTOSCIO, you should get Fosc/4 on the OSC2 pin, which in your case, you should get 32.8khz. Hope you've got a tight freq counter or a good o'scope!
    Thanks for the suggestions. I don't know why I can't find what I need in the 12F683 data sheet but (as I'm sure you've noticed), Microchip's data sheets aren't always as user-friendly as they perhaps could be.

    And I've got both a good (but old) frequency counter (Hewlett-Packard 5300B that last calibrated at 200 ppb) and of course I've got a scope . . . three, right now. (Although my venerable Philips PM3266 is a dinosaur.)

    Interestingly, I intend to use that 32.8 kHz coming out. Although I can probably make do with anything between 32 and 34 kHz, so the tuning may not be as fussy as I am.

    Again, thanks.
    Last edited by RussMartin; - 15th December 2008 at 06:31.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by RussMartin View Post
    Interestingly, I intend to use that 32.8 kHz coming out. Although I can probably make do with anything between 32 and 34 kHz, so the tuning may not be as fussy as I am.
    It might be more accurate to run the PIC as fast as you can (8Mhz on the internal) and write a blinky LED to give you ~32khz on a single pin.
    Code:
    main: led (whatever pin) = 1
    pauseus 29
    led = 0
    pauseus 28
    goto main
    1 cycle for each LED=x statement, 2 cycles for goto, 57 cycles for each pause = 61 cycles total.
    8Mhz / 4 = 2 MIPS / 61 cycles = 32,768 Hz.
    Then, between changing the pauseus values, and tweaking OSCTUNE, you should get dead-on exactly what you really want.

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