anybody know a good C compiler for pic10/12/16 ??

Aug 16, 2012 7 Replies

I am using HighTch Picc ( LITE ) I am retired and can't afford paying



+/- 1000 ? for the picc PRO. The LITE version loose about 40% in no optimisation and I can't fit all my code in a pic16f648a. I have been googling a while but I didn't find any free compiler ( no such thing as pic-gcc ) I won't loose a lot by moving to another micro, ATMEL avr seems interesting, there is avr-gcc. any suggestions, idea Many thanks in advances

I played with the SDCC compiler for the PIC. I gave up early when I couldn't find a lot of macros/subroutines for typical functions. Went back to PicBasic Pro. Life is too short to write all the functions I already have...or to learn the quirks of C...

If you are happy moving to a different microcontroller, then do so. Microchip PICs have a few good points (such as long-term availability), but the cpu itself is completely brain-dead. It is very difficult to write a good compiler for them (thus they are expensive) - and the code users have to write to get efficient object code is a mess of special keywords. Hobby users might like the DIP packages of PICs, but software developers are always happy to leave them behind.

AVRs are a good choice for small 8-bit devices. The avr-gcc toolchain is free, supported by Atmel (it is integrated into their IDE, and Atmel pay for some of the work on it), and generates good code.

MSP430s are another architecture to look at - and again, there is a good gcc port.

You might also want to consider moving towards Cortex-M devices if you want more processing power - free (or very cheap) gcc-based toolchains are available for most families.

I've mentioned here before. The compiler costs $0 for a limited capacity version (free download), and a single-seat unlimited professional version is $150, IIRC. A client of mine uses the compiler and bought a couple of pro licenses. ISTR only one wrinkle concerning the sizeof operator.

My preference is for gcc toolchains on non-PIC controllers, but there is that option.

Mel.

I've been using the CCS compiler for the PIC18 (also supports the smaller parts) for several years and have got good results with it.

formatting link

It's not exactly ANSI C, and has some quirks, but given the architecture that it's targeting, it does a pretty good job.

Martin

Hi Andre,

Definitely try CC5X. There is free edition too, its only limitation is less optimization. CC5X produces very compact and fast code. I am using it for years already. It supports all of the PIC10/12/16 range and more.

Details:

formatting link

HTH, Wolfgang

From-address is Spam trap Use: wolfgang (dot) mahringer (at) sbg (dot) at

Why do you need the pic16f648a chip ?

Program Memory (KB) 7 CPU Speed (MIPS) 5 RAM Bytes 256 Data EEPROM (bytes) 256 Digikey price 1 ea $ 3.04

Try PIC16F1847-I/P Program Memory (KB) 14 CPU Speed (MIPS) 8 RAM Bytes 1,024 Data EEPROM (bytes) 256 Digikey price 1 ea $ 2.10

With all the newer versions from Microchip, you can find a higher capacity chip for less.

This is whats nice about PIC family processors.

Run out of room, get the next higher model, save money.

Now, if you are building 1000s of units where each penny is counted.......

Good Luck

hamilton

=20

I'll put in a second vote for CCS. I've been using it for quite a few years= as well and it does produce really compact code once you learn some of the= oddities. (For example there's an "int1" data type which actually declares= a one bit variable which gets set/cleared using single BSF/BCF instruction= s)=20

If you want to use the IDE instead of the command line, try to get the old = version 3.249 instead of the newer 4.xxx since that IDE is so incredibly bu= ggy it's virtually unusable. The compiler itself is good in both versions t= hough.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required