I agree with Richard in that I also have learned to work with C in MPLABX, but I was able to use PBP command structures to use newer functions that don't have PBP commands. I didn't need to resort to ASM.
As for clearing an Interrupt Flag and incrementing a variable, it would look something like this in ASM:
Code:
BANKSEL PIR1 ;or whatever holds the TIMERx IF
BCF PIR1,1 ;or whatever bit holds the TIMERxIF. Note use of a comma versus period
BANKSEL RPM ;or whatever your variable is called
INCF RPM ;increment your variable by 1
RETFIE
The above does not take into account Context Saving, nor does it take into account your RPM variable is probably at least 16 bits. However, the skeletal structure is about all you need for an ASM Interrupt Service Handler.
Bookmarks