Quote Originally Posted by Darrel Taylor View Post
Also, don't mess with all the INTCON and RCON registers.
DT_INTS handles all those for you.
If you change them, it can interfere with the interrupt system.
<br>
Darrel, I have discovered that when I am using INT2_INT interrupt source from DS1337 to the 18F4550 that I have to have the INTCON2 statement per below code...otherwise the interrupt doesn't work. When you said that I shouldn't mess with the INTCON register settings because DT_INTS takes care of them, did you mean only the GIE setting?? In fact, can you explain which of the INTCON register settings ARE NOT handled by DT_INTS, if more than just this one for INT2 falling edge??

Code:
'----------------------[ SETUP FOR INTERRUPTS ]-------------------------  
ASM
INT_LIST  macro    ; IntSource,         Label,  Type, ResetFlag?
        ;INT_Handler   USB_Handler
        INT_Handler   INT2_INT,        _Alarm,   PBP,  yes
    endm
    INT_CREATE                ; Creates the interrupt processor
ENDASM

@    INT_ENABLE   INT2_INT     ; enable external (INT) interrupts
' Per DT, DT_INTS already takes care of setting INTCON and RCON registers
' but this doesn't work unles INTCON2 set per below:
    'INTCON.7 = 1         ' Set Global Interrupt Enable bit
    INTCON2 = %00000000  ' Set INT2 for falling edge (Bit4-low)
                         ' on RTC's interrupt.
    'INTCON3 = %10010000  ' Set INT2 high priority (Bit7-high), enable INT2
                         ' (Bit4-high)