PIC16 C compiler
Asked Answered
I

8

5

I am looking for a good C compiler for the PIC 16 family, working on Windows.

  • A couple of colleagues use bknudc but some seem to dislike it. Apparently you cannot use the linker efficiently, and it turns out that the best is to set all code in include files.

  • SDCC seems nice, but looks like it is still in beta, and not easy to setup or to have to deal with.

  • There are quite some other options, all are the best available according to themselves. I found some forums discussing the topic and no one seem to agree with one another. MikroC, CCS (expensive), HiTech, BoostC.

I would like to have some real information on what's good and what's bad.

If I got it right, the PIC16 architecture is not really C-friendly? Is there a compiler that lets the programmer work in ANSI C anyway? And a way to setup a nice enough debugger?

Ineducation answered 23/6, 2009 at 6:49 Comment(0)
G
10

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.

Gratulant answered 23/6, 2009 at 7:2 Comment(8)
IMO any PIC is not C friendly. But +1 on the free Microchip compiler and PIC18 recommendation.Pedantry
I'm not sure how a micro-chip could get any C-friendlier than the PIC18. Please explain.Gratulant
Agreed; we used the IAR compiler for the PIC16, but the compiler had to insert a lot of code for stack management and function calls, etc. We eventually moved to a PIC18 with the Microchip compiler, which was much better.Nonesuch
I'd skip PIC18 and go directly for 24F or 33F. Cheaper, faster and with more periphery. Specially preferal pinselect is nice.Suborbital
PIC24F,33F isn't really an options for hobbyists who work with prototype bread borads and can't solder surface mounted parts.Gratulant
Shoosh - The PIC24F is available in breadboard-friendly DIP packages (20 to 28 pin configurations).Orta
As are a few odd PIC32's these days.Denver
What about price, I still see the PIc16f as the only option below $1. Some pic16f are supposed to be "C-compiler optimized" like 1705Intoxicating
F
5

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

Flash answered 23/6, 2009 at 23:53 Comment(0)
K
5

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).

Klinges answered 29/7, 2009 at 20:51 Comment(0)
S
4

I believe that SDCC now has some support for PIC16.

Subternatural answered 23/6, 2009 at 7:7 Comment(0)
W
1

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)

Worcester answered 8/7, 2009 at 0:51 Comment(0)
C
0

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.

Cerell answered 9/7, 2009 at 13:38 Comment(0)
O
0

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.

Orta answered 29/7, 2009 at 2:46 Comment(0)
B
0

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.
There is also a monthly subscription license and a functional safety license for the XC-Pro compiler available.
Info

Bureaucratize answered 12/7, 2018 at 9:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.