RABC_INT -- RAB Port Change

Uses INTCON,RABIF,RABIE Registers and Control Bits.
DT's Interrupts MUST be used with PicBasic Pro and MPASM.

GPC_INT, IOC_INT, RAC_INT, RABC_INT and the original RBC_INT are all forms of Port Change Interrupts. The chip being programmed determines which one you need to use.

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,( _CK_RBx). 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.


 INT_LIST     macro     ;IntSource      Label,    Type,    ResetFlag?
            INT_Handler   RABC_INT      _CK_RBx    PBP       Yes
            INT_CREAT               ;Creates the interrupt processor
            INT_ENABLE    RABC_INT  ;enables interrupts


Command functions:
INT_CREATE ;Creates the interrupt processor
INT_ENABLE RABC_INT to enable interrupt on RAB Port Change
INT_DISABLE RABC_INT disable RABC interrupt.
INT_CLEAR RABC_INT -- clear flags
INT_RETURN ----------- To restore and return to the program where interrupt was made.

Make sure your port pin(s) is set to digital.

Check your Datasheet for IOCB or other registers that need to be addressed before implementing DT_INT's.

once it interrupts, you have to read PORTx to "End the Mismatch". A simple Dummy = PORTx in the handler will do it.

If multiple pins are used you may also need to compare that read, with the value of PORTx the last time it interrupted to figure out which pin changed, and which state it changed to.

Example by Bruce

<< RBC_INT | 14-bit sources | IOC_INT >>

Page last modified on March 16, 2018, at 11:00 PM