SW006010 Microchip Technology, SW006010 Datasheet - Page 107

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.
11.3.2.17 BUS COLLISION INTERRUPT *
To enable the Bus Collision Interrupt, you must clear the following bit flags:
• The Peripheral Interrupt Request Register2’s (PIR2’s) Bus Collision Interrupt Flag
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
11.3.2.18 A/D MODULE INTERRUPT
There are two ways to enable the A/D Module Interrupt:
Library Call
To enable the A/D Module Interrupt through a library call, you must include the
adc16.h
you to configure the A/D converter. For more information on how to configure the A/D
converter, refer to the MPLAB C17 C Compiler Libraries (DS51296). The following
code snippet only shows how to go about enabling the A/D Module Interrupt.
Modifying Register Bits
This section only discusses the bits necessary to enable the A/D Module Interrupt. For
information on configuring the A/D Converter, please refer to the section in the
PIC17C7XX Data Sheet on the Analog-to-Digital converter.
To enable the A/D Module Interrupt, you must clear the following bit flags:
• The Peripheral Interrupt Request Register2’s (PIR2’s) A/D Module Interrupt Flag
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
Note: PIC17C7XX devices only.
(BCLIF) bit – [PIR2<6>].
clears any previous occurrences of bus collision interrupts. In addition, you must
set the following enable bits:
- The Peripheral Interrupt Enable Register2’s (PIE2’s) Bus Collision Interrupt
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
Note: PIC17C7XX devices only.
#include <adc16.h>
OpenADC(ADC_INT_ON, ADC_CH_0);
(ADIF) bit – [PIR2<5>].
clears any previous occurrences of A/D module interrupts. In addition, you must
set the following enable bits:
- The Peripheral Interrupt Enable Register2’s (PIE2’s) A/D Module Interrupt
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
Enable (BCLIE) bit – [PIE2<6>].
Enable (ADIE) bit – [PIE2<5>].
header file and call the
PIR2bits.BCLIF = 0;
PIE2bits.BCLIE = 1;
INTSTAbits.PEIF = 0;
INTSTAbits.PEIE = 1;
PIR2bits.ADIF = 0;
PIE2bits.ADIE = 1;
INTSTAbits.PEIF = 0;
INTSTAbits.PEIE = 1;
Enabling/Disabling Interrupts
OpenADC
function. The
OpenADC
function also allows
apRNOVM^-page 101
Part
Part
Part
Part
1
2
3
4

Related parts for SW006010