EasyManua.ls Logo

Microchip Technology dsPIC30F - Design Tips

Microchip Technology dsPIC30F
738 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
dsPIC30F Family Reference Manual
DS70059C-page 12-24 © 2004 Microchip Technology Inc.
12.14 Design Tips
Question 1: Can a timer module be used to wake the device from Sleep mode?
Answer: Yes, but only Timer1 has the ability to wake the device from Sleep mode. This is
because Timer1 allows the TMR1 register to increment from an external, unsynchronized clock
source. When the TMR1 register is equal to the PR1 register, the device will wake from Sleep
mode, if Timer1 interrupts have been enabled using the T1IE control bit. Refer to Section
12.12.1 “Timer Operation in Sleep Mode” for further details.
12.14.1 Example Application
An example application is shown in Figure 12-7, where Timer1 (Type A time base) is driven from
an external 32.768 kHz oscillator. The external 32.768 kHz oscillator is typically used in applica-
tions where real-time needs to be kept, but it is also desirable to have the lowest possible power
consumption. The Timer1 oscillator allows the device to be placed in Sleep while the timer
continues to increment. When Timer1 overflows, the interrupt wakes up the device so that the
appropriate registers can be updated.
Figure 12-7: Timer1 Application
In this example, a 32.768 kHz crystal is used as the time base for the Real-Time Clock. If the
clock needs to be updated at 1 second intervals, then the period register, PR1, must be loaded
with a value to allow the Timer1 to PR1 match at the desired rate. In the case of a 1 second
Timer1 match event, the PR1 register should be loaded with a value of 0x8000.
Note: The TMR1 register should never be written for correct real-time clock functionality,
since the Timer1 clock source is asynchronous to the system clock. Writes to the
TMR1 register may corrupt the real-time counter value, resulting in inaccurate
timekeeping.
8
4
Current Sink
TMR1
V
SS
dsPIC30FXXX
V
DD
32.768 kHz
Backup
Battery
Power-Down
Detect
SOSCO
SOSCI
OSC1
S1
S2
S3
S4
CN0
CN1
CN2
CN3

Table of Contents

Other manuals for Microchip Technology dsPIC30F