Matt's Tips: Embedded Programming in C for Beginners (and some advanced stuff) | Cypress Semiconductor
Matt's Tips: Embedded Programming in C for Beginners (and some advanced stuff)
When reading PSoC Creator survey responses, I often I see a comment that reads something like, "I'm interested in introductory C training. Where's a good place to start?". My background is in Computer Engineering with an emphasis on VLSI design and CAD, so C is one of those things I've used for a while. I don't generally have cause to look for introductory material.
Having said all that, I see many of my EE brethren moving from the world of digital or analog circuit design into the land of embedded systems programming (MEs too!). Additionally, if you've been writing code targeted for a desktop PC or Linux workstation, you'll find you are dealing with a completely different animal when you need fit your code into 8K. What to do?
So, I asked around and compiled this small list of resources to get you started. I'm hoping to see some comments from people who have good (or bad) experiences with some I haven't listed. Here is the list I'm starting with.
- http://www.learn-c.org/ - A free, interactive C tutorial (nothing to even download). There are some advanced sections as well.
- http://www.cprogramming.com/ (C++ stuff here too)
- C Programming for Embedded Microcontrollers by Warwick A. Smith (Basic C programming + ARM)
- There are several books/classes listed here: How to Become an Embedded Systems Geek by The Embedded Muse.
- Many universities, community colleges, and training organizations have live C courses, some even have C/embedded programming classes. For example, Embedded Software Bootcamp from the Barr Group
Update: Added based on responses to the original post
- C in a Nutshell by Peter Prinz
- Clean Code by Robert C. Martin
- Making Embedded Systems by Elicia White
I don't recommend learning C by solely looking at example code. However, looking at examples is very helpful for some. Almost all PSoC Creator components have an example to go with them. Just right click over the component (See the Screenshot below).
In Creator 3.X, you can also browse all the example projects from the File menu (See the Screenshot below).
Long-time C programmers will tell you that for a C reference, K&R is the Bible. I agree. I was raised on Kernighan and Ritchie, but I'd be wary of anyone that tells you to start with that. If you just need a quick on-line reference, see Wikipedia - http://en.wikipedia.org/wiki/C_syntax.
If you are interested in the 8051 specifically, you may want to check out Embedded C by MIchael J. Pont.
Jean Labrosse's real time kernel reference books are also recommeded not just for RTOS users but to build code writing skills in general.
So how did you get started? What are your favorite references/tutorials? Hit me up in the comments (this blog is moderated so I have to manually approve before they show up).