Академический Документы
Профессиональный Документы
Культура Документы
Interrupts (1)
Interrupt-driven I/O uses the
Interrupts (2)
Advantages
Immediate response to I/O service
request
Normal execution continues until it is
known that I/O service is needed
Disadvantages
Coding complexity for interrupt
service routines
Extra hardware needed
Processors interrupt system I/O
stack
PC is loaded with address of interrupt
service routine (ISR)
Different schemes for determining this
address
10
11
16F84 Timer/Counter
12
13
14
15
18
movwf
bcf
movlw
movwf
bcf
bsf
source
bsf
return
STATUS, RP1
;select bank 1
STATUS, RP0
B11010100 ; set up OPTION, prescaler and
timer0 resources
OPTION
STATUS, RP0
; select bank 0
D131
TMR0
; initialize TMR0
INTCON, T0IF
; clear Timer0 interrupt flag
INTCON, T0IE
; enable Timer0 interrupt
INTCON, GIE
19
Watchdog Timer
Free running counter with its own oscillator
Can be enabled or disabled through special
21