Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MPLAB C compilers

Status
Not open for further replies.

masoud23

New Member
Hi
I am a beginner to micro programming but have some experience of C programming. I have just downloaded and installed MPLAB IDE v8.66 and start reading in MPLAB IDE user’s guide. Now I have no experience on assembler programming and not so interested to learn it! I want to use C from the beginning. Now I haven’t read all in user guide but I have to know this right away! Are in MPLAB IDE v8.66 tools included for writing and compiling C? If so what is the use for MPLAB C compilers? If not so is there any free C compiler that is particularly suitable to use together with MPLAB IDE v8.66.

Tanks in advance
 
MPLAB does not include compilers but gives you the option to install some C compilers during MPLAB installation. These are separate products and not part of MPLAB.

There are no 'free' compilers but there are version that can be used without cost.
 
but how about the hi-tech picc 9.81 comes with the mplab-ide 8.66 , free of charge ? ... cannot use it as a c compiler for mplab ? ...
 
but how about the hi-tech picc 9.81 comes with the mplab-ide 8.66 , free of charge ? ... cannot use it as a c compiler for mplab ? ...

I had the hi-tech C compiler downloaded with MPLAB automatically. You should be able to use that. You can also download a student version of C18 from the microchip website if you are using an 18F chip. There are a few others that you can download for free, as well.
Der Strom
 
Last edited:
I had the hi-tech C compiler downloaded with MPLAB automatically. You should be able to learn that. You can also download a student version of C18 from the microchip website if you are using an 18F chip. There are a few others that you can download for free, as well.
Der Strom

i just tried to launch the 9.81 hi-tech c complier for pic 10/12/16 , it's not a freeware , it needs a s/n to be activated to a standard or pro version ... i need also a complier for pic 18 , since i think i'm going to learn how to interface the pc / pic 18f4550 with the usb connection ...
 
There are two standard and lite, you need to install the lite version (from hitech), Also you need to install the student version of C18 (from the microchip web site ) both require you to register.

cheers Ian
 
There are two standard and lite, you need to install the lite version (from hitech), Also you need to install the student version of C18 (from the microchip web site ) both require you to register.

That is correct. At least the registration is free :D
 
Hi,

Another newbie question on the subject of MPLAB C compilers that sort of follows on from this one:-

I'm starting to learn C to program an 18F PIC; I've installed both of the above free Microchip C compilers and need to choose which one to start learning with.

Has anyone got a view which is the better one to learn?

Or as they're both Microchip compilers, is Microchip likely to discontinue one of them in the near future? (in which case I'd do well to learn with the other)

Any advice welcome. Thanks

mab2
 
All C compilers are supposed to be ANSI compliant (or as near as dam it) I use Hi-tec for pic12 and pic16 and I use C18 for pic18 and C24 for pic24. Yes there are subtle differences between them but you soon get the hang of them, they ALL have very good documentation and I don't think Microchip will ditch C18 any time soon.

Cheers Ian
 
I think C18 is a good compiler to start with, but I suppose I'm a bit biased--That's the only one I've used so far :D I have not yet found any problems with it, though.
Der Strom
 
Don't feel like you must use Microchip compilers, either. You can use third party compilers and integrate them into MPLAB in the same way that the Hitech and C18/C24/C32 Microchip are.

For a long time I used BoostC. It's not as polished as the Microchip compilers, and is a little restrictive in some areas, but is fantastic value for money. Even if you purchase the professional version (which allows commercial use) the cost is very reasonable. There is a free version you can try too.
This may be a factor for you to consider if you ever intend to produce your own products in the future. The Microchip (and Hitech) compilers cost thousands of pounds, and are really out of reach for the budding "garage/basement Engineer". The commercial version of BoostC costs under a couple of hundred pounds.

The Microchip compilers are better, but they're not anywhere near as good value for money as BoostC is.

Brian
 
Last edited:
The Microchip (and Hitech) compilers cost thousands of pounds, and are really out of reach for the budding "garage/basement Engineer".

I got the student (freeware) version of C18. I guess after 90 days, some of the special features become unavailable, but it should still work fine for "garage/basement Engineers" :D
 
Thanks for your replies.

I'm not planning anything commercial at this stage - just a diy renewable energy battery management system for my own use.

I've got as far as reading an ADC channel with interrupts and converting the 10bit result to decimal digits and outputting to an LCD display using assembler, but balked at trying to do all the voltage & current calcs in assembler - hence moving to C.

Based on what's been said I should probably stick with Microchip (free) versions as I need the most reliable compiler for learning C, I'm thinking probably C18 as I'm using an 18F4520.

cheers

mab2
 
I'm using C18 in a similar project. A big gotcha is stack overflows when passing lots of data in functions and complex math (floats) while a ISR is switching contexts. I spent a huge amount of time chasing my tail until I got this under control. You have to sometimes declare large variables in a global scope instead of using function scoping just to make it fit with a 256 byte stack. I'm now working with a PIC32 module as a host controller for the system that's a dream compared to the 8 bit environment.
 
C18 is a very good compiler once you know its limits on a 8 bit processor. My pic18f8722 flash code size is >64K with less than 256 sram left. It's amazing what you can pack on those chips.

solar project
 
I got the student (freeware) version of C18. I guess after 90 days, some of the special features become unavailable, but it should still work fine for "garage/basement Engineers" :D

Yeah I think after the 90 days you're restricted in terms of code optimisations. This may or may not be a problem, depending on your application.

The problem is that if you're hoping to do a homebrew project and then sell it as a kit (or as a completed unit), you're not strictly allowed to do that using the free version of Microchip's compiler. In order to be legally allowed to do that, you have to purchase a version with commercial permissions - which is where the thousands of pounds comes into it. For the garage/basement Engineer who's doing it mainly for the fun of it and hoping to maybe sell a few projects here and there along the way, it doesn't make sense to spend that sort of money on a compiler. There are plenty of other things you could spend that on first!

That's where Sourceboost's compilers come in to play. I purchased a fully licenced version of their compiler (with commercial permissions) for just over £100 I think. Very reasonable, and within the reach of hobbyists. If you don't care about commercial permissions but still want the optimisations, you can get an even cheaper version.

Of course, the fact that you're not strictly allowed to use Microchip's free version of the compiler for commercial purposes doesn't necessarily stop you. It's not strictly legal, but if all you're doing is selling a couple of homebrew projects here and there... well you're not likely to be hunted down and caught really are you. On the other hand, if you're a big company selling professional products using their compiler, then that's where you really need to be buying the commercial licence.

Anyway, the op has stated that he doesn't care for commercial permissions so I guess the point is moot. But it is something worth considering if you're planning to marry yourself to a specific compiler and you want commercial permissions in the long run.

Having experienced both Microchip's compilers and Sourceboost's compilers, then I would say that Microchip's compilers are much more friendly to work with. So if you're happy to use the cripplied version of Microchip's compiler than you're probably better off sticking with it because it's definitely a better product.
On the other hand, if you want your code to be efficient, or you want a commercial licence, but you're only a hobbyist, Sourceboost is for you.

Brian
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top