AD5940
Data Sheet
SLEEP AND WAKE-UP TIMER
SLEEP AND WAKE-UP TIMER FEATURES
CONFIGURING A DEFINED SEQUENCE ORDER
The AD5940 integrates a 20-bit sleep and wake-up timer. The
sleep and wake-up timer provides automated control of the
sequencer and can run up to eight sequences sequentially in any
order from SEQ0 to SEQ3. The timer is clocked from the
internal 32 kHz oscillator clock source.
The sleep and wake-up timer provides a feature that allows a
specific order of sequences to execute periodically. The order in
which the sequences are executed is defined in the SEQORDER
register. There are eight available slots in this register, from A to
H. Each slot can be configured with any one of the four
sequences. Figure 47 shows an example of this feature. There are
three defined sequences executed, SEQ1, SEQ2, and SEQ3, as
shown in Figure 47.
SEQ0SLEEPx
SEQ1SLEEPx
SEQ2SLEEPx
SEQ3SLEEPx
To configure the AD5940 to implement this sequence order,
implement the following register settings:
20-BIT DOWN
COUNTER
INTERNAL
32kHz OSC
WAKE UP
1. SEQORDER, Bit SEQA = 0 (SEQ0)
2. SEQORDER, Bit SEQB = 2 (SEQ1)
3. SEQORDER, Bit SEQC = 3 (SEQ2)
4. SEQORDER, Bit SEQD = 4 (SEQ3)
5. CON, Bit ENDSEQ = 3 (end on sequence D)
SEQ0WUPx
SEQ1WUPx
SEQ3WUPx
HIBERNATE
SEQ2WUPx
ORDER OF SEQUENCES
REPEAT
Figure 45. Sleep and Wake-Up Timer Block Diagram
SEQ0
A
SEQ1
B
SEQ2
C
SEQ3
D
SEQ1
A
SEQ2
B
SEQ3
C
SLEEP AND WAKE-UP TIMER OVERVIEW
The sleep and wake-up timer block consists of a 20-bit timer
that counts down. The source clock is the 32 kHz, internal, low
frequency oscillator.
Figure 47. Sequence Order Diagram
RECOMMENDED SLEEP AND WAKE-UP TIMER
OPERATION
SEQUENCE EXECUTION
Analog Devices recommends the following procedure when
using the sleep and wake-up timer to optimize performance and
power consumption:
HIBERNATE
MODE
HIBERNATE
MODE
ACTIVE MODE
1. Disable the timer sleep function by setting PWRMOD,
Bit 2 to 0. The sleep wake-up timer does not put the device
into hibernate mode. Instead, place the device in sleep
mode by writing to the SEQTRG register at the end of the
sequence. This sleep mode optimizes power consumption.
2. Enable the timer wakeup function by setting TMRCON,
Bit 0 to 1.
3. Enable the sequencer to trigger sleep by setting PWRMOD,
Bit 3 to 1 and the SEQSLPLOCK register to 0xA47E5.
4. Set the final sequence in CON, Bits[3:1]. If only one
sequence is used, select that sequence.
SEQxWUPx
TIME ELAPSES
SEQxSLEEPx
TIME ELAPSES
PWRMOD[3]
SEQSLPEN = 1. AUTO SLEEP
BY SEQUENCER COMMAND
Figure 46. Sleep and Wake-Up Timing Diagram
When the timer elapses, the device wakes up and runs a
sequence automatically. Up to eight sequences can run
sequentially.
When the timer elapses, the device returns to sleep. If the timer
elapses before the sequence completes execution, the remaining
commands in the sequence are ignored. Therefore, the user
code must ensure that the values in the SEQxSLEEPx registers
are large enough to allow sequences to execute all commands.
5. Write the sleep time and wake-up time to the SEQxSLEEPH,
SEQxSLEEPL, SEQxWUPH, and SEQxWUPL registers.
6. Configure the order in which sequences are triggered by
using the SEQORDER register.
It is recommended to use the wake-up timer to disable the
timer sleep function (PWRMOD, Bit 2 = 0) and use the
sequencer to enter hibernate mode. Set PWRMOD, Bit 3 = 1 to
enable the sequencer to put the device in hibernate mode.
7. Enable the timer by writing to CON, Bit 0 = 1.
Rev. 0 | Page 98 of 130