C Compiler comparison for PIC18?
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
C Compiler comparison for PIC18?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System
Author Message
Izak van Langevelde
Guest





Posted: Sun Dec 04, 2005 1:15 am    Post subject: C Compiler comparison for PIC18? Reply with quote

Does anyone out there know about a decent c compiler which targets the
pic18 family? So far, I played with the Sourceboost C compiler and the
Microchip C18 compiler, I'm happy with none of these, am willing to
spend some money on something really good, but won't waste my time on
buying and trying...

--
Grinnikend door het leven...
Back to top
Thad Smith
Guest





Posted: Sun Dec 04, 2005 1:15 am    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

Izak van Langevelde wrote:

Quote:
Does anyone out there know about a decent c compiler which targets the
pic18 family? So far, I played with the Sourceboost C compiler and the
Microchip C18 compiler, I'm happy with none of these, am willing to
spend some money on something really good, but won't waste my time on
buying and trying...

It's hard to say without knowing your criteria. What were the problems
with the ones your tried? I have been satisfied with HiTech, but it is
more expensive.

--
Thad
Back to top
Izak van Langevelde
Guest





Posted: Sun Dec 04, 2005 3:50 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

In article <43923d9d$0$226$892e0abb@auth.newsreader.octanews.com>,
Thad Smith <ThadSmith@acm.org> wrote:

Quote:
Izak van Langevelde wrote:

Does anyone out there know about a decent c compiler which targets the
pic18 family? So far, I played with the Sourceboost C compiler and the
Microchip C18 compiler, I'm happy with none of these, am willing to
spend some money on something really good, but won't waste my time on
buying and trying...

It's hard to say without knowing your criteria.

True, that's why I'm looking for a decent comparison, which addresses
things like quality and quantity of code, ansi compliance, ease of use,
support.

Quote:
What were the problems with the ones your tried? I have been
satisfied with HiTech, but it is more expensive.

The Sourceboost C Compiler has generated incorrect code on several
occasions, probably because I declared a variable with a name already in
use by the compiler; changing the variable name solved the problem. I
cannot trust it.

The Microchip C18 compiler seems to have a steep learning curve. For
instance, I spend a few days to compile things which worked when
compiled from sourceboost, but fail to work through C18. For instance,
you have to pin your ISR at the right location in memory yourself, while
this is one of the things I'd like to delegate to a compiler/linker.
This is not to say C18 doesn't generate correct code, but it takes some
effort to get it up and running.

--
Grinnikend door het leven...
Back to top
Guest






Posted: Sun Dec 04, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

Izak van Langevelde wrote:
Quote:
In article <43923d9d$0$226$892e0abb@auth.newsreader.octanews.com>,
Thad Smith <ThadSmith@acm.org> wrote:

Izak van Langevelde wrote:

Does anyone out there know about a decent c compiler which targets the
pic18 family? So far, I played with the Sourceboost C compiler and the
Microchip C18 compiler, I'm happy with none of these, am willing to
spend some money on something really good, but won't waste my time on
buying and trying...

It's hard to say without knowing your criteria.

True, that's why I'm looking for a decent comparison, which addresses
things like quality and quantity of code, ansi compliance, ease of use,
support.

What were the problems with the ones your tried? I have been
satisfied with HiTech, but it is more expensive.

The Sourceboost C Compiler has generated incorrect code on several
occasions, probably because I declared a variable with a name already in
use by the compiler; changing the variable name solved the problem. I
cannot trust it.

The Microchip C18 compiler seems to have a steep learning curve. For
instance, I spend a few days to compile things which worked when
compiled from sourceboost, but fail to work through C18. For instance,
you have to pin your ISR at the right location in memory yourself, while
this is one of the things I'd like to delegate to a compiler/linker.
This is not to say C18 doesn't generate correct code, but it takes some
effort to get it up and running.

--
Grinnikend door het leven...

Yeah all the compilers out there for PICs have a pretty steep learning
curve. For me most of the learning was figuring out how to configure
all the different IO functions. Once you play with PICs for a while you
get used to how they do stuff, but even then you'll get caught when
Microchip does something a little different in a newer version of a
chip.

The C18 compiler (from Microchip) has the advantage of being free if
you are only using it for personal use (download the student version).
It costs about $500 for commercial use. It is a bit weird to get used
to, but generates pretty solid code. The weirdness is mostly due to the
harvard architecture of PICs. Compilers that insulate you from that
will be making assumptions that may not work all that well for you.

For example, the CCS PCH compiler handles tables in ROM differently
than C18. PCH always calls a subroutine when accessing constant data.
This can really slow down processing done in a loop. C18 on the other
hand uses the TBLPTR register directly to access constant data. C18
actually generates code that's both smaller and runs faster than PCH if
you are doing something like reading through a table that's stored in
ROM.

PCH is probably a pretty good choice for PIC novices. The price is
around $100. They have lots of library functions to help with setting
the chip up. And lots of examples for standard stuff like writing to a
LCD display, RS-232 communications, using an external I2C eeprom, etc.
But their code is going to be a bit larger than what C18 generates. And
some of their IO init functions are order dependent, which if you are a
beginner is a real pain to figure out. Follow their examples if you can
find one that is sort of like what you want to do.

I've done commercial products using the CCS PCH compiler. It's solid
enough for that if you keep checking the compiler's output. I've ported
some projects to C18 to see how it stacks up. For my next new project
I'm leaning toward using C18.

Mark
Back to top
Izak van Langevelde
Guest





Posted: Sun Dec 04, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

In article <1133708948.055663.79770@g49g2000cwa.googlegroups.com>,
mhahn@hvc.rr.com wrote:

Quote:
Once you play with PICs for a while you
get used to how they do stuff, but even then you'll get caught when
Microchip does something a little different in a newer version of a
chip.

I heard this more than once: is there any reference available for
differences between chip versions?

--
Grinnikend door het leven...
Back to top
Jim
Guest





Posted: Sun Dec 04, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

Quote:
I've done commercial products using the CCS PCH compiler. It's solid
enough for that if you keep checking the compiler's output. I've ported
some projects to C18 to see how it stacks up. For my next new project
I'm leaning toward using C18.

Mark


Just to add. I have used CCS compilers professionally for a few years and
also was considering C18 for future projects. So I ported working CCS code
to C18. The fiddly interrupt methodology (where you have to know which
registers your ISR is going to use so that you can save them on entry), was
a bit of a joke. Hitec & CCS hide you from this (unless you specifically
don't want them to). The latest version of the C18 compiler was supposed to
address some of the ISR issues. However, they have only gone part of the way
which in my opinion is even worse. My Microchip FAE is still looking into a
problem where high ISRs corrupt some registers on exit from the high ISR
when the high ISR interrupts a low ISR. It has been appeox. 2 months and
they are still scratching heads.

In some cases the CCS compiler was much better at producing smaller code. I
didn't expect this as I have always been of the opinion that the CCS
compiler is a bit 'cheasy'. Anyway, at the moment I have decided not to
comit to using the C18 compiler until the known issues are fixed.

Hitec is similar is many ways to the C18 compiler but with much better C
friendly interrupt handling (if you so choose). Hitec has a good reputation
and I must say that I have never had any problems with it... ever.

My 2p worth = Hitec is best, then CCS, then others.

Jim
Back to top
Chris Hills
Guest





Posted: Sun Dec 04, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

In article <eezacque-79A5A0.11501804122005@news1.news.xs4all.nl>, Izak
van Langevelde <eezacque@xs4all.nl> writes
Quote:
In article <43923d9d$0$226$892e0abb@auth.newsreader.octanews.com>,
Thad Smith <ThadSmith@acm.org> wrote:

Izak van Langevelde wrote:

Does anyone out there know about a decent c compiler which targets the
pic18 family? So far, I played with the Sourceboost C compiler and the
Microchip C18 compiler, I'm happy with none of these, am willing to
spend some money on something really good, but won't waste my time on
buying and trying...

It's hard to say without knowing your criteria.

True, that's why I'm looking for a decent comparison, which addresses
things like quality and quantity of code, ansi compliance, ease of use,
support.

ANSI or ISO support?
BTW most compilers only go as far as ISO C 90 + A1 and the TC's not to
ISO C99

BTW given that you are on a PIC ISO C compliance is almost irrelevant.


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ chris@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Back to top
Spehro Pefhany
Guest





Posted: Sun Dec 04, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

On Sun, 4 Dec 2005 15:26:31 +0000, the renowned Chris Hills
<chris@phaedsys.org> wrote:

Quote:
In article <eezacque-79A5A0.11501804122005@news1.news.xs4all.nl>, Izak
van Langevelde <eezacque@xs4all.nl> writes
In article <43923d9d$0$226$892e0abb@auth.newsreader.octanews.com>,
Thad Smith <ThadSmith@acm.org> wrote:

Izak van Langevelde wrote:

Does anyone out there know about a decent c compiler which targets the
pic18 family? So far, I played with the Sourceboost C compiler and the
Microchip C18 compiler, I'm happy with none of these, am willing to
spend some money on something really good, but won't waste my time on
buying and trying...

It's hard to say without knowing your criteria.

True, that's why I'm looking for a decent comparison, which addresses
things like quality and quantity of code, ansi compliance, ease of use,
support.

ANSI or ISO support?
BTW most compilers only go as far as ISO C 90 + A1 and the TC's not to
ISO C99

BTW given that you are on a PIC ISO C compliance is almost irrelevant.

Well, there is at least one that has 8-bit ints... 8-(


Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
Back to top
Izak van Langevelde
Guest





Posted: Sun Dec 04, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

In article <WU93mdEnqwkDFAkm@phaedsys.demon.co.uk>,
Chris Hills <chris@phaedsys.org> wrote:

Quote:
In article <eezacque-79A5A0.11501804122005@news1.news.xs4all.nl>, Izak
van Langevelde <eezacque@xs4all.nl> writes
In article <43923d9d$0$226$892e0abb@auth.newsreader.octanews.com>,
Thad Smith <ThadSmith@acm.org> wrote:

Izak van Langevelde wrote:

Does anyone out there know about a decent c compiler which targets the
pic18 family? So far, I played with the Sourceboost C compiler and the
Microchip C18 compiler, I'm happy with none of these, am willing to
spend some money on something really good, but won't waste my time on
buying and trying...

It's hard to say without knowing your criteria.

True, that's why I'm looking for a decent comparison, which addresses
things like quality and quantity of code, ansi compliance, ease of use,
support.

ANSI or ISO support?

Tech support, i.e. responsive people who know what they are talking
about.

Quote:
BTW most compilers only go as far as ISO C 90 + A1 and the TC's not to
ISO C99

BTW given that you are on a PIC ISO C compliance is almost irrelevant.

If I write code I appreciate some level of agreement about what it
should do, this is where standards come in handy.

--
Grinnikend door het leven...
Back to top
John Temples
Guest





Posted: Mon Dec 05, 2005 12:40 am    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

On 2005-12-04, Izak van Langevelde <eezacque@xs4all.nl> wrote:
Quote:
True, that's why I'm looking for a decent comparison, which addresses
things like quality and quantity of code, ansi compliance, ease of use,
support.

I put this together last year:

http://www.xargs.com/pic/picc18-vs-c18.html

--
John W. Temples, III
Back to top
Thad Smith
Guest





Posted: Mon Dec 05, 2005 9:15 am    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

Izak van Langevelde wrote:
Quote:
In article <1133708948.055663.79770@g49g2000cwa.googlegroups.com>,
mhahn@hvc.rr.com wrote:

Once you play with PICs for a while you
get used to how they do stuff, but even then you'll get caught when
Microchip does something a little different in a newer version of a
chip.

I heard this more than once: is there any reference available for
differences between chip versions?

I think Microchip has some app notes on porting some particular cases
that they consider a natural upgrade, especially when they are
obsoleting parts. In general, though, you should print datasheets and
compare. I, too, have been caught by features that are almost the same.
;-)

--
Thad
Back to top
Izak van Langevelde
Guest





Posted: Mon Dec 05, 2005 9:15 am    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

In article <4393d201$0$240$892e0abb@auth.newsreader.octanews.com>,
Thad Smith <ThadSmith@acm.org> wrote:

Quote:
Izak van Langevelde wrote:
In article <1133708948.055663.79770@g49g2000cwa.googlegroups.com>,
mhahn@hvc.rr.com wrote:

Once you play with PICs for a while you
get used to how they do stuff, but even then you'll get caught when
Microchip does something a little different in a newer version of a
chip.

I heard this more than once: is there any reference available for
differences between chip versions?

I think Microchip has some app notes on porting some particular cases
that they consider a natural upgrade, especially when they are
obsoleting parts. In general, though, you should print datasheets and
compare. I, too, have been caught by features that are almost the same.
;-)

Are you sure there are datasheets for the different revisions of, say,
18f4620?

--
Grinnikend door het leven...
Back to top
Guest






Posted: Mon Dec 05, 2005 4:37 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

Izak van Langevelde wrote:
Quote:
In article <1133708948.055663.79770@g49g2000cwa.googlegroups.com>,
mhahn@hvc.rr.com wrote:

Once you play with PICs for a while you
get used to how they do stuff, but even then you'll get caught when
Microchip does something a little different in a newer version of a
chip.

I heard this more than once: is there any reference available for
differences between chip versions?

--
Grinnikend door het leven...

As others have said there is no better method than RTFM (read the f'ing
manual) :-)

Unfortunately Microchip doesn't seem to publish manuals in the
convienent dead tree format. My eyes tend to glaze over after reading
100 or so pages of a PDF file. One recent acquisition of mine is an old
HP Laserjet 4 printer. Now when I start looking at a new PIC, I just
print out the whole data sheet. Try to budget time to read the whole
data sheet. You will find little things mentioned in it that will save
you a lot of trouble later.

Also pay attention to the errata sheets for the part you have chosen
for a design. Sometimes a feature that made you choose that chip in the
first place doesn't work as well as you'd like.

Mark
Back to top
Mike Harrison
Guest





Posted: Mon Dec 05, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

On 5 Dec 2005 02:37:56 -0800, mhahn@hvc.rr.com wrote:

Quote:
Izak van Langevelde wrote:
In article <1133708948.055663.79770@g49g2000cwa.googlegroups.com>,
mhahn@hvc.rr.com wrote:

Once you play with PICs for a while you
get used to how they do stuff, but even then you'll get caught when
Microchip does something a little different in a newer version of a
chip.

Many of the chips have either sepearate migration guide documents, or sections in the back of the
datasheet detailing the differences.
Back to top
Thad Smith
Guest





Posted: Mon Dec 05, 2005 5:15 pm    Post subject: Re: C Compiler comparison for PIC18? Reply with quote

Izak van Langevelde wrote:

Quote:
Are you sure there are datasheets for the different revisions of, say,
18f4620?

For a particular model, 18F4620, the specified operation is the same.
There could be some fixes applied to errors in early versions. These
should be addressed in the errata, also online.

--
Thad
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB