Searching \ for 'RB7:RB4 interupts' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=
Search entire site for: 'RB4 interupts'.

Truncated match.
PICList Thread
'RB7:RB4 interupts'
1998\11\22@031225 by aureo

flavicon
face
I want to use the interupt on change feature of portB of the PIC16C84 to
read a key pad.

Because the '84 has a number of interupt sources (and only one ISR
address: org 4) I guess the first part of the ISR work out which
interupt has occured and then execute the relevant code.

How is this usually done?


--
Seth Fischer
Auckland, New Zealand

1998\11\22@183508 by James Cameron

flavicon
face
Seth Fischer wrote:
> Because the '84 has a number of interupt sources (and only one ISR
> address: org 4) I guess the first part of the ISR work out which
> interupt has occured and then execute the relevant code.
> How is this usually done?

The code in the ISR checks the bits in the INTCON register to determine
which interrupt conditions caused execution.  There can be more than
one, if you enable more than one.

ISR
       ...                     ; save registers
       BTFSS   INTCON,T0IF     ; are we here for a timer interrupt?
       GOTO    ISR_NOT_TMR0    ; no, branch elsewhere

       BCF     INTCON,T0IF     ; clear the timer interrupt
       ...                     ; process timer interrupt

ISR_NOT_TMR0
       BTFSS   INTCON,INTF     ; are we here for a RB0/INT interrupt?
       GOTO    ISR_NOT_INTF    ; no, branch elsewhere

       BCF     INTCON,INTF     ; clear the RB0/INT interrupt
       ...                     ; process RB0/INT interrupt

ISR_NOT_INTF
       ...                     ; restore registers
       RETFIE                  ; return and enable interrupts

--
James Cameron                                      (spam_OUTcameronTakeThisOuTspamstl.dec.com)

OpenVMS, Linux, Firewalls, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.

"Specialisation is for insects." -- Robert Heinlein.

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...