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 XC who has tried it.

Status
Not open for further replies.

be80be

Well-Known Member
I was thinking about using the new Mplab XC for the 12f , 16f, and 18f chips has anyone gave this a shot and how well do you like it.
 
I was thinking about using the new Mplab XC for the 12f , 16f, and 18f chips has anyone gave this a shot and how well do you like it.

II might give it a go aswell!!! I already use htc anyway.... Can't be much different.
 
Post removed--misunderstood the post
 
Last edited:
There Not one sample or even a getting started guide with MPLAB XC
 
I've been using it with MPLAB X IDE. Not certain what to say about it, since I don't have a lot of experience with PIC compilers. It works fine. It's gone through a lot of revisions recently, just like the IDE. People might want to wait another couple months or so for things to die down, but I haven't found any bugs in the relatively simple programs I've created with it.
 
Last edited:
I've used it with MPLAB 8.86. Much like Hitech C, except you can also use the REGNAMEbits.BITNAME = format like in C18 as well as BITNAME = like in Hitech. Almost like C18 meets Hitech C.

For most applications, you can just #include <xc.h> and it will automatically use the correct header file for the processor you selected in the project properties.
 
It's like take your pick did i want to code as for Hi-tech C or do I Like C18 today. From there forum there no documentation. for XC at all you get a link to let you write your own and post it for them. maybe after we do all the work they will give us a full copy. Na we have to pay to make it better for every one else. I don't see the mass of hobby people jumping in on this.
 
Jon if you don't care post a simple blink code showing the configure I set them in mplab. This you can't set that way.
 
Hey Burt... I decided to wait awhile for a more mature MPLAB X version. In the mean time, I did install the XC compiler in my MPLAB v8.84 IDE. So far, the 'free' XC compiler output is just as bad as the old 'free' HTC output. For example, a program compiled with the 'free' version of BoostC is about 50% smaller than the same program compiled with 'free' XC8 (ouch!).
 
Last edited:
Thanks Mike I look every where didn't find anything about using it with Mplab v8.83. So i guess I can use it with it.

I downloaded the latest MPLAB X and the XC I really don't see anything great about it and selling a beta is lame and it still looks beta to me.

There probably a lot of people would use this but documentation is a after though. And I need all the documentation I can find now days this gunk I take for my sugar diabetes makes it hard to stay focused.
 
Sure thing -

Code:
#include <xc.h>

__CONFIG(LVP_OFF & FCMEN_OFF & IESO_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_INTOSCIO);

void main(void)
{
	PORTA = 0;		// clear port a latch
	while(1)		// loop forever
	{
		TRISAbits.RA0 = 1;	// tristate RA0
		__delay_ms(250);	// 1/4 sec delay
		TRISAbits.RA0 = 0;	// output driver on
		__delay_ms(250);	// 1/4 sec delay
	}
}
 
Last edited:
Thanks Jon I was using the wrong #include <xc.h> I think I installed this to only let me use XC.

Thanks Burt
 
I like both mplab x and xc more than the old mplab 8 and c18/htc. It's nice to have one compiler for all the 8-bit devices. Code size seems to be as bad/good as with c18/htc, I haven't really compared. Works well for what I need. MplabX is much more modern and has a nicer UI (netbeans). There are some bugs. For example the build button is grayed out sometimes without a reason. It can be fixed by changing the source file tab. I would still use x over 8 anyday.

Documentation? All I needed was here: www.microchip.com/mplabxc8guide (first hit on google "xc8 document")
 
That pdf is about setup of the compiler and it's not much good there not anything in it that show how to start a project with XC maybe you need to read it. hantto my google works just like your and there is by no means
You may not need much I may not need much but for some one just starting I think you would want a Getting started with XC C18 has one Hi-tech had one .
 
Hey Burt,

When I have an XC8 project open in my MPLAB v8.84 environment, there is a link to the Microchip XC8 C Compiler User's Guide (518 pages) that shows up in the Project tab. Can you take a look at that document and let us know if it's any help?

Happy Holidays, Mike
 
Last edited:
I downloaded the latest MPLAB X and the XC I really don't see anything great about it and selling a beta is lame and it still looks beta to me.

Well I disagree that the actual XC compiler itself is beta. It is an "improved" version of the HiTech compiler which is very good.

When I evaluated HiTech, C18 and BoostC a few years back I much preferred HiTech. In summary (my opinions only)

- BoostC had an annoying limitation at the time where you couldn't create large (>1MB I think) arrays in memory. This may well have been fixed.
- The variable namings in C18 always annoyed me and I found it created worse code than HiTech.

Having said these things I do agree with two points raised in this thread. Firstly the selling point of HiTech was always the optimisation. I am almost convinced that the compiler goes out of its way to create "bad" code when run with all optimisation disabled. However during the 30 day trial with full optimisation enabled it seems to work a charm.

Secondly the "transition" to XC8 has really messed up the compiler. They added a whole bunch of nasty C18 compatible #defines, removed all the names I like, then enabled some sort of compatibility mode (you can use either configuration mechanism, but MPLABX seems to highlight them in red). Also I completely agree that the documentation is awful. I was happy with slightly poor documentation from HiTech, but now that Microchip have bought them out I expected better. Even just some basic tutorials would help people get going.
 
Well like always guess what the file now open something useful now, But before I got a link to write your own.

I got it rolling now still don't like MPLAB X pickit2 doesn't work got to have my pickit2

Code:
/* 
 * File:   newmain.c
 * Author: Burt
 *
 * Created on November 24, 2012, 10:49 PM
 */
#include <xc.h>


/*
 * 
 */
#pragma config OSC = IntRC, MCLRE = OFF, WDTE = OFF, CP = OFF
void delay() {
    int counter = 0;
    for (counter = 0; counter<10000; counter++) {
        
    }
}
void main(void) {

   TRIS = 0x00;
   GPIO = 0x00;
         while(1) {
   GPIO =~ GPIO;
          delay();
         }













}
 
I got it rolling now still don't like MPLAB X pickit2 doesn't work got to have my pickit2

I've used the PICkit 2 just fine in MPLAB X. However, I never could get the debugger to work with the PICkit 2 consistently. Ended up going back to MPLAB 8 because of that.

Not that I use the debugger much, but nice to have it available.
 
Status
Not open for further replies.

Latest threads

Back
Top