pic32mx320f064h Microchip Technology Inc., pic32mx320f064h Datasheet - Page 273

no-image

pic32mx320f064h

Manufacturer Part Number
pic32mx320f064h
Description
64/100-pin General Purpose, 32-bit Flash Microcontrollers
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
pic32mx320f064h-40V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064hT-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
13.3.3
In this mode, the timer clock source is an external clock
source or pulse applied to the T1CK pin, TCS
(T1CON<1>) = 1. To provide synchronization, Timer1
synchronization bit TSYNC (T1CON<2>) must be set
(= 1). The 16-bit TMR1 Count register increments on
every synchronized rising edge of an external clock
when the timer clock prescale <TCKPS> is 1:1.
Timer1 generates a timer match event after the TMR1
Count register matches the PR1 Period register value
(mid-clock cycle on the falling edge), then resets to
0x0000 on the next synchronized external clock cycle.
The timer continues to increment and repeat the period
match until the timer is disabled. For further details
regarding
Section 13.5 “Timer Interrupts”.
For clock prescale = N (other than 1:1), the timer oper-
ates at a clock rate = (external clock/N), therefore, the
TMRx Count register increments on every Nth external
synchronized clock cycle. For further details regarding
timer prescaler, refer to Section 13.4.2 “Timer Clock
Prescaler”.
13.3.3.1
• When using an external clock source, regardless
• Timer1 will not operate from a synchronized exter-
The following steps should be performed to properly
configure the Timer1 peripheral for Synchronous
Counter mode operation.
1.
2.
3.
4.
5.
6.
7.
8.
© 2007 Microchip Technology Inc.
of the Timer1 prescale value, 2-3 external clock
cycles are required, after the ON bit = 1, before
the TMR1 register begins incrementing.
nal clock source while the CPU is in SLEEP
mode, since the synchronizing PB clock is
disabled during Sleep mode.
Clear control bit, ON (T1CON<15>) = 0, to
disable Timer1.
Select the desired timer prescaler using bits,
TCKPS<1:0> (T1CON<5:4).
Set control bit, TCS (T1CON<1>) = 1, to select
an external clock source.
Set control bit, TSYNC (T1CON<2>) = 1, to
enable synchronization.
Clear Timer register TMR1.
Load Period register PR1 with desired
16-bit match value.
If timer interrupts are used, refer to Section 13.5
“Timer Interrupts” for interrupt configuration
steps.
Set control bit, ON (T1CON<15>) = 1, to enable
Timer1.
SYNCHRONOUS EXTERNAL
TIMER
timer
Considerations
events
and
interrupts,
Advance Information
see
EXAMPLE 13-2:
13.3.4
In this mode, the timer clock source is an external clock
source or pulse applied to the T1CK pin, TCS
(T1CON<1>) = 1. Clock synchronization is not
required, therefore, the Timer1 clock synchronization
bit should be cleared, TSYNC (T1CON<2>) = 0. The
16-bit TMR1 Count register increments on every rising
edge of an external clock when the timer clock prescale
<TCKPS> is 1:1.
Timer1 generates a timer match event after the TMR1
Count register matches the PR1 register value (mid-
clock cycle on the falling edge), then resets to 0x0000
on the next external clock cycle. The timer continues
to increment and repeat the period match until the timer
is disabled. For further details regarding timer events
and interrupts, see Section 13.5 “Timer Interrupts”.
For clock prescale = N (other than 1:1), the timer
operates at a clock rate = (external clock/N), there-
fore, the TMR1 Count register increments on every
Nth external clock cycle. For further details regarding
the timer prescaler, refer to Section 13.4.2 “Timer
Clock Prescaler”.
13.3.4.1
• Regardless of the Timer1 prescale setting, 2-3
• Timer1 can operate while the CPU is in Sleep
• The Timer1 interrupt can be used to wake the
• Typical use is with the Secondary Low-Power
T1CON = 0x0;
T1CON = 0x0036
TMR1 = 0x0;
PR1 = 0x3FFF;
T1CONSET = 0x8000; // Start Timer
external clocks are required after the ON bit = 1,
before the TMR1 register begins incrementing.
mode.
CPU from Sleep mode.
Oscillator, SOSC and RTCC Real-Time Clock
Calendar peripheral.
Note:
PIC32MX FAMILY
ASYNCHRONOUS EXTERNAL
TIMER
The SOSC oscillator may be used by the
CPU as a low-power clock source.
Timer 1 does not have exclusive usage to
this oscillator. Refer to the “PIC32MX
Family Reference Manual” (DS61132)
regarding the operation of the Secondary
Low-Power Oscillator.
Considerations
SYNCHRONOUS
EXTERNAL TIMER
INITIALIZATION
// Stop Timer and reset
// Set prescaler=1:256,
// external clock,
// synchronous mode
// Clear timer register
// Load period register
DS61143A-page 271

Related parts for pic32mx320f064h