Electronic – Using the C18 compiler on Mac OS X


I'm currently in a microcontrollers class, one where we use the PIC18F4550 and must use the C18 compiler (something Windows oriented and used for grading). I'm trying to install this on Mac OS X, and am running into difficulties.

I can't find a valid C18 compiler that works on Mac OS X. Instead, I find a XC8 compiler, which Microchip says is a complete replacement. But, when I try to compile the code below, it gives me an error, and this code is widely used in my class.

#pragma interrupt low_isr       // both lines generate errors
_asm goto low_isr _endasm

Yes, I have found a C18 compiler, but it's only for Windows. Despite how hard I search, I can only find the XC8 compiler. Online forums indicate that the C18 compiler for Mac OSX has been taken offline.

Best Answer

In the new XC8 compiler, you can define a low priority interrupt routine like this:

void interrupt low_priority ISR (void)

Further reading: MPLAB® XC8 C Compiler User’s Guide