Wake-up timer

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

Wake-up timer

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ezharkov on Fri Nov 14 14:10:54 MST 2014
From UM10360 v3.1: "Once a clock is detected, the Wake-up Timer counts a fixed number of clocks (4,096), then sets the flag (OSCSTAT bit in the SCS register) that indicates that the main oscillator is ready for use." What clocks is that? The main oscillator clocks? Or internal RC clocks? I'm timing the wait-for-OSCSTAT loop. I takes ~570 IRC clocks for my 12MHz crystal.
Labels (1)
0 Kudos
2 Replies

480 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ezharkov on Sat Nov 15 17:05:50 MST 2014
Thanks Paul. Your reply made me to review my calculations. I think I understand what the problem was. I was trying to measure the startup time of the main oscillator (at the initial power-up; no deep sleep or power downs are involved (yet)). 4096 cycles for a 12 MHz crystal should take ~341 microseconds. But I was seeing significantly shorter times. Or so I thought. I was using one of the timers for that, but forgot that upon reset timers run at CCLK/4 by default. Therefore, my 570 IRC cycles are really 570 microseconds (and not 570/4 as I thought). Therefore, everything seems to make sense now. (I assume that the difference, 570-341=229 microseconds, is the oscillator start time (i.e., time before the first cycle))

Thanks,
Eugene
0 Kudos

480 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Sat Nov 15 16:17:31 MST 2014
The 4096 clocks is referring to the main oscillator clock, assuming this is the clock that is used before entering power-down mode.  Note that power-down mode is the same as deep sleep mode, except that it turns off flash memory.  The deep sleep description has better details of the wake-up timer:

On the wake-up of Deep Sleep mode, if the IRC was used before entering Deep Sleep
mode, a 2-bit IRC timer starts counting and the code execution and peripherals activities
will resume after the timer expires (4 cycles). If the main external oscillator was used, the
12-bit main oscillator timer starts counting and the code execution will resume when the
timer expires (4096 cycles).

Hopefully this helps.

- Paul
0 Kudos