external interrupt address

Status
Not open for further replies.

neelam29

New Member
if an timer overflow generates interrupt , the controller goes to location
ORG 0x04
so,when an external interrupt is generated where will the controller jump to ,i mean which address

org......?
and if it is same 0x04 ,then how will microcontroler differentiate between the two interrupts?

m using pic16f628a and pic16f877a

thanks
 
the pic will go to ORG 0x04 in any interrupt. Then you just check different interrupt flags to find out which interrupt occurred.
 
thanks for replying could u please tell me one more thing ...how to complement a bit in pic.cause comf instruction is used to comple ment the whole register......which instruction is used to complement only a bit ...
 
neelam29 said:
thanks for replying could u please tell me one more thing ...how to complement a bit in pic.cause comf instruction is used to comple ment the whole register......which instruction is used to complement only a bit ...

You can use the XOR instruction to complement a bit.
To complement bit 5 you would do,
Code:
         movlw   b'00100000'
         xorwf   Location,F
Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…