10.07.2015 Views

pic24fj128ga010 family - Microchip

pic24fj128ga010 family - Microchip

pic24fj128ga010 family - Microchip

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PIC24FJ128GA010 FAMILY10.0 TIMER1Note:This data sheet summarizes the featuresof this group of PIC24F devices. It is notintended to be a comprehensive referencesource. Refer to Section 14. “Timers”(DS39704) in the “PIC24F FamilyReference Manual” for more information.The Timer1 module is a 16-bit timer which can serve asthe time counter for the Real-Time Clock, or operate asa free-running interval timer/counter. Timer1 canoperate in three modes:• 16-Bit Timer• 16-Bit Synchronous Counter• 16-Bit Asynchronous CounterTimer1 also supports these features:• Timer gate operation• Selectable prescaler settings• Timer operation during CPU Idle and Sleepmodes• Interrupt on 16-bit Period register match or fallingedge of external gate signalFigure 10-1 presents a block diagram of the 16-bittimer module.To configure Timer1 for operation:1. Set the TON bit (= 1).2. Select the timer prescaler ratio using theTCKPS1:TCKPS0 bits.3. Set the Clock and Gating modes using the TCSand TGATE bits.4. Set or clear the TSYNC bit to configuresynchronous or asynchronous operation.5. Load the timer period value into the PR1register.6. If interrupts are required, set the interrupt enablebit, T1IE. Use the priority bits, T1IP2:T1IP0, toset the interrupt priority.FIGURE 10-1:16-BIT TIMER1 MODULE BLOCK DIAGRAMTCKPS1:TCKPS0SOSCO/T1CK1xTON2SOSCENGateSync01Prescaler1, 8, 64, 256SOSCITCY00TGATETGATETCSSet T1IF10QQDCKResetTMR101SyncEqualComparatorTSYNCPR1© 2009 <strong>Microchip</strong> Technology Inc. DS39747E-page 105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!