USBINT

USB_INT -- USB 16C745/765 only

Uses PIR1,USBIF, PIE1,USBIE 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,( _ServiceUSB). 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 USB_INT

ASM

 INT_LIST     macro     ;IntSource      Label,    Type,    ResetFlag?
            INT_Handler  USB_INT     _ServiceUSB   PBP       Yes
            endm
            INT_CREAT             ;Creates the interrupt processor
            INT_ENABLE   USB_INT  ;enables USB interrupts

ENDASM

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

<< LCD_INT | 14-bit sources | OSCF_INT >>

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