SW006010 Microchip Technology, SW006010 Datasheet - Page 96

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 90
C17 C Compiler User’s Guide
PIC17C4X DEVICES
To enable the PORTB interrupt on change for PIC17C4X devices, you must clear the
following bit flags:
• The Peripheral Interrupt Request Register’s (PIR) PORTB Interrupt on Change
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
11.3.2.8
There are two ways to enable the Capture1 Interrupt:
Library Call
To enable the Capture1 Interrupt through a library call, you must include the
captur16.
function also allows you to select the edge on which the interrupt occurs.
The following table outlines the
edge selection:
// Enable the Capture1 Interrupt on the specified edge
#ifdef _TRIGGER_ON_EVERY_RISING_EDGE
#elif defined _TRIGGER_ON_EVERY_FALLING_EDGE
#elif defined _TRIGGER_ON_EVERY_FOURTH_RISING_EDGE
#elif defined _TRIGGER_ON_EVERY_SIXTEENTH_RISING_EDGE
#endif
Flag (RBIF) bit – [PIR<7>].
clears any previous occurrences of PORTB interrupt. In addition, you must set the
following enable bits:
- The Peripheral Interrupt Enable Register’s (PIE) PORTB Interrupt on Change
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
#include <captur16.h>
OpenCapture1(CAPTURE_INT_ON | C1_EVERY_RISE_EDGE);
OpenCapture1(CAPTURE_INT_ON | C1_EVERY_FALL_EDGE);
OpenCapture1(CAPTURE_INT_ON | C1_EVERY_4_RISE_EDGE);
OpenCapture1(CAPTURE_INT_ON | C1_EVERY_16_RISE_EDGE);
Enable (RBIE) bit – [PIE<7>].
C1_EVERY_FALL_EDGE
C1_EVERY_RISE_EDGE
C1_EVERY_4_RISE_EDGE
C1_EVERY_16_RISE_EDGE
PIRbits.RBIF = 0;
PIEbits.RBIE = 1;
INTSTAbits.PEIF = 0;
INTSTAbits.PEIE = 1;
CAPTURE1 INTERRUPT
h header file and call the
#define
#define
OpenCapture1
’s that exist in
Every falling edge
Every rising edge
Every fourth rising edge
Every sixteenth rising edge
function. The
captur16.h
Edge Selection
 2002 Microchip Technology Inc.
OpenCapture1
header file for

Related parts for SW006010