SW006010 Microchip Technology, SW006010 Datasheet - Page 106

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 100
C17 C Compiler User’s Guide
11.3.2.15 USART2 RECEIVE INTERRUPT
There are two ways to enable the USART2 Receive Interrupt:
Library Call
To enable the USART2 Receive Interrupt through a library call, you must include the
usart16.h
also allows you to configure the USART2. For more information on how to configure
the USART2, refer to the MPLAB C17 C Compiler Libraries (DS51296). The following
code snippet only shows how to go about enabling the USART2 Receive Interrupt.
Modifying Register Bits
This section only discusses the bits necessary to enable the USART2 Receive
Interrupt. For information on configuring the USART2, please refer to the section in
the PIC17C7XX Data Sheet on the Receive Status and Control Register (RCSTA2).
To enable the USART2 receive interrupt, you must clear the following bit flags:
• The Peripheral Interrupt Request Register2’s (PIR2’s) USART2 Receive Interrupt
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
11.3.2.16 SYNCHRONOUS SERIAL PORT INTERRUPT
To enable the Synchronous Serial Port Interrupt, you must clear the following bit flags:
• The Peripheral Interrupt Request Register2’s (PIR2’s) Synchronous Serial Port
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
Note: PIC17C7XX devices only.
#include <usart16.h>
OpenUSART2(USART_RX_INT_ON, 25);
Flag (RC2IF) bit – [PIR2<0>].
clears any previous occurrences of USART2 receive interrupts. In addition, you
must set the following enable bits:
- The Peripheral Interrupt Enable Register2’s (PIE2’s) USART2 Receive Inter-
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
Note: PIC17C7XX devices only.
Interrupt Flag (SSPIF) bit – [PIR2<7>].
clears any previous occurrences of synchronous serial port interrupts. In addition,
you must set the following enable bits:
- The Peripheral Interrupt Enable Register2’s (PIE2’s) Synchronous Serial Port
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
- PIR2bits.SSPIF = 0;
- PIE2bits.SSPIE = 1;
- INTSTAbits.PEIF = 0;
- INTSTAbits.PEIE = 1;
rupt Enable (RC2IE) bit – [PIE2<0>].
Interrupt Enable (SSPIE) bit – [PIE2<7>].
PIR2bits.RC2IF = 0;
PIE2bits.RC2IE = 1;
INTSTAbits.PEIF = 0;
INTSTAbits.PEIE = 1;
header file and call the
OpenUSART2
function. The
 2002 Microchip Technology Inc.
OpenUSART2
function

Related parts for SW006010