Society of Robots - Robot Forum

Software => Software => Topic started by: Rebelgium on November 06, 2008, 02:09:06 PM

Title: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: Rebelgium on November 06, 2008, 02:09:06 PM
Title sais it all.
I hear people complain about the PIC compilers (that they're not free etc.) but you can download MPLAB for free and a student edition of the C18 compiler for free.
I know the C18 compiler is 60 days limited, but now my C18 compiler has been limited for 30 days and I haven't even noticed it... It still compiles like it used to.
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: Half Shell on November 06, 2008, 02:41:53 PM
What Microchip does with their C30 compiler (which I've been learning of late) is turn off loop optimization after the trial period is up. Most of the other functionalities are fairly straightforward and still work fine. The C18 compiler is still doing the same thing.

My main personal beef with Microchip is their horrific windows-only software, odd driver support, and sometimes incredibly iffy hardware setup steps. Not to mention incredibly steep learning curves and hard-to-approach documentation.
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: ArcMan on November 06, 2008, 02:57:38 PM
I did read about them turning off loop optimizations after 60 days after someone pointed out that the C18 compiler was free.
Can you tell me what that means?
I've been programming in C for 20 years.  I just don't know what loop optimizations are, exactly.
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: Half Shell on November 06, 2008, 05:41:08 PM
I did read about them turning off loop optimizations after 60 days after someone pointed out that the C18 compiler was free.
Can you tell me what that means?
I've been programming in C for 20 years.  I just don't know what loop optimizations are, exactly.


This essentially means you don't need it. You are really not losing that much functionality for the most part-  I've never once missed having the optimization, and I think few people on these boards work with embedded systems complicated enough to actually warrant the use of them.
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: paulstreats on November 06, 2008, 06:35:47 PM
From a hobbyists point of view, the imposed limitations are not sufficient to compian about. Even working professionally, if you didnt want to pay for it then you could optimise your code yourself. Just put a bit more thought into it or even add in your own assembly. (yes the free license also allows for commercial development)

 The free c compilers were really a big breakthrough for pic's, before this the only free compilers used to limit the amount of code you used, limit the amount of devices you could use, and also limit the amount of onboard ram you could use.

 The reason is that pic16's were never made for c programming and their limited command set made it extremely difficult to use from a c compilers perspective. The pic18's are the same pin for pin as pic 16's only with an advanced instruction set allowing for c compilers. There are also some extra features becoming available like usb support.

 The only thing that there is to comlain about is that not enough people realise that by moving to pic 18's, 24's and 32's that there are compilers for free. Anybody who has looked into pic16's and seen the outrageous cost of a hobby compiler should really look at pic18's.

Also mplab offer full code simulation, allowing you to watch output pins, simulate pin stimulus, monitor all of the registers (including the return stack), and also show how much code space and memory your program is going to take up, allow you to animate your c code and see the assembly code working in a seperate window. FOR FREE
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: CrashOverron on November 06, 2008, 08:01:57 PM
thank you for the very elaborate reply paulstreats =]]
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: Rebelgium on November 07, 2008, 12:15:57 PM
That's what I thought.
Thanks for the info guys.

So I'm sticking with PICs for sure :D
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: Admin on November 09, 2008, 01:15:19 AM
Just an FYI, I have optimization turned off by default for the Axon and the $50 Robot. Unless you need to do some super faster processing or have memory constraint issues, optimization isn't very helpful.


Another complaint about MPLAB (well, actually most C compilers for embedded electronics) is that it doesn't follow the rules of standard C in the compiler. I don't know about the most current versions, but the older ones definitely didn't.
Title: Re: What's the problem with MPLAB and C18 compiler for PIC ?
Post by: Half Shell on November 09, 2008, 10:53:09 AM
Another complaint about MPLAB (well, actually most C compilers for embedded electronics) is that it doesn't follow the rules of standard C in the compiler. I don't know about the most current versions, but the older ones definitely didn't.

Still true, and still VERY annoying. Another one of the many reasons PICs have such a ridiculous learning curve.