How to program the PIC Interrupt?

Status
Not open for further replies.

matasoft

New Member
If an interrupt occurs then what code it will execute?
Where can I write the code for the interrupt?
Will I use it like I use a CALL command, like this:

INT:
<code>
RETFIE

:?: :?: :?:
 
your using assembler?

Then interrupt vector is adress 0x0004. So when interrupt occurs the pic will jump to this adress. You can force code to this adress with the org command

ORG 0x0004
;context saving

;Your interrupt code

;context restoring
RETFIE

As a result your program entry (the program start, at adress 0) should contain a jump over the interrupt vector within the first 4 instructions
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…