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.

C compiler

Status
Not open for further replies.

leonel

New Member
Hi.
I have c code to pic18f458. Usually i "write" in basic, so i've PICbasic PRO compiler. I don't want to buy a C compiler such as CCS, only because just one C code.
Do you know any good free c compiler to pic18f458?
 
microchip's C18 is free and fully functional for 3 months. after that it limits some optimization, but for most things its probably adequate.
 
I already made the download of microchip's C18. I'll try it, but i thing that some commands from ccs are incompatible in C18.
 
Hi,
Yes, some things may port easily from CCS to C18, but some of the built in functions could be quite difficult to port. CCS is protecting their interests, and hides what it does in these built-ins. Which code is giving you a hard time? Perhaps if you posted your code, you could get some help with it.
Regards,
Robert
 
raedbenz said:
mplab compiles p18 family with C language,,,

Not quite. MPLAB is the development environment for Microchip products. C18 is the compiler for PIC18's and is not included with MPLAB.
 
if u open microchip --> project --> set language tools then choose microchip C18......
 
raedbenz said:
if u open microchip --> project --> set language tools then choose microchip C18......

Which will only work if you have installed C18 because it is not included with MPLAB.
 
BeeBop said:
Hi,
Yes, some things may port easily from CCS to C18, but some of the built in functions could be quite difficult to port. CCS is protecting their interests, and hides what it does in these built-ins. Which code is giving you a hard time? Perhaps if you posted your code, you could get some help with it.
Regards,
Robert

CCS's reliance on "built-in" functions means you're not writing C really.
C18 (aka MCC18) has libraries, they're not "built-in" per se. Many C programmers recommend against using such libraries or built-ins. As you noted, they aren't portable between compilers. Now you can't really even use a lib function for say setting up an ADC or PWM unless you read the PIC manual and understand how the ADC or PWM module works. If you didn't, you'd just be making guesses at what the lib function's fields were for.

Once you've read the manual, it's not hard at all to just put in register writes to use the module. So, why use such function at all?

AFAIK MCC18 libs are uncompiled C code, so you can snoop into them and see what they're doing. That will either allow you to understand what it does so you can use it appropriately, or make your own code that does what you need.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top