Please read Section 10.2 of the MCUs data sheet, especially the paragraph just under the "Note": you still have a bit to go in the ISR code. For a start, you need to read the PORT register to reset the 'change' detection circuit.
It is not important now as you only have one interrupt source, but for these devices that have only one or two interrupt vectors (the PIC18F4550 has two; high and low if you want to use them both, or the ne as you have your device configured) it is good to get in to the habit of always checking the trigger. The typical code in the ISR is something like:
Code:
void interrupt() // Or whatever for the priority interrupt structure
{
if( INTCONbits.RBIF && INTCONbits.RBIE)
{
// Put your code here
INTCONbits.RBIF = 0; // Reset the flag
}
// Put code here to check for other interrupt sources
}
(I generally program wit the free XC8/XC16 compilers so I tend to use their syntax - change as required).
The reason you check for both the IF and IE bits is that the IF bit can still be set by the hardware but the ISR will only be triggered if the IE bit is also set. If you have several interrupt sources then it is possible for you to see an IF bit set for a device that does not have the IE bit set. Therefore you need to check for both.
(B the way, if you want to clear the IF bit at the start of your code rather than at the end as I've done then that is OK as well - there have been wars fought over less but some people do hold string opinions on this.)
While I totally agree with your conclusion, the analog/digital thing is common to all Microchip devices and is one of the most common sources of problems for people starting out.
Of course there are good reasons why analog is the default but, as with "never play with the DEBUG config setting", "connect ALL Vss and Vdd pins and use bypass capacitors" and "always check your CONFIG settings, especially the JTAG one" and similar common problems, some of them have to be learned the hard way.
Susan