Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

PIC16C765/P Datasheet(PDF) 105 Page - Microchip Technology

Part # PIC16C765/P
Description  8-Bit CMOS Microcontrollers with USB
PDF  158 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16C765/P Datasheet(HTML) 105 Page - Microchip Technology

Back Button PIC16C765/P Datasheet HTML 101Page - Microchip Technology PIC16C765/P Datasheet HTML 102Page - Microchip Technology PIC16C765/P Datasheet HTML 103Page - Microchip Technology PIC16C765/P Datasheet HTML 104Page - Microchip Technology PIC16C765/P Datasheet HTML 105Page - Microchip Technology PIC16C765/P Datasheet HTML 106Page - Microchip Technology PIC16C765/P Datasheet HTML 107Page - Microchip Technology PIC16C765/P Datasheet HTML 108Page - Microchip Technology PIC16C765/P Datasheet HTML 109Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 105 / 158 page
background image
© 1999 Microchip Technology Inc.
Advanced Information
DS41124A-page 105
PIC16C745/765
13.6.1
INT INTERRUPT
The external interrupt on RB0/INT pin is edge trig-
gered: either rising, if bit INTEDG (OPTION_REG<6>)
is set or falling, if the INTEDG bit is clear. When a valid
edge appears on the RB0/INT pin, flag bit INTF
(INTCON<1>) is set. This interrupt can be disabled by
clearing enable bit INTE (INTCON<4>). Flag bit INTF
must be cleared in software in the interrupt service rou-
tine before re-enabling this interrupt. The INT interrupt
can wake-up the processor from SLEEP, if bit INTE was
set prior to going into SLEEP. The status of global inter-
rupt enable bit GIE decides whether or not the proces-
sor branches to the interrupt vector following wake-up.
See Section 13.9 for details on SLEEP mode.
13.6.2
TMR0 INTERRUPT
An overflow (FFh
→ 00h) in the TMR0 register will set
flag bit T0IF (INTCON<2>). The interrupt can be
enabled/disabled by setting/clearing enable bit T0IE
(INTCON<5>). (Section 6.0)
13.6.3
PORTB INTERRUPT ON CHANGE
An input change on PORTB<7:4> sets flag bit RBIF
(INTCON<0>). The interrupt can be enabled/disabled
by setting/clearing enable bit RBIE (INTCON<4>).
(Section 5.2)
13.7
Context Saving During Interrupts
During an interrupt, only the PC is saved on the stack.
At the very least, W and STATUS should be saved to
preserve the context for the interrupted program. All
registers that may be corrupted by the ISR, such as
PCLATH or FSR, should be saved.
Example 13-1 stores and restores the STATUS, W and
PCLATH registers. The register, W_TEMP, is defined in
Common RAM, the last 16 bytes of each bank that may
be accessed from any bank. The STATUS_TEMP and
PCLATH_TEMP are defined in bank 0.
The example:
a)
Stores the W register.
b)
Stores the STATUS register in bank 0.
c)
Stores the PCLATH register in bank 0.
d)
Executes the ISR code.
e)
Restores the PCLATH register.
f)
Restores the STATUS register
g)
Restores W.
Note
that
W_TEMP,
STATUS_TEMP
and
PCLATH_TEMP are defined in the common RAM area
(70h - 7Fh) to avoid register bank switching during con-
text save and restore.
EXAMPLE 13-1: SAVING STATUS, W, AND PCLATH REGISTERS IN RAM
#define
W_TEMP
0x70
#define
STATUS_TEMP
0x71
#define
PCLATH_TEMP
0x72
org
0x04
; start at Interrupt Vector
MOVWF
W_TEMP
; Save W register
MOVF
STATUS,W
MOVWF
STATUS_TEMP
; save STATUS
MOVF
PCLATH,W
MOVWF
PCLATH_TEMP
; save PCLATH
:
(Interrupt Service Routine)
:
MOVF
PCLATH_TEMP,W
MOVWF
PCLATH
MOVF
STATUS_TEMP,W
MOVWF
STATUS
SWAPF
W_TEMP,F
;
SWAPF
W_TEMP,W
; swapf loads W without affecting STATUS flags
RETFIE
Note:
If a change on the I/O pin should occur
when the read operation is being executed
(start of the Q2 cycle), then the RBIF inter-
rupt flag may not get set.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com