What's your previous knowledge?
- Do you know "C" and want to extend C-programming to µCs??
- Do you know how to program a µC in Assembler and now want to go for "C"?
- Do you know anything about µCs at all?
While C is not a particularly difficult programming language, it has its quirks. It helps to become familiar with C first before starting to program a µC. Otherwise you may have to fight a battle along two frontlines: the programming language and the µC.
Or you do it the other way round.
A few noteable differences between C-programming on a PC or on a µC (I don't claim completeness of the list):
- On a PC you have access to powerful libraries. On a µC you usually try to keep the code small and libraries are often less powerful.
- On a µC you typically deal with lots of bitwise operations. Possible on a PC, but in my view uncommon.
- On a PC you usually have access to floating point arithmetic. Few µCs support this in hardware and the software solutions (libraries) are so much slower than pC hardware.
- On a µC size of code and data do matter very much more than on a PC
- ...
I suggest you first get acquainted with C using any of the free C compilers for PCs. Once you've mastered the basics of C go ahead and transfer that knowledge to programming a µC. For almost each type of µC you will find a community on the internet with sample code, sample circuits and lots of helpful information. Google "experiments with microcontrollers in C".
You may even ask here
I found this
list of books which might befit your interest.
Another approach could be to look for a learning kit.
Harald