RTC run too fast


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Posts
    755

    Default RTC run too fast

    Hi,
    I have PIC18LF46k80, with 32768Hz crystal on SOSC pin. i need 32 interrupts per second for other things.
    Shematic:
    Name:  sch.JPG
Views: 1062
Size:  49.2 KB
    PCB:
    Name:  pcb.JPG
Views: 797
Size:  18.1 KB
    Code:
    ISR:
    DEFINE  INTHAND myint  
    #CONFIG
        CONFIG SOSCSEL = LOW ;Low power mode SOSC
        etc...
    #ENDCONFIG
        TMR1H = 252
        T1CON = %10001101
        T1GCON = 0
    ASM
    myint
            Clrf BSR
            Btfss PIR1,0 
            GOTO End_RTC
            Clrf PIR1
            Movlw .252 ; TMR1H=252
            Movwf TMR1H
    
            Bsf _PULL
    
            Movlw .141
            Movwf T3CON
            Movlw .255
            Movwf TMR3H
            Movlw .223 
            Movwf TMR3L
            Bsf _TimeChanged,0
            Incf _Ticks,F
    
     
            Movlw .31  ;if ticks=32 then
            Cpfsgt _Ticks  
            GOTO End_RTC   
            Incf _Seconds,F
            Bsf _TimeChanged,1 
            Clrf _Ticks
            Movlw .1
    etc...
    Crystal MH32768C datasheet:
    http://www.farnell.com/datasheets/1322434.pdf
    I think that problem is in capacitors for crystal. I upload schematic and pcb layout, it's probably ok, but...
    I tried to put capacitors from 10,12,22pF and result always is same. About 10s to much per day...
    PC clock(Internet time disabled) and mobile phone are my references.
    Any idea how to solve this??
    Thanks
    Last edited by pedja089; - 14th December 2012 at 12:59.

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: RTC run too fast

    Name:  rtc2.jpg
Views: 711
Size:  50.5 KBMaybe this help ?!

  3. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: RTC run too fast

    That is problem.. Because I can't sped few days adjusting cap...
    I remove C6, now clock are much slower... C5 is 22pF...
    I put 12pF on C5, and I will see result tomorrow.
    Is both capacitor needed or just one?
    Last edited by pedja089; - 14th December 2012 at 19:23.

Similar Threads

  1. Setting project RTC without switches
    By ardhuru in forum Bluetooth
    Replies: 6
    Last Post: - 17th October 2012, 14:20
  2. i need modification for this code as fast as possible
    By cool_guy4ever15 in forum Off Topic
    Replies: 8
    Last Post: - 30th June 2009, 01:09
  3. Help! sinking fast!
    By fowardbias in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 31st May 2007, 19:39
  4. Programmer too Fast?
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th February 2007, 09:07
  5. A/D on 16F877. How fast can I go?
    By atomski in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th April 2004, 06:51

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