|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
||||
|
||||
|
Re: Problem with interrupts on the PIC
There are two ways to handle this.
If you are writing code in C use the #pragma interrupt InterruptHandlerLow according top the Microchip C compiler ref' doc: http://www.microchip.com/download/to...b18/51288b.pdf the basic context should be saved for you. In assembler the code to do this is: MOVWF W_TEMP ; W_TEMP is in virtual bank MOVFF STATUS, STATUS_TEMP ; STATUS_TEMP located anywhere MOVFF BSR, BSR_TEMP ; BSR located anywhere ; ; USER ISR CODE ; MOVFF BSR_TEMP, BSR ; Restore BSR MOVF W_TEMP, W ; Restore WREG MOVFF STATUS_TEMP,STATUS ; Restore STATUS Which is found at the end of section 9 of the Pic18F8520 data sheet. -Jim |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Victor problem | Andy Baker | Electrical | 15 | 24-06-2003 09:49 |
| Ok one problem | cantwell03 | Programming | 3 | 13-02-2003 07:28 |
| The problem with scouting... | archiver | 2001 | 10 | 23-06-2002 23:49 |
| Major problem with chipphua motors | aka Scott White | Motors | 18 | 19-03-2002 19:44 |