question about pic16f877a and 32.768khz crystal


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    25

    Default question about pic16f877a and 32.768khz crystal

    hii all ,

    how can i connect 32.768khz crystal to pic16f877a and write the code with

    picbasic pro . i want to make a binary clock so if i used the 4mhz external osc

    it will not be accurate enough (15 min per day) .

    so can i reduce this by any idea (code or hardware) ?

    thanks for help .

    regards .

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The Timer1 Section (Section 6) of the Datasheet explains how to do this by connecting the 32kHz xtal to RC0 and RC1 and setting T1OSCEN. Your timekeeping for the Clock will then be by using Timer1 whilst the rest of your program will still be running at 4MHz (or whatever you have).

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Wink

    Hi, Amenorea

    Elektor Magazine has published a Binary clock project, some years ago ...

    http://www.elektor.com/magazines/200...ck.58374.lynkx

    Asm source available ... Programmed processor and PCB too.

    But no sleepless nights debugging a tremendous PBP soft ...

    Good level Explanations though ...

    To get better accuracy, you simply can place fixed + trimmable capacitors on one side of the Xtal ( OSC in side for Gross trim, Osc out side for fine tuning ...)

    Whether the choosen OSC ...

    OR MUCH BETTER ... use a DCF77 ( or equ.) module to reload absolute time @ regular intervals ...

    Alain
    Last edited by Acetronics2; - 17th October 2009 at 10:45.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 1

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