ADINT

 AD_INT     -- A/D Converter Interrupt


Uses PIR1,ADIF, PIE1,ADIE 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,( _GetDig). 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 AD_INT

ASM

 INT_LIST     macro     ;IntSource      Label,    Type,    ResetFlag?
            INT_Handler   AD_INT    _GetDig   PBP       Yes
            endm
            INT_CREAT             ;Creates the interrupt processor
            INT_ENABLE    AD_INT  ;enables AD interrupts

ENDASM

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



The A/D interrupt fires when an A/D conversion is complete. This is handy for entering sleep mode,
and having the PIC wake up when the A/D conversion is complete. With the oscillator shut down during sleep, you get much more stable A/D readings.
Bruce http://www.picbasic.co.uk/forum/showthread.php?t=8111



<< RX_INT | 14-bit sources | CMP_INT >>

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