cancel
Showing results for 
Search instead for 
Did you mean: 

Where to learn the C programming language? give me some advice!

betuel
Associate II
Posted on November 10, 2012 at 15:32

Hi, I have always programmed in C + + and Java or C ♯ and now that I start using microcontrollers have a lot of trouble! can you recommend a good Book of C or a good online guide? thanks

#learning-c
7 REPLIES 7
Andrew Neil
Evangelist III
Posted on November 10, 2012 at 17:29

http://blog.antronics.co.uk/2011/08/08

Posted on November 10, 2012 at 18:28

Given you have prior programming experience, I'd probably just start with K&R's language definition, and then perhaps some books on algorithm implementations in C, or something like Practical C Programming from the Nutshell series.

http://www.amazon.com/C-Programming-Language-2nd-Edition/dp/0131103628/ref=pd_sim_b_1

http://www.amazon.com/Algorithms-4th-Edition-Robert-Sedgewick/dp/032157351X/ref=pd_sim_b_4

http://www.amazon.com/Mastering-Algorithms-C-Kyle-Loudon/dp/1565924533/ref=pd_sim_b_6

http://www.amazon.com/Practical-C-Programming-3rd-Edition/dp/1565923065/ref=pd_sim_b_5

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
frankmeyer9
Associate II
Posted on November 10, 2012 at 18:32

Hi, I have always programmed in C + + and Java or C # and now that I start using microcontrollers have a lot of trouble!

 

It is not the programming language alone - C++ is not so different from C.

More important are the things that high-level programming languages and development environments usually hide from the developer. Things like memory mappings, linkage, startup code, interrupt vectors, and so on.

Requirements in embedded SW are often very different from that of PC software. Often they explicitly prohibit C++ and it's ilk.

Generally, the pure knowledge of the textbook language will not suffice. You will need a rather detailed knowledge of the underlying hardware, too.

Posted on November 11, 2012 at 01:49

I guess one of the biggest shocks will come from having to deal with memory allocation, embedded generally doesn't work well with dynamic allocation in confined spaces.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
betuel
Associate II
Posted on November 11, 2012 at 18:37

thanks for your advice.

I found very useful your advice!
Andrew Neil
Evangelist III
Posted on November 12, 2012 at 09:53

''More important are the things that high-level programming languages and development environments usually hide from the developer. Things like memory mappings, linkage, startup code, interrupt vectors, and so on.''

Indeed!

Do you know of any good books on that particular subject?

My link cites some training providers who give courses with specifically embedded focus, but I don't know any books to recommend.
frankmeyer9
Associate II
Posted on November 12, 2012 at 12:42

Do you know of any good books on that particular subject?

 

Not that I am aware of.

Except of controller specific books (where Joseph Yiu's ARM-Cortex books are said to be highly recommendable), I don't know any generic one.

I gathered the information from datasheets, ARM reference manuals, app. notes and code examples. However, I learned the basic concepts long ago with the Z80, which is, in retrospect, much easier to comprehend than a Cortex M3/M4.