dsPIC30F6010
DS70119B-page 58
Advance Information
2004 Microchip Technology Inc.
9.1
Timer Gate Operation
The 16-bit timer can be placed in the Gated Time Accu-
mulation mode. This mode allows the internal T
CY
to
increment the respective timer when the gate input sig-
nal (T1CK pin) is asserted high. Control bit TGATE
(T1CON<6>) must be set to enable this mode. The
timer must be enabled (TON =
1
) and the timer clock
source set to internal (TCS =
0
).
When the CPU goes into the Idle mode, the timer will
stop incrementing, unless TSIDL =
0
. If TSIDL =
1
, the
timer will resume the incrementing sequence upon
termination of the CPU Idle mode.
9.2
Timer Prescaler
The input clock (F
OSC
/4 or external clock) to the 16-bit
Timer, has a prescale option of 1:1, 1:8, 1:64, and
1:256 selected by control bits TCKPS<1:0>
(T1CON<5:4>). The prescaler counter is cleared when
any of the following occurs:
• a write to the TMR1 register
• clearing of the TON bit (T1CON<15>)
• device Reset such as POR and BOR
However, if the timer is disabled (TON =
0
), then the
timer prescaler cannot be reset since the prescaler
clock is halted.
TMR1 is not cleared when T1CON is written. It is
cleared by writing to the TMR1 register.
9.3
Timer Operation During Sleep
Mode
During CPU Sleep mode, the timer will operate if:
• The timer module is enabled (TON =
1
) and
• The timer clock source is selected as external
(TCS =
1
) and
• The TSYNC bit (T1CON<2>) is asserted to a logic
0, which defines the external clock source as
asynchronous
When all three conditions are true, the timer will con-
tinue to count up to the period register and be reset to
0x0000.
When a match between the timer and the period regis-
ter occurs, an interrupt can be generated, if the
respective Timer Interrupt Enable bit is asserted.
9.4
Timer Interrupt
The 16-bit timer has the ability to generate an interrupt
on period match.
When the timer count matches the
period register, the T1IF bit is asserted and an interrupt
will be generated, if enabled. The T1IF bit must be
cleared in software. The timer interrupt flag T1IF is
located in the IFS0 control register in the Interrupt
Controller.
When the Gated Time Accumulation mode is enabled,
an interrupt will also be generated on the falling edge of
the gate signal (at the end of the accumulation cycle).
Enabling an interrupt is accomplished via the respec-
tive Timer Interrupt Enable bit, T1IE. The Timer Inter-
rupt Enable bit is located in the IEC0 control register in
the Interrupt Controller.
9.5
Real-Time Clock
Timer1, when operating in Real-Time Clock (RTC)
mode, provides time-of-day and event time stamping
capabilities. Key operational features of the RTC are:
• Operation from 32 kHz LP oscillator
• 8-bit prescaler
• Low power
• Real-Time Clock Interrupts
These Operating modes are determined by setting the
appropriate bit(s) in the T1CON Control register
FIGURE 9-2:
RECOMMENDED
COMPONENTS FOR
TIMER1 LP OSCILLATOR
RTC
SOSCI
SOSCO
R
C1
C2
dsPIC30FXXXX
32.768 kHz
XTAL
C1 = C2 = 18 pF; R = 100K
Summary of Contents for dsPIC30F6010
Page 12: ...dsPIC30F6010 DS70119B page 10 Advance Information 2004 Microchip Technology Inc NOTES...
Page 32: ...dsPIC30F6010 DS70119B page 30 Advance Information 2004 Microchip Technology Inc NOTES...
Page 38: ...dsPIC30F6010 DS70119B page 36 Advance Information 2004 Microchip Technology Inc NOTES...
Page 50: ...dsPIC30F6010 DS70119B page 48 Advance Information 2004 Microchip Technology Inc NOTES...
Page 68: ...dsPIC30F6010 DS70119B page 66 Advance Information 2004 Microchip Technology Inc NOTES...
Page 72: ...dsPIC30F6010 DS70119B page 70 Advance Information 2004 Microchip Technology Inc NOTES...
Page 76: ...dsPIC30F6010 DS70119B page 74 Advance Information 2004 Microchip Technology Inc NOTES...
Page 86: ...dsPIC30F6010 DS70119B page 84 Advance Information 2004 Microchip Technology Inc NOTES...
Page 108: ...dsPIC30F6010 DS70119B page 106 Advance Information 2004 Microchip Technology Inc NOTES...
Page 116: ...dsPIC30F6010 DS70119B page 114 Advance Information 2004 Microchip Technology Inc NOTES...
Page 128: ...dsPIC30F6010 DS70119B page 126 Advance Information 2004 Microchip Technology Inc NOTES...
Page 150: ...dsPIC30F6010 DS70119B page 148 Advance Information 2004 Microchip Technology Inc NOTES...
Page 164: ...dsPIC30F6010 DS70119B page 162 Advance Information 2004 Microchip Technology Inc NOTES...
Page 208: ...dsPIC30F6010 DS70119B page 206 Advance Information 2004 Microchip Technology Inc NOTES...
Page 220: ...dsPIC30F6010 DS70119B page 220 Advance Information 2004 Microchip Technology Inc NOTES...
Page 221: ...2004 Microchip Technology Inc Advance Information DS70119B page 221 dsPIC30F6010 NOTES...