OSCF_INT -- Oscillator Fail

Uses PIR2,OSFIF, PIE2,OSFIE Registers and Control Bits.

DT's Interrupts MUST be used with PicBasic Pro and MPASM.

The Fail-Safe Clock Monitor (FSCM) allows the device to continue operating should the External Oscillator fail.

The following block of instructions will establish the interrupt used and the PBP label (your ISR) to jump to once interrupt occurs. All PBP labels or variables used inside ASM code blocks must be preceded by the underscore (_ExClkStp). 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  OSCF_INT     _ExClkStp   PBP       Yes
            INT_CREAT              ;Creates the interrupt processor
            INT_ENABLE   OSCF_INT  ;enables OSCF interrupts


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

When the external clock fails, the FSCM switches the device clock to an internal clock source and sets the bit flag OSFIF of the PIR2 register. Setting this flag will generate an interrupt if the OSFIE bit of the PIE2 register is also set. See your data sheet for operational functionality of the Fail-Safe Clock Monitor.

<< USB_INT | 14-bit sources | T1GATE_INT >>

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