SW006010 Microchip Technology, SW006010 Datasheet - Page 99

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
 2002 Microchip Technology Inc.
Modifying Register Bits
This interrupt is edge triggered. You can specify whether this interrupt occurs on every
rising or falling edge, every fourth rising edge, or every sixteenth rising edge. To select
the edge, you must set the Capture2 Mode Select (CA2ED1:CA2ED0) bits –
[TCON1<7>:TCON1<6>]. The following table outlines the values of these bits and the
edge that is selected:
To set edge selection to every rising edge, perform the following:
To set edge selection to every fourth rising edge, perform the following:
PIC17C7XX DEVICES
To enable the Capture2 interrupt for PIC17C7XX devices, you must clear the following
bit flags:
• The Peripheral Interrupt Request Register1’s (PIR1’s) Capture2 Interrupt Flag
• The Capture2 Overflow Status (CA2OVF) bit – [TCON2<7>].
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
TCON1 = TCON1 & 0b00111111;
TCON1 = TCON1 | 0b01000000;
TCON1 = TCON1 & 0b00111111;
TCON1 = TCON1 | 0b10000000;
(CA2IF) bit – [PIR1<3>].
clears any previous occurrences of Capture2 interrupts. In addition, you must set
the following enable bits:
- The Peripheral Interrupt Enable Register1’s (PIE1’s) Capture2 Interrupt
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
Enable (CA2IE) bit – [PIE1<3>].
TCON2bits.CA2OVF = 0;
PIR1bits.CA2IF = 0;
PIE1bits.CA2IE = 1;
INTSTAbits.PEIF = 0;
INTSTAbits.PEIE = 1;
CA2ED1:CA2ED0
00
01
10
11
Enabling/Disabling Interrupts
// Reset Edge Selection
// Reset Edge Selection
Every falling edge
Every rising edge
Every fourth rising edge
Every sixteenth rising edge
Edge Selection
apRNOVM^-page 93
Part
Part
Part
Part
1
2
3
4

Related parts for SW006010