Electronics > Beginners
Where to learn C for microcontrollers
mrpsychotic:
I am basically sunk when it comes to microcontrollers because I don't know C. Here is my dilemma though:
When I search for C tutorials the results that come up are C tutorials for programming computer software programs, not for microcontrollers. When I look for tutorials for how to code microcontrollers with C, they assume you already know the general C used to code computer software.
My question is, is there a resource that teaches C microcontroller programming that assumes the reader is new to both C and microcontrollers. I dont want to go through the process of learning "general" C for computer programs and then learning the C used in microcontrollers.
I have 3 varieties of microcontroller lying around. I always think I will be able to finally use them but what ends up happening is that I can only use them to the extent that I can extrapolate and merge examples instead of making my own code.
Please help if you know of any resources or have any advice.
stan001:
I suggest you to Arduino :
http://arduino.cc/en/Tutorial/HomePage
It is a simple version of C adopted from Wiring ( http://wiring.org.co/learning/basics/index.html )
Just hv setup() and loop() only...
the_raptor:
There is no such thing as "C for microcontrollers". Every micro is going to have different capability and different methods of accessing that through C.
What you need to learn is:
1) Functional programming language grammar (eg functions, loops, if statements, arithmetic etc).
2) C syntax (how you achieve the above in C).
3) Specific micro grammar and syntax.
Learning C for computer programming is directly applicable to points 1 and 2. The reason you get stuck with trying to code for your micros is because you aren't learning the foundational skills that apply to every functional programming language out there. Learning functional programming and C syntax will enable you, with a bit of familiarisation, to code in nearly every modern language out there.
If you don't want to bother learning how to program you are stuck cutting and pasting stuff into the Arduino IDE.
PS. The actual microcontroller programming is really the easiest bit. All it involves is knowing how to set-up the pins in the way you want, and how to do digital and analog I/O. However if you can't program you are going to have great difficult doing anything useful with those pins. It is like having a hammer, nails, and wood but not knowing how to put them together.
Longhair:
I am in the process of the same thing that you are facing - wanting to learn C for Microcontrollers.
I started reading "Beginner`s Guide to Embedded C Programming by Chuck Hellebuyck" and to follow the book, you will need "PICkit 2 Starter Kit".
I found out early on that having C programming is a good foundation so put the above book and starter kit on hold while I go through a beginners book on C programming. Sometimes you need to take a step back to go forward faster.
Mechatrommer:
--- Quote from: Longhair on January 26, 2011, 02:26:59 pm ---Sometimes you need to take a step back to go forward faster.
--- End quote ---
dont count on it. there is no faster way in learning. but moving a step back is a wise decision imho, if you think you cannot go faster.
Navigation
[0] Message Index
[#] Next page
Go to full version