SW006010 Microchip Technology, SW006010 Datasheet - Page 90

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
MPLAB
apRNOVM^-page 84
C17 C Compiler User’s Guide
11.3.2.4
There are two ways to enable the TMR1 overflow interrupt:
Library Call
To enable the TMR1 Overflow Interrupt through a library call, you must include the
timers16.h
also allows you to select the source (external/internal) of the clock, as well as whether
to treat Timer1 and Timer2 as individual 8-bit timers or as one 16-bit timer.
The following table outlines the
selecting an external or internal clock source:
The following table outlines the
specifying whether to treat Timer1 and Timer2 as individual 8-bit timers or as one
16-bit timer:
#include <timers16.h>
// Enable the TMR1 Overflow interrupt.
// Use Timer1 as an individual 8-bit timer.
#ifdef _EXTERNAL_CLOCK
#else
#endif
Modifying Register Bits
To select the source (external/internal) of the clock, you must clear (internal clock) or
set (external clock input on the TCLK12 pin) the Timer1 Clock Source Select
(TMR1CS) bit – [TCON1<0>].
#ifdef _EXTERNAL_CLOCK
#else
#endif
To specify whether to treat Timer1 and Timer2 as individual 8-bit timers or as one
16-bit timer, you must clear or set, respectively, the Timer2:Timer1 Mode Select (T16)
bit – [TCON1<3>].
#ifdef _16BIT_CLOCK
#else
#endif
OpenTimer1(TIMER_INT_ON | T1_SOURCE_EXT | T1_T2_8BIT);
OpenTimer1(TIMER_INT_ON | T1_SOURCE_INT | T1_T2_8BIT);
TCON1bits.TMR1CS = 1;
TCON1bits.TMR1CS = 0;
TCON1bits.T16 = 1;
TCON1bits.T16 = 0;
TMR1 OVERFLOW INTERRUPT
T1_T2_8BIT
T1_T2_16BIT
T1_SOURCE_EXT
T1_SOURCE_INT
header file and call the
#define
#define
#define
#define
OpenTimer1
’s that exist in
’s that exist in
Timer1 and Timer2 individual 8-bit timers
Timer1 and Timer2 16-bit single timer
function. The
Timer2:Timer1 Mode
timers16.h
timers16.h
External (I/O pin)
Internal (T
Clock Source
 2002 Microchip Technology Inc.
OpenTimer1
OSC
header file for
header file for
)
function

Related parts for SW006010