SW006010 Microchip Technology, SW006010 Datasheet - Page 95

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.
PIC17C4X DEVICES
To enable the TMR3 overflow interrupt for PIC17C4X devices, you must clear the
following bit flags:
• The Peripheral Interrupt Request Register’s (PIR) TMR3 Interrupt Flag (TMR3IF)
• The Timer3 On (TMR3ON) bit – [TCON2<2>]. This stops the timer until you are
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
ALL PIC17 DEVICES
To reset Timer3, you must clear the TMR3L and TMR3H registers.
To start Timer3, set the Timer3 On (TMR3ON) bit – [TCON2<2>].
11.3.2.7
There are two ways to enable the PORTB Interrupt on Change:
Library Call
To enable the PORTB interrupt on change through a library call, you must include the
port16.h
Modifying Register Bits
PIC17C7XX DEVICES
To enable the PORTB interrupt on change for PIC17C7XX devices, you must clear the
following bit flags:
• The Peripheral Interrupt Request Register1’s (PIR1’s) PORTB Interrupt on
• The INTSTA register’s Peripheral Interrupt Flag (PEIF) bit – [INTSTA<7>]. This
bit – [PIR<6>].
ready to use it. See below for how to start the timer.
clears any previous occurrences of TMR3 overflow interrupts. In addition, you
must set the following enable bits:
- The Peripheral Interrupt Enable Register’s (PIE) TMR3 Interrupt Enable
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
#include <port16.h>
OpenPORTB(PORTB_CHANGE_INT_ON);
Change Flag (RBIF) bit – [PIR1<7>].
clears any previous occurrences of PORTB interrupt. In addition, you must set the
following enable bits:
- The Peripheral Interrupt Enable Register1’s (PIE1’s) PORTB Interrupt on
- The INTSTA register’s Peripheral Interrupt Enable (PEIE) bit – [INTSTA<3>].
(TMR3IE) bit – [PIE<6>].
Change Enable (RBIE) bit – [PIE1<7>].
TMR3L = 0;
TMR3H = 0;
TCON2bits.TMR3ON = 1;
TCON2bits.TMR3ON = 0;
PIRbits.TMR3IF = 0;
PIEbits.TMR3IE = 1;
INTSTAbits.PEIF = 0;
INTSTAbits.PEIE = 1;
PIR1bits.RBIF = 0;
PIE1bits.RBIE = 1;
INTSTAbits.PEIF = 0;
INTSTAbits.PEIE = 1;
header file and call the
PORTB INTERRUPT ON CHANGE
Enabling/Disabling Interrupts
OpenPORTB
function.
apRNOVM^-page 89
Part
Part
Part
Part
1
2
3
4

Related parts for SW006010