I'm using Code Configurator in MPLAB for the PIC18F25K50 (P-star). I have read through the https://www.pololu.com/docs/0J62/6.1 page. I'm able to use the "Codeoffset" option set to 0x2000 in the project properties->XC8 linker->additional options menu to get my code running on the P-star. However, it looks like interrupts aren't being triggered (everything else seems to work). There is a function generated by Code Configurator called
INTERRUPT_InterruptManager in the interrupt_manager.c file and I've added a line of code in that function which [is supposed to] turns on the green LED on the P-star. I've also enabled the timer interrupt for various timers, but the LED never turns on. I know the timers are running because the timer counter increments and overflows (as it should), and I've ensured the global, peripheral and individual timer (like
INTCONbits.TMR0IE = 1;) interrupts are enabled, but still nothing.
I suspect that I might need to also move the
INTERRUPT_InterruptManager function to either 0x2008 or 0x2018, but adding any of the following to the function doesn't seem to make a difference:
So the whole line would be something like:
void interrupt INTERRUPT_InterruptManager (void) __attribute__((address(0x2008)))
I'm not sure if XC8/MPLAB knows to also move the interrupt vector locations when I tell it to use the 0x2000 codeoffset setting. Has anyone else tried using the P-star with XC8/MPLAB and used interrupts successfully? Thanks.
EDIT: it seems like the forum interprets the double surrounding underscores as a bold flag. Bolded "attribute" is actually __ attribute __ with the spaces removed.