Using PIC18F46K40 and in my simple test code, pin RA4 is connected to an LCD backlight which should be turned on when pressing the button connected to RB0 using external interrupt, but it never triggers. Very similar approach works just fine on PIC16F887. Is there something I missed in the setup? The wiring is exactly the same as I'm just swapping MCUs on the breadboard.
LATAbits.LATA4 = 0;
INTCONbits.INT0EDG = 0;
PIR0bits.INT0IF = 0;
PIE0bits.INT0IE = 1;
INTCONbits.GIE = 1;
INTCONbits.PEIE = 1;
void __interrupt() isr(void)
{
if (PIR0bits.INT0IF == 0)
{
LATAbits.LATA4 = 1;
PIR0bits.INT0IF = 0;
}
}