Old dog, no C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Old dog, no C

4,089 Views
UtopiaTim
Contributor III
Hi folks,
 
Well, after 29 years of designing & writing code
for micros, I guess it's time to bite the bullet &
learn C.
 
Anybody have some good info on how to learn C for
micros?  Books, Ap notes, etc
 
Freescale 08s would be good to start on,
as I already have some knowledge of the parts &
a Cyclone with CW08.  (plus a new project coming
down the pike that uses USB) :smileysurprised:

Thanks a bunch!
 
woof
 
Tim
Labels (1)
0 Kudos
9 Replies

884 Views
HarrySun
Contributor I
hello, I am a similar old dog and now I am using C.
once you use c, you won't get back to assembly any more,it's just so convenient.
in most situations, we don't pursue extreme efficiency and C is just too portabel for applications and it's easy to use...
I used QG8 to learn C,it's 8-bit so it's easy and freescale has a lot ready-made c programms for you to try on,when I don't understand I go back to read book or just surf online.
this way is pretty efficient for an old dog like me.
0 Kudos

883 Views
thisobj
Contributor III
Hello Tim,

In addition to books, you can get a good start on learning 'C' by going to Google and typing in:
"C tutorial"  or "C programming tutorial"   (use the quotes in both cases).

Also, you might want to pick up a copy of the book, "The C Programming Language" ( Second Edition ) (ISBN 0-13-110362-8) by Kernighan and Ritchie, the authors of the language.  

Regards,

Frank
0 Kudos

884 Views
Curt
Contributor IV

Hi Old dog.

Why C?  You probably have a lot of experience with assembly -- and IMHO its the "right" choice for most embedded MCU apps anyway.  (You won't be seduced into thinking that function calls or floating point ops. are "free," for example.)  And you CAN do USB apps. in assembly.  Take a look at "USB Design by Example" by John Hyde as a good 8051-oriented intro.

0 Kudos

884 Views
Lundin
Senior Contributor IV
An assembler programmer won't have to worry much about make those efficiency mistakes when writing C though. They all know what's going on behind the C code, as opposed to most PC programmers moving to embedded systems. Also, new microcontrollers are written in such a way that they will yield more effective C code. 8051 is not one of them, it is the least code-effective micro on the market.

(Btw, function calls are free! There is inlining! :smileyhappy: )
0 Kudos

884 Views
UtopiaTim
Contributor III
Hi Bill/Curt,
 
Thanks for the info on the book Bill.. I'll check it out.  I have a copy of
'C Primer Plus' by Waite/Prata & Martin, and am going through it, although
it is geared more for larger systems.  (published in 1984, there weren't
many efficient compilers for micros).
 
Curt - I agree mostly, but it is such that every ap note I come across seems
to have it's code done in C.  In the work that I do, time to project completion
is a major consideration, and if I can leverage some code snippits from an
ap-note, it will save me time (and $).
 
I understand the tradeoffs of code size, execution speed, etc, and obviously
the time sensitive stuff will still be done in assembly.
 
It's certainly not an 'end-all' answer, but just another tool in my bag of tricks.
 
I've perused Amazon's site, & there are a ton of 'C with PICs', but haven't
seen one for Freescale's micros.
 
Thanks again!
 
Tim
 
0 Kudos

884 Views
joerg
Contributor II
Hi Tim

As i am also a old dog, i was used to write my code in assembly (for a lot of MCU's). Back in the 1980's i tried "C" for the first time and my first program  showed 65 errors in only 5 lines of code!!  At this point i decided  that "C"  was definitely NOT my language! So after using Pasqual, Modul2 and a lot of BASICs (mainly for PC stuff) last year i decided to try "C" again.  The result is that i have rewritten my simple OS in "C" (Info's on www.systech-gmbh.ch -> EBS08). And i must say am not really unhappy with the result. I was also surprised about the code size with is almost as short as my assembly code! I have bought different books for getting some information about "C" but the heavy ones (2kg!) didn't not help really, finally i found the book (bought in 1982!) form Kernighan and Ritchie (original title "The C Programming Language" ) and i find this book helped really. (wight < 300gramms)! Probably you can find it used!

Good luck

Joerg

PS. I hate automatic smiles!!




Message Edited by joerg on 2007-11-16 05:49 PM
0 Kudos

884 Views
bigmac
Specialist III
Hello Tim,
 
Here are a couple of Internet references I have found to be useful -
Regards,
Mac
 
0 Kudos

884 Views
UtopiaTim
Contributor III
Thanks everyone for your information, experiences & links!
 
That light at the end of the tunnel may not be a train!!
 
Thanks again,
 
Tim
0 Kudos

884 Views
ballen
Contributor I
Tim,
Although it's not specifically for micros, "Software Engineering in C" by Peter Darnell is great and used is only a buck at Abe Books (out-of-print, paperback, so check condition). It's still the only book on C that I own or use even though it's almost 20 years old.
Bill
0 Kudos