IOCINT

OIC_INT -- OIC Port Change

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.


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

ASM

 INT_LIST     macro     ;IntSource      Label,    Type,    ResetFlag?
            INT_Handler   OIC_INT     _GetChange   PBP       Yes
            endm
            INT_CREAT              ; Creates the interrupt processor
            INT_ENABLE    TMR0_INT  ;enables TMR0 interrupts

ENDASM

Command functions: INT_CREATE ;Creates the interrupt processor
INT_ENABLE OIC_INT – to enable TMR0 interrupt
INT_DISABLE OIC_INTT – disable TMR0 interrupt.
INT_CLEAR OIC_INT -- clear flags
INT_RETURN ----------- To restore and return to the program where interrupt was made.






richard
dt-ints is not a panacea for pic interrupts some understanding of the hardware is essential for meaningful results, not all 8 bit pic mcu chips are equal its possible microchip may have implemented module hardware in various different ways so always check the datasheet. ioc interupts are not particularly difficult ,In general terms the user needs to :
1. ensure the chosen pin{/s} are digital inputs and not floating
2. enable the appropriate edge detects that you need [eg IOCAP IOCAN ]
3. clear the ioc flags [eg IOCAF]
4. the dt-ints macro @ int_enable IOC_INT will enable all the other settings necessary [GIE,IOCIE]
5. your isr must/should clear the ioc edge flags [eg IOCAF].
also if required examine the ioc edge flag register{/s}to determine which pin{/s} changed [eg IOCAF].\\ dt-ints will do neither of these things 6. dt-ints can clear the ioc flag [IOCIF] it cannot clear ioc edge flags [eg IOCAF].



See OIC Interrupts by mpgmike.... IOC Interrupts



<< RABC_INT | 14-bit sources | TMR0_INT >>

\\\

Page last modified on March 17, 2018, at 10:30 PM