2012-11-10 06:32 AM
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-c2012-11-10 08:29 AM
2012-11-10 09:28 AM
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
2012-11-10 09:32 AM
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.
2012-11-10 04:49 PM
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.
2012-11-11 09:37 AM
thanks for your advice.
I found very useful your advice!2012-11-12 12:53 AM
''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.2012-11-12 03:42 AM
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.