PIC16 C compiler

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 15:28:28

You're right in your assessment that PIC16 is not really C-friendly. If you want to code in C you are much much better off doing it with PIC18.
Microchip gives out an excellent and free IDE and compiler called MPLAB for the PIC18. Its really easy to work work. Plus the PIC18 family is generally more powerful but has some chips with a not much larger footprint than that of the PIC16 family.
Starting to develop a new product with PIC16 is a not a good idea.

HI-TECH has a C compiler for the PIC16 and they even offer a Freeware version.
HI-TECH C Compiler

I believe that SDCC now has some support for PIC16.

I have found Hi-Tech to be very good. I'd have voted up Louis' answer if I had a better reputation. I also agree that the PIC18F is a very good alternative. Look for a k-series part as these are the newer, better, and cheaper parts. They also have very low current draw (if thats important to you).

CCS compiles for any PIC from 12, 16, 18 and upper. It is not free, but it does a hell of a job as a pic compiler. (Beats ASM any day for me)

Sourceboost BoostC is very nice C compiler for PIC12/PIC16/PIC18 series. They also have BoostC++ and BoostBasic compiler. Comes with fine IDE, has basic simulation options. I much like it over CCS and Microchip C18 syntax. Feels cleaner and less cluttered. However, it is not free either but licenses are quite cheap. Free/Lite version allows 2kB of code. With this you can already do alot.

The BKND C compiler is indeed quirky, and doesn't really support the linker well. But then, most of the PIC16 chips are small enough that it's not really a big deal to just include all your source in one C file.

I did some comparison of the BKND and HiTECH C compiler, and the BKND seems to generate significantly better code. At least in my application, this was necessary for meeting the speed/space requirements of my application on such a small MCU.

Many of the quirks of the BKND compiler (extra data types, etc) are very helpful for tuning your code to run on a small MCU. The standard C you'd write on an ARM or x86 really isn't appropriate for a tiny CPU with only a couple hundred bytes of RAM anyway.

For the larger PIC chips (18, 24F, etc) the C compiler supplied by Microchip is great.

Just for completion:

There is a really good compiler (xc8) from Microchip. The compiler comes in two version:

Free and Pro

The code from the Free version is up to 50% larger than the Pro version.
The xc8 is fine for every 8 Bit PIC (PIC10, PIC12, PIC16, PIC18, AVR (Version 2.0 and up))

The MPLAB®XC C Compiler contains a free, 60-day trial of a PRO license for evaluation when activated.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!