Hey, you don't have any loop in you code.
With this code, you stay in main, and wait for interrupt. When interrupt fire PC will jump to to pwmint. And with INT_RETURN you return to main.Code:DEFINE OSC 40 INCLUDE "DT_INTS-18.bas" ' Base Interrupt System INCLUDE "ReEnterPBP-18.bas" ' Include if using PBP interrupts ' PCPWM registers configuration PTCON0=%00000010 PTCON1=%10000000 PWMCON0=%01000000 PWMCON1=%00000001 DTCON=%00110110 PTPERH=$1:PTPERL=$4d ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler PT_INT, _pwmint, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM @ INT_ENABLE PT_INT Main: GOTO Main ' PWM ISR pwmint: ' Wait PIR3 interrupt PIR3.4=%0 . . . (there is my PWM code) . . . @ INT_RETURN
Without Main loop, PIC execute every instruction, and when execute INT_RETURN processor reset PIC(reset on stack underflow).




Bookmarks