Reply by David Brown September 15, 20102010-09-15
On 15/09/2010 04:44, larwe wrote:
> On Sep 14, 10:32 pm, Kari Laine<klai...@gmail.com> wrote: > >> I have been cursing this also. I haven't found much competition with >> Microchip. I study PIC32s and only two compilers I have found are from >> Microchip, namely HI-Tech and PIC32-gcc. Both very expensive from >> student point of view. Does MicroChip have student pricing option? >> >> There is a good GPL tools for Atmel stuff. Why there aren't such for PICs? > > There are options, just not good options. Low end PICs aren't meant to > run C, and getting semi-usable code into them is specialized. dsPIC is > a limited market product (ish, this is an oversimplification). > > As for PIC32, it is really nothing to do with PIC, just MIPS... gcc > supports the core just fine. And in fact Microchip's compiler is gcc, > and you can obtain the sources and re-enable the optimizations if you > wish. >
That's sort of correct. Microchip's PIC32 /compiler/ is gcc, since the core is MIPs. And gcc is under the GPL, and available from Microchip in source form, and can be re-compiled with optimisations enabled and licensing limitations disabled. It is also possible to use other MIPs compilers (such as gcc from other sources) with the devices. But Microchip's /libraries/ for the PIC32 are not open in any sense of the word. They are specifically licensed for use with the PIC32-gcc binaries from Microchip, and may not be used with a re-compiled version with licensing restrictions disabled. This is designed as a way to force people to Microchip them for the gcc compiler tools that Microchip obtained freely and openly. Apparently this legal, but IMHO it is unethical and against the spirit of the gcc licensing. I have no problem with tool vendors charging for their software, or for support or other services. I would have no problem with Microchip charging for their libraries. But I /do/ have a problem with companies taking other companies' and people's software and passing it off as their own software and charging people as though that were the case.
> Microchip does have student pricing - register at microchip.com with > a .edu email address and you get 25% off dev tools (software and > hardware), plus free (no shipping even) samples - two orders per > month. > > Most students, even EEs, are quite happy with the lite compiler.
Reply by larwe September 14, 20102010-09-14
On Sep 14, 10:32=A0pm, Kari Laine <klai...@gmail.com> wrote:

> I have been cursing this also. I haven't found much competition with > Microchip. I study PIC32s and only two compilers I have found are from > Microchip, namely HI-Tech and PIC32-gcc. Both very expensive from > student point of view. Does MicroChip have student pricing option? > > There is a good GPL tools for Atmel stuff. Why there aren't such for PICs=
? There are options, just not good options. Low end PICs aren't meant to run C, and getting semi-usable code into them is specialized. dsPIC is a limited market product (ish, this is an oversimplification). As for PIC32, it is really nothing to do with PIC, just MIPS... gcc supports the core just fine. And in fact Microchip's compiler is gcc, and you can obtain the sources and re-enable the optimizations if you wish. Microchip does have student pricing - register at microchip.com with a .edu email address and you get 25% off dev tools (software and hardware), plus free (no shipping even) samples - two orders per month. Most students, even EEs, are quite happy with the lite compiler.
Reply by Kari Laine September 14, 20102010-09-14
On 09/12/2010 10:06 PM, larwe wrote:
> On Sep 12, 2:40 pm, "embcontrol" <navasimoN@n_o_s_p_a_m.gmail.com> > wrote: > >> Hi! thanks for your reply! It's not for commercial applications. I am aware >> that I can use the evaluation version, but I as we know, it's limited. Do >> you know of any other C compilers that would allow me to write the C code, >> and somehow that it can generate the assembly code so that I can then copy > > That is basically what a C compiler does. So what you are looking for > is... tada... a C compiler. > > Just download the lite version and see if it works. I see no evidence > that the limitations actually are known to be a problem for you.
I have been cursing this also. I haven't found much competition with Microchip. I study PIC32s and only two compilers I have found are from Microchip, namely HI-Tech and PIC32-gcc. Both very expensive from student point of view. Does MicroChip have student pricing option? There is a good GPL tools for Atmel stuff. Why there aren't such for PICs? Have anyone hacked the Microchip compilers....:-))) Best Regards Kari -- PIC - ARM - Microcontrollers - I2C - SPI Keypads - USB-RS232 - USB-I2C - Accessories http://www.byvac.com I am just a happy customer
Reply by David Brown September 13, 20102010-09-13
On 12/09/2010 13:29, larwe wrote:
> On Sep 11, 2:19 pm, Leon<leon...@btinternet.com> wrote: > >>> Microchip's compilers are free without optimization. >> >> And you can use the evaluation version of the full compiler free for >> 60 days. I don't think you are supposed to use it for commercial >> applications, though. > > I don't think you'd want to use a time-limited eval for a commercial > application :) but (a) the OP doesn't make it clear (to me) that it is > a commercial application, and (b) the lite version is OK for > commercial use. > > Optimization is nice, but if I have a piece of code that won't work > properly with optimization off, I'd call it a buggy/poorly written > piece of code, or running too close to the micro's limits.
Optimisations change several things - code size, and code speed are the main differences. They will also change stack usage and perhaps ram usage in general. If your code acts in a different way with different optimisation settings, other than in size and speed, then I agree your code is bad. Certainly code that fails when optimised is almost certainly buggy code. But the speed difference between optimised code and unoptimised code can be very large - depending on the code in question and the compiler, you could be talking about several times speed differences. That's well out of the range of "pushing the limits". If we were talking about squeezing the last 5% performance out of the device, I'd agree - but the difference between -O0 and -Os or -O2 optimisation on many compilers is very large. I don't know this particular compiler, but for many compilers -O0 will cause the compiler to generate every local variable on the stack, while with -O2 many will be in registers or eliminated altogether for /much/ better generated code. Additionally, people who don't use decent optimising compilers tend to write code that is full of "manual" optimisations (such as using pointers when they really mean array access, or "while (--i) loops" when a "for" loop is clearer and neater). With a decent compiler, you can write clearer code and let the compiler do the dirty work.
Reply by larwe September 12, 20102010-09-12
On Sep 12, 4:01=A0pm, Hans-Bernhard Br=F6ker <HBBroe...@t-online.de>
wrote:
> On 12.09.2010 20:52, Frank Buss wrote: > > > Why do you want to do this? You don't have to program in assembler for =
the
> > PIC microcontrollers, you can use just C. > > Careful there. =A0You may have fallen into Microchip's trap of > mislabelling all kinds of CPUs as "PIC", whether they have any relation > to the actual PIC or not. =A0The OP's dsPIC is a prime example of that > scheme of mischievous misdenomination.
Oh, he's still right though. You CAN program say a 12C509 in C. You just probably wouldn't want to :)
Reply by September 12, 20102010-09-12
On 12.09.2010 20:52, Frank Buss wrote:

> Why do you want to do this? You don't have to program in assembler for the > PIC microcontrollers, you can use just C.
Careful there. You may have fallen into Microchip's trap of mislabelling all kinds of CPUs as "PIC", whether they have any relation to the actual PIC or not. The OP's dsPIC is a prime example of that scheme of mischievous misdenomination.
Reply by larwe September 12, 20102010-09-12
On Sep 12, 2:40=A0pm, "embcontrol" <navasimoN@n_o_s_p_a_m.gmail.com>
wrote:

> Hi! thanks for your reply! It's not for commercial applications. I am awa=
re
> that I can use the evaluation version, but I as we know, it's limited. Do > you know of any other C compilers that would allow me to write the C code=
,
> and somehow that it can generate the assembly code so that I can then cop=
y That is basically what a C compiler does. So what you are looking for is... tada... a C compiler. Just download the lite version and see if it works. I see no evidence that the limitations actually are known to be a problem for you.
Reply by Frank Buss September 12, 20102010-09-12
embcontrol wrote:

> Hi! thanks for your reply! It's not for commercial applications. I am aware > that I can use the evaluation version, but I as we know, it's limited. Do > you know of any other C compilers that would allow me to write the C code, > and somehow that it can generate the assembly code so that I can then copy > and paste it in MPLAB. I know it's not as simple as it sounds but this is > just a basic description of what I am looking for.
Why do you want to do this? You don't have to program in assembler for the PIC microcontrollers, you can use just C. And it is not a commercial project, so if it is really too slow or too large, buy a bigger chip :-) There are some nice microcontrollers with ARM cores, for which the support is very good from GCC. And GCC can create optimized code. Depending on your application, the difference in size and speed between -O0 and -O2 for the ARM target can be a factor > 2. If you really want the assembler code: most C compilers provides a "listing" output (with some switches), with addresses and assembler code, and other intermediate files. -- Frank Buss, http://www.frank-buss.de piano and more: http://www.youtube.com/user/frankbuss
Reply by embcontrol September 12, 20102010-09-12
>On 11 Sep, 15:09, larwe <zwsdot...@gmail.com> wrote: >> On Sep 10, 9:15=A0pm, "embcontrol" <navasimoN@n_o_s_p_a_m.gmail.com> >> wrote: >> >> > I am looking for a C compiler that it's free or reasonable in price to
=
>be >> > able to program the dsPIC33F with the components mentioned. I looked
at=
> the >> > MPLAB C30 C compiler but the price is to high for my range. Is there >> >> Microchip's compilers are free without optimization. > >And you can use the evaluation version of the full compiler free for >60 days. I don't think you are supposed to use it for commercial >applications, though. >
Hi! thanks for your reply! It's not for commercial applications. I am aware that I can use the evaluation version, but I as we know, it's limited. Do you know of any other C compilers that would allow me to write the C code, and somehow that it can generate the assembly code so that I can then copy and paste it in MPLAB. I know it's not as simple as it sounds but this is just a basic description of what I am looking for. Any thoughts on this? Thanks again! --------------------------------------- Posted through http://www.EmbeddedRelated.com
Reply by larwe September 12, 20102010-09-12
On Sep 11, 2:19=A0pm, Leon <leon...@btinternet.com> wrote:

> > Microchip's compilers are free without optimization. > > And you can use the evaluation version of the full compiler free for > 60 days. I don't think you are supposed to use it for commercial > applications, though.
I don't think you'd want to use a time-limited eval for a commercial application :) but (a) the OP doesn't make it clear (to me) that it is a commercial application, and (b) the lite version is OK for commercial use. Optimization is nice, but if I have a piece of code that won't work properly with optimization off, I'd call it a buggy/poorly written piece of code, or running too close to the micro's limits.