10

Free PIC C compiler
PIC16 C compiler

...aaaaand noone mentions gcc*. Googling lead me only to flame wars over the forums if PICs are suitable for C, and that their (at least the 6 - series) 30 instruction assemblers are very simple to learn.

Does gcc support PIC16?

* - or clang or any other popular open free compiler...if there are any others...

Vorac
  • 8,726
  • 11
  • 58
  • 101

1 Answers1

12

I don't believe it's supported and none of the PIC families are mentioned on the Status of Supported Architectures page. Note that there is some support for the PIC32 series because that's based on a MIPS M4K core. A few zero-cost options that come to mind are:

  • Microchip have a free version of MPLAB XC8 available. You'll see at the bottom of that page that the difference between the free and the paid versions is the optimization level. I've used the free version and the code generated still seems pretty decent.

  • For open source there is the SDCC - Small Device C Compiler. That supports the PIC16 series and while I've never used personally it seems to be widely recommended.

PeterJ
  • 3,705
  • 28
  • 51
  • 71
  • "I've used the free version and the code generated still seems pretty decent." I beg to differ on this point; have you looked at the actual assembly generated by freebie XC8? Lots of obvious optimizations are left out. Of course, "pretty decent" is subjective and it may be good enough for you and OP. – Lorraine Feb 14 '23 at 12:15
  • I agree with you especially on the more recent versions since I wrote this, the pro version does have a lot more optimizations. A few years ago I had something where the code generated easily fitted into code space whereas the free one was well over. – PeterJ Feb 14 '23 at 12:43