RTC FOR DEEP SLEEP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTC FOR DEEP SLEEP

694 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tbelo on Tue Feb 17 09:03:56 MST 2015
Hi all,

The pcb has been done but the 40% drift of the WDOsillator varies from mcu to mcu.
I use the wdo as a deep sleep timer to wake-up once a day.

Can anyone suggest an external oscillator to act as a deep-sleep timer intead of the watchdog ?

BR
Theo
Labels (1)
0 Kudos
9 Replies

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tbelo on Sun Mar 22 01:34:02 MST 2015
Hi,
It works like charm

Best regards to all
0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tbelo on Tue Feb 24 13:55:28 MST 2015
Thanks,
I currently work with your example found there:
https://github.com/tacowars/LPC1114-sandbox/blob/master/drivers/timedwakeup/src/main.c

0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Feb 24 13:14:54 MST 2015

Quote: tbelo
If you have a coding sample it will be highly appreciated.



As mentioned in

http://www.lpcware.com/content/forum/lpc11c24-deep-power-down-modes-searches-example

there is a complete  sample in older LPCXpresso versions  :)
0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by 1234567890 on Tue Feb 24 12:52:46 MST 2015
What do you mean with 'active'? Of course there can be just 1 clock active for the core or a peripheral at a time.

UM10398
- e.g. 21.2: The peripheral clock is provided by the system clock // (IRC for CT32Bxin this case).
- 23.2: Peripheral clock: Select the watchdog clock source ...

So 2 different sources clock 2 different counters. Start both counters at the same time, let them run a useful time, stop them together. Or just read the 2 counter values at 2 times where you are sure that there was no overrun.
One clock source (CT32Bx) is well known and accurate (12 MHz, < 1 % error) and you know the counter value.
You also have the other counter value and can now do huge caculations...
0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tbelo on Tue Feb 24 07:19:46 MST 2015
Hi,

Regarding Wouter suggestion, how to compare the 2 different counts ?
I think the suggested logic is as follows:
Capture a timer when clocked by the IRC and at the same time capture another timer clocked by the watchdog oscillator.
The difference is the correction.
But how can I have 2 oscillators active at the same time ?

Am I missing something ?

Best regards
0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tbelo on Tue Feb 17 14:04:06 MST 2015
Thanks Wouter

Pretty meaningfull answer
...but tricky to implement.
I 'll give a try.

If you have a coding sample it will be highly appreciated.

Regards,
0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wouter on Tue Feb 17 12:05:05 MST 2015
Hi Theodore,

As long as the temperature remains more or less constant, you can calibrate the WDT oscillator against the IRC oscillator. So before you enter your power-down mode, you use the IRC to count e.g. 10ms long how many WDT counts you get, so that you know how much off it is, and use that to configure your wake-up time.

If your temperature can change significantly during that time, you could also e.g. divide the sleep time by 10 and re-calibrate the WDT each time you wake-up.

Regards,
Wouter
0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tbelo on Tue Feb 17 10:07:05 MST 2015
The bad thing is that temperature does not affect the same way all MCU's.  i.e I may have drift 3 hours in one mcu and on another 5 minutes.

1/2 hour drift is OK but 3 hours is very bad
0 Kudos

674 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by 1234567890 on Tue Feb 17 09:54:01 MST 2015
When I remember correctly for deep sleep mode there is no external clock source possible.

What's about the temperature and voltage in your application? If they don't change very much you can calibrate (measure) your watchdog oscillator during runtime and compensate the problem.

And if you just want to wake up once a day: How accurate has the time to be?
0 Kudos