From: <bra...@ca...> - 2003-07-23 06:23:29
|
I think they still are. Check the .asm file generated by SDCC. I found 2 errors(see below). Since the interrupt vector starts at address 4, there needs to be 3(not 2) nop instructions in the STARTUP code section. Farther down the listing in the actual interrupt listing, the GOTO END_OF_INTERRUPT+1 instruction must be removed(the next 3 nop's can also be removed). the GOTO jumps to a GOTO $ instruction which is an endless loop! I manually remove these then have SDCC assemble and link the file and the program then works. ; reset and interrupt vectors ;-------------------------------------------------------- STARTUP code goto __sdcc_gsinit_startup nop nop goto __sdcc_interrupt ;-------------------------------------------------------- ; initialization and interrupt code ;-------------------------------------------------------- code_init code 0x10 __sdcc_gsinit_startup: pagesel _main goto _main __sdcc_interrupt: ;*** ; pBlock Stats: dbName = I ;*** ;entry: _rs232_isr ;Function start ; 0 exit points ;functions called: ; _getc ; _getc ;; Starting pCode block _rs232_isr ;Function start ; 0 exit points ;#CSRC C:/sdcc/PIC/testswitch.c 39 ; void rs232_isr(void) interrupt 0 GOTO END_OF_INTERRUPT+1 NOP NOP NOP MOVWF WSAVE On 23 Jul 2003 at 2:10, John Ford wrote: > Are the PIC interrupts still broken? I'm using a 16f877 and the code seems > to branch to the interrupt funtion one time only. But it is not > successfully resetting PIR1. The code just gets stuck in a loop, jumping > back to interrupt imediately after retfie. I've tried every permutation of > how to reset the interrupt flags that I can think of, but nothing seems to > work. > > Thanks > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the > same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > Sdcc-user mailing list > Sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-user |