Electronic – PIC18F4550 C-compiler that’s open-source & cross-platform

ccompilerpic

I'm a long time AVR user. I really like that AVR-GCC works on the two main OSes I use (Mac OS X and Linux), is open-source, and is supported by Atmel. I'd like to get back into PIC programming (used them in the 90s) since there are some pretty good PICs out there, like the PIC18F4550-class of chips.

Unfortunately, most all the compilers for PIC18s seem to be Windows-only and for-pay. And they almost always have an IDE that I do not need. I prefer command-line compilers and Makefiles so I can tell by glancing at a single file how code gets built. (and not wade through a twisty maze of dialog boxes)

I poked around at SDCC but it doesn't appear to have PIC18F4550 support and even if it did, grumblings on the net make it sound like its PIC18 support is weak, or at best very confusing to use.

So, what's a good cross-platform command-line C-compiler with PIC18F4550 support out there?

Failing that, what's the best-of-breed C-compiler for PIC18F4550 and how does one use it with Makefiles?

Best Answer

SDCC works fine for the 18F4550. The code it produces is maybe not as compact as the expensive compilers. But recent builds of SDCC seem to be doing a pretty good job.

Here's a project I did with SDCC and the 18f2550.