View previous topic :: View next topic |
Author |
Message |
Flumkin
Joined: 24 Dec 2013 Posts: 5 Location: Coimbatore
|
book for study |
Posted: Tue Dec 24, 2013 1:19 am |
|
|
I'm interesting in learning c coding in microcontroller(16f877a) using ccs compiler... please suggest any book.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Tue Dec 24, 2013 1:39 am |
|
|
1) Use one of the on-line primers. Cheap!.....
2) Add to this the 'real' C reference work. "The C programming language", by Brian Kernighan and Dennis Ritchie (Prentice-Hall). This was the book that was published to describe C, when it originally launched. This really is the 'key' reference to what is legal in C. Problem is it is a bit 'technical', which is why the primer should come first.
3) Add the data sheet for the chip.
4) Add the CCS manual - there are a few key differences - specific to the PIC hardware and CCS. These are in the manual, but you should really learn basic C coding (on a PC) first.
5) Add the 'readme.txt' with the compiler, and a few other similar notes.
Voila!.
So you work from basic 'how to program in C', through the technicalities of what is legal, through to technicalities of what the chip can do, to to final 'I can program in CCS C'.
Best Wishes |
|
|
Flumkin
Joined: 24 Dec 2013 Posts: 5 Location: Coimbatore
|
Thankyou |
Posted: Tue Dec 24, 2013 2:30 am |
|
|
Thank you for helping... |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Dec 24, 2013 9:31 am |
|
|
also....
Look over the examples that CCS supplies !!! Most were written when the 877 was 'the' chip.You'' find 'drivers' for a lot of peripherals as well as 'how-to-do-it' programs.
hth
jay |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Tue Dec 24, 2013 9:46 am |
|
|
Yes, definitely K&R "The C Programming Language" although recognize that while that book is considered as "the Bible" it will also cure insomnia ! Look at the intro C books at some place like Amazon.com - you can often preview many of the books on the web there and it will give you a chance to see which books work for you - everybody has a different book that just clicks for them. One important thing to understand with the C compiler (not just the CCS one) - they usually don't tell you where the error is in your code. They tell you when they finally realize they are confused which may be quite a few lines down from where the error(s) were Be careful that you understand the difference between "=" and "==" (this is the one that tends to get me). The statement "if (x==2) " will be true if the variable "x" is equal to the value of 2. The statement "if(x=2)" will always be true and will set the variable x to the value of 2. One way around that is to learn to write the conditional as "if (2==x)" - that tests the value of x. If you write it that way and forget one of the "=" signs, then the compiler throws it out as an error (when I write it that way, I find I have fewer holes in my feet).
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Wed Dec 25, 2013 7:57 pm |
|
|
I'll second Embedded C Programming and the Microchip PIC by Barnett, Cox and O'Cull _________________ Read the label, before opening a can of worms. |
|
|
Flumkin
Joined: 24 Dec 2013 Posts: 5 Location: Coimbatore
|
thanks |
Posted: Wed Dec 25, 2013 10:12 pm |
|
|
thank you friends........hope it will surely help me...... |
|
|
|