Overclock RTC?


Closed Thread
Results 1 to 7 of 7

Thread: Overclock RTC?

  1. #1
    Join Date
    Sep 2009
    Location
    South Wales (UK)
    Posts
    62

    Default Overclock RTC?

    Hi all,

    I have some circuits that are professionally made using an 18F26J53. I cannot remove the 32 KHz clock that is at the timer1 input pins. The chip's primary oscillator is a 16 MHz crystal. I was wondering if it is possible to 'overclock' the RTC? I want to test some code to see if the unit behaves itself over a period of months (it has various tasks to do every day and at the end of a period of weeks/months) and I'd prefer to not have to wait months to test the routine only to find it fails on the last day!

    Essentially, is there a way to 'up the pulse rate' from the internal oscillator that the RTC unit sees so that an hour can be compressed for instance into 1 second or something relatively rapid?

    I've had a nose through the datasheet (RTC section and the Oscillator config section mainly) but can't be sure if this is possible, as it's not something that would normally be done. If it comes to it, I could sacrifice a semi-'duff' board and connect up another crystal in place of the 32 KHz but thought that would be messy - by software is the preferred method...

    Any hints/tips on this issue would be gratefully received.

    Best wishes for Christmas and the New Year to all out there!

    Jimbo Stlawrence

    Cheers

    Mark

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Overclock RTC?

    Hi,
    As far as I can see the RTC can be clocked either by the TMR1 Oscillator using a 32.768kHz crystal OR from the internal low power RC-oscillator. I don't think there's a way to drive the RTC module from the "normal" internal oscillator because then the RTC would shut down when the PIC enters low power mode since the oscillator is shut down. And, in the datasheet, below table 31-16 it says: The Timer1 oscillator is designed to drive 32.768 kHz crystals. When T1CKI is used as a digital input, frequencies up to 12 MHz are supported. So I don't think reworking a board to replace the 32kHz crsytal with something else is going to work either....

    The only thing *I* can currently come up with is the include some test-code in the firmware that basically advances the clock by 59 min 58 seconds after each "1-hour task" and so on. Obviously, doing so may introduce OTHER bugs but what you're going to do?

    /Henrik.

  3. #3
    Join Date
    Sep 2009
    Location
    South Wales (UK)
    Posts
    62


    Did you find this post helpful? Yes | No

    Default Re: Overclock RTC?

    Hi Henrik,

    Thanks for having a think. I have already used code to jump the clock to critical time points (just before a sleep routine/wake-up routine), but it's never a true substitute for actually "running the clock/system the way it has to be run in the code". I have had a suggestion to try a remote control 455 kHz resonator; will see what I can come up with. Maybe sacrifice a slightly duff board for the cause to test the sleep routines. Didn't want to have to solder/savage a board but if that is what needs to be done I'll give it a shot.

    Kind regards

    Jimbo

  4. #4
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Overclock RTC?

    I should think that the hardware, "messy", means would be preferred (I mean except for the effort and expense). In this way you can run and develop software that will be, line for line, transferable to the accurately timed board - any artifacts between software versions are eliminated. Indeed, I can think of no better way to verify the operation of the "final" version of software than running it unmodified on high-speed hardware.


    Just a thought...

    Amoque

    Merry Christmas, all!

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Overclock RTC?

    Hi,
    I agree, doing it in hardware would be preffered it's just that (if I'm not mistaken of course) the hardware doesn't support doing that.
    The TMR1 oscillator is designed to operate at 32.768kHz, overcklocking it to some faster frequency is operating it outside its specification. If a problem pops up is it due to the code or to the oscillator being run outside its spec?

    On the other hand, if it does work then at least you should have no problems running it at the correct frequency. Only one way to find out, try it and tell us how it went!

    /Henrik.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Overclock RTC?

    The Timer1 oscillator may only work with 32.768kHz, but T1CKI can take up to 12Mhz (according to post #2)

    Remove the crystal, and use another PIC to inject whatever frequency you want.
    DT

  7. #7
    Join Date
    Sep 2009
    Location
    South Wales (UK)
    Posts
    62


    Did you find this post helpful? Yes | No

    Default Re: Overclock RTC?

    Many thanks all. I'll give it a shot when I return to work and see how I get on with this.

    Will let you know my findings. I know how important it is to post any resolutions on forums...

    Kind regards and merry Christmas to all!

    -Jimbo-

Similar Threads

  1. Latest RTC
    By Fred in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th November 2008, 14:34
  2. Rtc Revisted
    By jcleaver in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th March 2007, 04:50
  3. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07
  4. X1226 RTC - Help
    By charudatt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th August 2006, 17:54
  5. Rtc
    By sonic in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th May 2004, 05:39

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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