View previous topic :: View next topic |
Author |
Message |
roberto Guest
|
C compiler |
Posted: Thu Sep 09, 2004 12:33 am |
|
|
where can i found a good C compiler (free and not trial) for PIC16Fxxx MCU family ? |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Thu Sep 09, 2004 12:57 am |
|
|
I don't think there are any free C compilers available for PICs.
Hopefully someday someone will add PIC support to GCC... |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Thu Sep 09, 2004 6:06 am |
|
|
Haplo wrote: |
Hopefully someday someone will add PIC support to GCC... |
Microchip did.
Kind of.....
Microchip C30 C Compiler is GCC. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
|
bdavis
Joined: 31 May 2004 Posts: 86 Location: Colorado Springs, CO
|
|
Posted: Fri Sep 10, 2004 9:58 pm |
|
|
Hitech has a free compiler - even for commercial use. It is very limited on the chips it supports, but for free, I would recommend it if you are using one of the chips it supports... |
|
|
Trampas
Joined: 04 Sep 2004 Posts: 89 Location: NC
|
|
Posted: Sat Sep 11, 2004 7:50 am |
|
|
I always wanted to implement a metacompiler...
That is have a compiler where you could do some tricks like:
#pragma @Function printf("Function called %s\n",__FUNCTION__);
So the compiler would have pragmas for symbol tables in C. Thus in the example above in every function the compiler would add the printf() statement. This would be great for doing some debugging like you could add a printf at the start of every function to print the stack pointer.
Then you could take this a step further...
#pragma @assignment(TYPE:int,TYPE:const) //insert assembly code
Thus what happens is you can start overiding the default behavior of the compiler. So you can now add your own optimizations to the compiler.
Additionaly I have thought about adding some additional features like being about to check to see if calls to functions are constants or not. For example:
FLOAT divide(FLOAT x, FLOAT y)
{
#pragma if(TYPE:y==CONST && VALUE:y!=0)
#pragma INLINE(x/y); //replaces function call with 'x/y'
#pragma else
#pragma compilerError("Divide Zero"); //compile time error reported
#pragma endif
if(y==0)
{
//handle error
}
return x/y;
}
FLOAT bob;
FLOAT temp;
temp=divide(3,4);
bob=divide(temp,5);
Well here it would be nice if the compiler could optimize the code. Well I could place the optimizations in my code if I could tell if the parameters were constant or not. Additionally I could overide the '/' operator and use my divide function. Thus allowing me to have error checking for divide by zero.
Thus what happens is the compiler allows you to extend it's functionality and optimize it's self for the application at hand. This is my dream of true Metaprogramming. Where you write a program which writes the program. Well here you write a compiler which is used to define the compiler.
However I then start wondering if it would not be easier just to help on a GNU version of a compiler...
Trampas |
|
|
Guest
|
Re: C compiler |
Posted: Fri Oct 22, 2004 4:22 pm |
|
|
roberto wrote: | where can i found a good C compiler (free and not trial) for PIC16Fxxx MCU family ? |
http://www.picant.com/boostc/teaser.html
Regards,
Pavel |
|
|
Guest
|
|
Posted: Fri Jan 06, 2006 11:34 am |
|
|
can i get the C compiler please |
|
|
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
|
Posted: Fri Jan 06, 2006 1:02 pm |
|
|
Unknown if buggy, but worth checking out
http://sdcc.sourceforge.net/
SDCC is a Freeware, retargettable, optimizing ANSI - C compiler that targets the Intel 8051, Maxim 80DS390 and the Zilog Z80 based MCUs. Work is in progress on supporting the Motorola 68HC08 as well as Microchip PIC16 and PIC18 series. The entire source code for the compiler is distributed under GPL.
|
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Jan 06, 2006 3:53 pm |
|
|
Guest wrote:
Posted on Fri Jan 06, 2006 1:34 pm
Quote: |
can i get the C compiler please
|
following a thread ended on Fri Oct 22, 2004 6:22 pm
Still waiting... what a patience ! ! !
Humberto |
|
|
|