CCP4_INT -- CCP4
Uses PIR3,CCP4IF, PIE3,CCP4IE Registers and Control Bits.
DT's Interrupts MUST be used with PicBasic Pro and MPASM.
The following block of instructions will establish the interrupt used and the PBP label (your ISR) to jump to once interrupt occurs. Remember; all PBP labels or variables used inside ASM code blocks must be preceded by the underscore,( _GetData). All instruction to the interrupt processor should be in ASM and preceded by the @ symbol and to the far left column of the editor if not included in other ASM code blocks.
Example:
@ INT_DISABLE CCP4_INT
ASM
INT_LIST macro ;IntSource Label, Type, ResetFlag? INT_Handler CCP4_INT _GetData PBP Yes endm INT_CREAT ;Creates the interrupt processor INT_ENABLE CCP4_INT ;enables CCP4 interrupts
ENDASM
Command functions:
INT_CREATE ;Creates the interrupt processor
INT_ENABLE CCP4_INT – enable CCP4 interrupt.
INT_DISABLE CCP4_INT– disable CCP4 interrupt.
INT_CLEAR CCP4_INT – clear flags
INT_RETURN ---------- To restore and return to the program where interrupt was made.
Link to Microchip Tips & Tricks for CCP
<< CCP3_INT | 14-bit sources | CCP5_INT >>