Searching \ for '[EE] C on PICs' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/microchip/languages.htm?key=c
Search entire site for: 'C on PICs'.

Exact match. Not showing close matches.
PICList Thread
'[EE] C on PICs'
2005\08\17@193803 by olin piclist

face picon face
Rich Painter wrote:
> My first PIC project has been underway for many months.  I selected the
> Microchip dsPIC 6012.
>
> ...
>
> I also don't like their departure from using standard "composite ORed
> single-bit masks".

I don't know what you're talking about.  I don't do much C, and I wasn't
aware that there was a standard that envolved "composite ORed single-bit
masks", nor is it clear what that's supposed to mean.

If you are referring to bit numbers within SFRs and the like, this is
probably due to the dsPIC instruction set.  The BSET and BCLR instructions
can set and clear a single bit in an SFR in one instruction cycle.

> Even so, on the whole C30 is a good compiler.  The code generated for
> most "normal" stuff is good.

I'm not so sure yet.  I ported the Microchip 18F TCP/IP stack based on the
ENC28J60 (ethernet MAC/PHY) to the dsPIC.  It's basically working, when
compiled with debug mode and no optimization.  Things start getting flaky
when debug mode is turned off, and stop working when optimization is turned
on.  I can't say for sure it's the compiler since I'm in a different part of
that project now, but will probably get back to the TCP/IP issues within the
next few weeks.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

2005\08\18@035312 by Ben Hencke

picon face
I think he is talking about:

reg |= 1<<7

does the same as
bsf reg,7

The cool thing is that you can do the C thing in a macro, and if the
PIC compiler is good enough, it will optimize this out for you to BSF.
SourceBoost (was C2C) does this optimization and ships with macros for
setting bits, making it very ANSI and PIC friendly. The code is very
portable.
- Ben

On 8/17/05, Olin Lathrop <spam_OUTolin_piclistTakeThisOuTspamembedinc.com> wrote:
{Quote hidden}

[snip]

2005\08\18@042550 by Ben Hencke

picon face
Oops, I shouldn't post this late ;-)
Maybe he was taking about having to AND all the config bits together
(bit set to 0 = activated)?

CLEAR_WTD & OSC_HS & ...

Cheers,
 Ben


On 8/18/05, Ben Hencke <.....brainstarKILLspamspam@spam@gmail.com> wrote:
{Quote hidden}

2005\08\22@012637 by Chen Xiao Fan

face
flavicon
face
I do not know too much C either but I started my real C programming
with PIC in year 2000 with Hitech PICC 7.85. I think it is great
and I do not need to "debug the compiler". It is not cheap but
it is value for money. It is said that PICC 18 is also very good
but I do not have access to it other than the demo version.
dsPICC is still quite weak compared to C30 and there is not
too much examples and discussions on the Hitech forum.

As for C30, I do not know. So far I have not really used it.
However I can say something about C18. We do have C18 thanks to
Microchip. So far I have only limited experience with it on the
PICDEM FS USB boards. According to one of my colleagues, it
is not that great in terms of library quality. He is using it
with 18F4620 for a research project and he often has to write
his own function since the supplied library functions often
cause problems. He used Renesas M16C before and compared to
the Renesas C compiler C18 is really lousy according to him.
Then again, Renesas C costs several thousand US dollars so
we should expect better quality as well and we get our C18
compiler for free so we would not complain.

In a word, good C compilers on PICs are really possible and
really a good tool to do fast developing and maintaining.
However we do need to invest in good C compilers.

Regards,
Xiaofan

{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...