Andrew Warren Wrote: >Hans Stevens wrote: > >> On my PIC16C84 project, I use the 4 Interupts .... Now I wonna >> create 4 Interupts vector address. >> >> Example >> ORG 0X010 ;Ext. Int. Vector Adress >> ..... >> .... >> >> ORG 0X020 ;TMR0 Overflow >> >> Have somebody a idea how to do this? > >Hans: > >The 16F84 has only a single interrupt vector; to handle >multiple interrupt sources, your interrupt service routine >must check each enterrupt flag individually. > >For example: (example snipped) >-Andy Hans: Two items I would add to Andys reply: 1. If (and only if) you are going to disable individual interrupts you will want to check for the interrupt enable bit being set in addition to the interrupt flag bit. For example if you want to disable the external interrupt for a critical region (while leaving the global interrupt enabled) then use: btfsc INTCON,INTE ; test if external interrupt enabled btfss INTCON,INTF ; and set. goto CHECKT0 bcf INTCON,INTF ; clear interrupt source ; process external interrupt actions here. CHECKT0 ; ... 2. If you will be disabling global interrupts (GIE) then review the methods that the data sheet recommends for this. A known problem is when an interrupt occurs during the "bcf INTCON,GIE" instruction the interrupt will be executed and the "retfie" instruction will then reset this bit on exit from the interrupt routine. (Not all versions of the 14-bit family have this problem, so check the data sheet to be sure, but I believe the 16C84 does have the problem.) Chip Weller