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.

BeerBelly

Member
I'm new to programming in C.
Is there a free Microchip compiler for the PIC?
Is there a better free compiler recommended?
How do I get one?
 
You can use the HTC and the XC compilers for free, for ever... The "LITE" versions just don't optimize your code..

They also double you ram usage.... If you down load MPLAB IDE they come with it, AND you can use the full version for a month.

If you need to get started... I have done Nigel's ASM tutorials in C... Link's in my signature... I've also done a "Startup" guide with MPLAB IDE version 8.

https://www.electro-tech-online.com/threads/eb08.582/.


Have fun... You'll also get tons of help from all the guy's here.
 
Thanks Ian. I have been using the MPLAB for asm coding but it would not work on C. It would tell me I was missing files or they could not be located. I must just have a bad copy of MPLAB
 
Thanks Ian. I have been using the MPLAB for asm coding but it would not work on C. It would tell me I was missing files or they could not be located. I must just have a bad copy of MPLAB
You have to install XC it doesn't install by default
 
Yes! Like Burt said... But it does prompt you when you install MPLAB, but as you were using asm you probably said no at the time...

What version of MPLAB are you using... If you want to use XC compilers I think you need version 8 or newer...
 
and if you want the older version of C18, just go to the microchip forums and follow the link, I just downloaded the last version of v3.46, and don't forget to also check the compiler archive. I,m still using that version until I learn the new mplabX. Like I said "look around and have fun" you will learn more and like was stated above, ask on the forums and people WILL give you help.. :)
 
You have to install XC it doesn't install by default
Thanks be80be
I just found XC on the Microchip website. It's a big website and you can get lost if you don't know what to ask for.
What version of MPLAB are you using... If you want to use XC compilers I think you need version 8 or newer...
I'm using MPLAB IDE v8.86
.
Ian..... That's a very nice tutorial in your signature
.
Joe and Bill Thank you also, This is all helpful information.
 
I'd also go with the new XC8 compiler if I was just starting with a C compiler, I think its good for all the smaller chips as well as the pic18's, The C18 doesn't work for the smaller chips (pic12,16), but XC8 does. If I'm incorrect someone will clarify this I hope for both our sakes :) right now I use assembler for all my pic16 chips and C18 for pic18's
 
All the tutorials were done with HTC lite.... A tiny modification and they will work with XC8

I use the "__CONFIG(xxx);" command... XC8 requires the header file "pic.h" or "htc.h" to be changed to "xc.h"

and the config command is now __PROG_CONFIG( reg, value);

Reg is the config register number eg.. 1 or 2
value is the value of the config word..
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top