I am trying to use DT_INTS FOR K42 with a PIC18F27K42. I am familiar with using DT_INTS-18. Works perfectly with other PICs. However, I am receiving several errors when compiling with DT_INTS FOR K42. My PBP version is PBPX3.1.34. MPLABX is V5.30. The PBP test code simply configures comparator 1 and lights indicator LEDs to indicate if the voltage is above or below the reference voltage, and when the Comparator interrupt flag has been set or cleared. The test code works without the inclusion of DT_INTS-18K42b.
However, I receive several compile errors when I add the following code to generate an interrupt on comparator 1:
;------------------ DT Instant Interrupts ------------------------
wsave1 var byte $A0 system ;location for W if in bank0
wsave2 var byte $120 system ;location for W if in bank0
wsave3 var byte $1A0 system ;location for W if in bank0
INCLUDE "DT_INTS-18_K42b.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler C1_INT, _CMP_1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
INT_ENABLE C1_INT ; Comparator 1 interrupt
ENDASM
The interrupt handler is a simple counter. It serves no purpose other than testing.
;------------------[CMP1 - interrupt handler]------------------------
CMP_1: ;Comparator triggered
Ticks1 = Ticks1 + 1 ;Increment counter
@ INT_RETURN
When compiled, I receive three error messages "Found label after Column 1. (Save FSR)". Also the error messages: Illegal Nesting (ENDM); Expected (END); Expected (ENDM).
Based on my read of the #Defines in DT_INTS-18_K42b.bas, and the PIC18F27K42 datasheet Summary of Registers for Interrupts, I think DT_INTS-18_K42b.bas should work with this PIC.
Any suggestions for solving the problem will be appreciated.
Dan
Bookmarks