Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 12th November 2003, 03:41 PM   (permalink)
Default How to program the PIC Interrupt?

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

:?: :?: :?:
matasoft is offline  
Old 12th November 2003, 03:49 PM   (permalink)
Default

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
Exo is offline  
Old 13th November 2003, 04:04 PM   (permalink)
Default

Thank you very much for your help!!!
matasoft is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 03:42 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker