![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 :?: :?: :?: | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| Thank you very much for your help!!! | |
| |