I want to do PIC programming in embedded C. But I don't know the language well. Please help me by suggesting some good sites for getting an idea about C programming.
Microcontrollers like the PIC are very unforgiving to the learner. If you're setting out trying to learn C for the first time, practice on a PC first. Test your code as much as you can on your PC where you have a good debugger and protection from memory faults.
Once you're confident that your logic is working right, then compile your code for the PIC.
I'd recommend getting K&R because I like to read a book as I learn a language, but if you're looking for an online resource, Wikibooks' C Programming isn't a bad read.
Alternatively, for a topical resource, look at http://www.cprogramming.com or http://www.cplusplus.com - Note that both are C/C++ sites, you must be wary of the differences. You don't want to use C++ for your PIC projects.
Last, a Google search for
"C Language" + keyword is a good starting point for many questions, and usually yields better results than just the letter C.
Get The C Programming Language by Kernighan and Ritchie. They invented C and it's the best introduction to the language there is.
Some of the low-cost C compilers for the PIC are rather non-standard. Microchip's C18 for the PIC18 and Hi-Tech's C for the smaller PICs would be better; free versions of both compiler are available.
Once you are ready to apply your C skills to the PIC, I would get a development board, and one of the following books, depending on whether you are dealing with 8-bit (PIC1x), 16-bit (PIC24) or 32-bit (PIC32) devices:
Programming 8-bit PIC Microcontrollers in C: with Interactive Hardware Simulation
Microcontrollers: From Assembly Language to C Using the PIC24 Family
Programming 32-bit Microcontrollers in C: Exploring the PIC32
all available on Amazon (along with lots of similar titles covering PICs and C).
Note: I would shy away from 8-bit PICs lower than the PIC18, as they are not as well suited to the C language.
If you're really interested in learning PICs and c, I would say you can check out 123 PIC Microcontroller Experiments for the Evil Genius. This is how I got started with PICs. However, I would at the minimum recommend purchasing the PIC Kit 2 as the 1 doesn't program nearly as many things.
I have really enjoyed playing with the PICs, the HI-TECH compiler for the 16 series (and probably other series) is free for the MPLAB environment.
Good luck. I'm actually attempting to come up with a RTOS (Real Time Operating System) for a 16F913, just to try it out.
Thinking in C. There are some bugs, but it's a great free ebook from Bruce Eckel.
It all depends on how you learn, but I find its easier to learn with a distinct objective when your'e learning. If you want to specifically learn C for PICs, here's my recommendations:
Ironically, I'd pick up an Arduino and not a PIC setup. Programming PIC chips in C has a very large learning curve that assumes you know how to read datasheets, burn code into chips, etc. Arduinos do not have this. You program Arduinos in C (*). If you know nothing/vary little about programming or writing in C or with microcontrollers and don't know where to start or what to do, the example code that comes with it is very simple and will allow you to get up and running quickly. The documentation for the Arduino is easy to read with minimal experience. A trip to an electronic store and the Arduino board will give you a way to get started.
In conjunction with that, I would read a book or a tutorial on C.
In addition, I would find someone else who knows how to program PICs or microcontrollers in C and work with them. A subject like this has a huge learning curve, but a person who can interact with you and help you fill in the gaps is huge.
(*) - It does use a form of avr-gcc in the backend, correct? I haven't dug into the Arduino IDE source code.