You are here

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.

 

 

Update: Added based on responses to the original post

 

 

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).

 

--Matt


Matt Landrum, PSoC Software Customer Advocate

Cypress Semiconductor - Portland, OR

Comments

sevans's picture

Matt,
Great posting.

My favorite reference by far is "C in a Nutshell." In my embedded work, it strikes just the right balance between being concise and having necessary examples.

The other thing I like to do when the mood strikes is to read and study the reference book for MicroC/OS II, which is Jean Labrosse's book on his/Micrium's RTOS. Carefully reading his code builds skill in writing code, in my opinion.

Scott Evans
Arrow Electronics

Bob Marlowe's picture

For a very long time C appeared for me to be rather cryptic and difficult to understand, so I used for my software-projects some other languages.
At the contact point of PSoCs and me I HAD to use C and it just took me a week to get adapted to it (Although it took some more time to get aquainted to "poiners to functions" and other stuff.
Since I had to read my programs several times before they were ready to be executed I found myself a book named
"Clean Code" (written by Robert C. Martin) which I adapted (with some changes) my programming-style to.

Bob

MattLandrum's picture

Great inputs Bob and Scott. I'm going to check out those references.

Speaking of RTOSes, look for a post from myself or Mark Saunders sometime soon.
--Matt

mfroberts's picture

Making Embedding Systems by Elicia White

http://it-ebooks.info/book/549/

More than just C Coding, but a good overall design methodology from a firmware engineer.

MattLandrum's picture

Got it. Thanks, Mike.

Zippy's picture

It's not precisely germane to learning C, but _Math Toolkit for Real-Time Programming_ should be on every embedded developer's shelf.

jordanss123 jordanss123's picture

replica yeezy boost 350 Thanks for your submission. I also think that laptop computers are becoming more and more popular these days, and now will often be the only sort of computer used in a household.

 

nishgau28_2730811's picture

Nice and informative information about all the games which can be played over XBOX. This is the time to explore free xbox codes on  and also grab free membership for online live xbox gaming free xbox gift card codes . Its wonderful and exciting in all sense, Visit to get all the offers for free and instant.

Muneer Ahmed's picture

The first phase the preparation should, theoretically, be uninfluenced by the intended intensity and duration of the sound which is subsequently produced. In fact, however, so quickly are the three phases accomplished that the pianist rarely has capacity to think, in performance, of each phase separately. Owensboro Church of Christ preschool

Muneer Ahmed's picture

Persons appreciate shopping for amazing, appealing, fascinating and from time to time attractive aromas for them selves and pertaining to others. This can be executed conveniently along with inexpensively in an on-line perfume shop. can you make a living from binary options

Muneer Ahmed's picture

The CSOne is web-based maintenance management software designed for maintenance and repair service providers. It is specifically designed to fulfill the requirements for these services and successfully improved productivity of thousands of users around the world info

Muneer Ahmed's picture

I discovered this is an instructive and fascinating post so i suspect as much it is extremely valuable and proficient. I might want to thank you for the endeavors you have made in composing this article. https://www.enutrition.co.uk/

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.