• AVR Freaks

Helpful ReplyHot!RTCC with multiple clock source

Author
soleil_sword
Starting Member
  • Total Posts : 47
  • Reward points : 0
  • Joined: 2009/03/12 14:03:59
  • Location: 0
  • Status: offline
2019/07/16 20:07:49 (permalink)
0

RTCC with multiple clock source

I'm trying to use RTCC module from PIC24FJ64GA702.
At the moment I'm using LPRC and I successfully obtained the RTCC, nevertheless, experienced user of RTCC might have known that LPRC isn't the most accurate! Indeed, while running a test for 12 hours, the RTCC is giving an error of 40 minutes.
 
SO I'm trying to switch to a more accurate external clock source. At the moment I'm using an accurate 10 MHz external oscilator. One of the major requirement of the system is power consumption, and I have tried my best to lower current to ~ 4 uA during sleep mode. After enabling primary oscillator in sleep mode to have accurate reading of RTCC, the current increased to about 400 uA, so it seems this is not a solution either. 
 
My MCU has used up all the pins and therefore I can't attach an external secondary clock to the system, this solution seems excluded from the options too.
 
Could anyone please give me some suggestions how am I going to have an accurate RTCC, say I can accept a few seconds of error a day, while maintaining the low power operation of my systems?
 
thanks a lot!
#1
du00000001
Just Some Member
  • Total Posts : 2887
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: online
Re: RTCC with multiple clock source 2019/07/17 01:07:10 (permalink) ☄ Helpfulby soleil_sword 2019/07/17 10:14:07
0
This is the perfect application for the secondary oscillator and a 32 kHz quartz.
What did you think (until now) where all these 32 kHz quartzes are going to? RTCCs!
 
Maybe you can get some very low-power external 32 kHz oscillator...

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#2
ric
Super Member
  • Total Posts : 23185
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: RTCC with multiple clock source 2019/07/17 06:36:55 (permalink) ☄ Helpfulby soleil_sword 2019/07/17 10:14:13
5 (1)
soleil_sword
My MCU has used up all the pins and therefore I can't attach an external secondary clock to the system, this solution seems excluded from the options too.

You're screwed then, because that is how you do it.
Try a bit harder to free up a pair of pins.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#3
mbrowning
Just a Member
  • Total Posts : 1455
  • Reward points : 0
  • Joined: 2005/03/16 14:32:56
  • Location: Melbourne, FL
  • Status: offline
Re: RTCC with multiple clock source 2019/07/17 07:50:26 (permalink) ☄ Helpfulby soleil_sword 2019/07/17 10:14:31
0
Try a bit harder to free up a pair of pins.

Or, if you already have an I2C interface implemented on a couple of pins, use an external RTCC chip with watch crystal. They are cheap and very low power - I've measured 0.25uA (3V) on an old NXP (Nexperia?) part.

Oh well - there's always next year
#4
soleil_sword
Starting Member
  • Total Posts : 47
  • Reward points : 0
  • Joined: 2009/03/12 14:03:59
  • Location: 0
  • Status: offline
Re: RTCC with multiple clock source 2019/07/17 10:20:42 (permalink)
0
thanks for your guys suggestions, that makes a lot of sense.
I've squeezed in order to fit all the functionalities to my pins, I don't think i will easily have a pair of free pins.
 
external I2C device is definitely a way to go, but at this stage I'm not willing to add another device to the system which means rerouting the device, but I'm definitely thinking about adding this sort of device to next iteration.
 
Are you guys aware of any soft technique to tackle my issue? E.g. I have a temperature sensor integrated in my system. Is it possible to somehow calibrate my LPRC, so another way of putting my question would be: is this error from the LPRC consistent with the aid of temperature sensor?
 
thanks a lot!
#5
du00000001
Just Some Member
  • Total Posts : 2887
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: online
Re: RTCC with multiple clock source 2019/07/17 10:39:31 (permalink)
0
A coarse re-calculation of your LPRC's error gives a 5 % figure.
Basically you could check the LPRC's error when the high-speed oscillator is on and take this error into account.
 
Regarding some temperature-dependency: not sure about that. 
Rationale: the latest FRC oscillators are 1 % and better - over the whole temperature range. This doesn't give a lot of space for temperature-dependencies.
 
Best to test this under some temperature extremes (e.g. around 0 °C in the fridge, then at some raised temperature in/on some oven).

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#6
NKurzman
A Guy on the Net
  • Total Posts : 17599
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: RTCC with multiple clock source 2019/07/17 11:15:47 (permalink)
0
You did not specify what accuracy you want from your RTC. If you are looking something like a minute a month, the 32khz crystal is really your only choice. The FRC and main crystal are no where near accurate enough.
#7
Jump to:
© 2019 APG vNext Commercial Version 4.5