C Learning on 16-bit microcontrollers

My company is moving from prefabricated microcontrollers to C. We are looking at Microchip, Atmel, Renasas, et al. And others for future projects using C. Are there any good training resources to get our engineers up to speed with C? Workshops, instructors, classes, etc. The experience level of engineers ranges from teaching without any knowledge.

+1


source to share


11 replies


Welcome to the 80s. :) Start with the classic K & RC book or my favorite C: Harbinson and Steel reference guide if you can find it. I work with PIC, and there are several useful books on PIC programming. I was already familiar with C using a PC, but did not find them useful in this regard.

C allows you to be closer to assembly and most compilers include it inline, so it is as close to assembly as possible like any high-level language. I think you should be happy and home pretty quickly.

If you are interested in moving forward several decades; >), you may want to consider compiling Microchip C. I'm going to look into this soon, and there is a good book on Practical C / C ++ Statecharts .



+8


source


The good news is that if your engineers have build experience, some "C" langugage concepts such as pointers and arrays won't be hard to grasp (and hopefully master).

Regarding your specific question about inline learning C, Netrino has a bunch of inline learning courses including writing inline C and C ++ code.

Also, the Embedded Systems conferences (only one in Boston a couple of weeks ago, the next in Silicon Valley, the next spring, I think) is always full of courses on embedded development and in different languages. But you probably don't have the luxury of waiting 6 months.



If your employees are more of a "book student" type, these books may be of interest:

This should give you enough to chew on for a while.

+3


source


To get started, I suggest Microchip's MPLAB and "Student" versions of the C compiler.

The C compiler runs without optimization after expiration.

MPLAB has a built-in simulator for running programs. You can beat the output pins to see how things move.

+1


source


Definitely, you should check http://arduino.cc :

http://arduino.cc/en/Tutorial/HomePage

NTN

+1


source


Why do you mention 16-bit?

If it's because you think 8-bit is the 20th century, you're right. But also 16-bit. Today 32-bit controllers (especially ARM) are more powerful and often cheaper than 16-bit controllers. Cheaper because some 16-bitters use legacy processes that are large and therefore large.

In fact, I think some 8-bit controllers will have longer lifetimes than their 16-bit counterparts. The advantage of the first over 16 or 32 bit controllers can be size. Cannot fit ARM controller in 2.9x1.3mm SOT23 package. Plus, smaller 8-bit controllers are still cheaper than the smallest ARM.

For me, the only reason for using 16-bit controllers would be to set the code, but since you mention some of the brands you are "considering", I assume you are not using them at the moment.

I would look at ARM. ARM7TDMI is stable and available in multiple configurations from multiple vendors. I can recommend the NXP LPC2000. Starts at around $ 1.50, not bad for a 32-bit controller.

+1


source


Are there any good learning resources to get our engineers up to speed with C?

For starters, a very good and also quite complete introduction to the C family of languages ​​is provided free of charge by Bruce Eckel. Multimedia Course "Thinking in C" (download size is about 100 megabytes, and the course itself is in flash memory).

+1


source


The msp430 is one of the best micros for C. But your best bet is to just go with ARM, they will soon wipe out any remaining competition. Microchip grabbed the 32-bit core to compete, but I think they'll work as well eventually. With 32-bit ARM encounters and beating the price of legacy 8-bit micros (like PICs and 8051 and z80) other than MSPs, you should avoid stopping at anything below 32-bit core.

It is not the best or most efficient compiler, but the price is right, and no other compiler has the same support as gcc. It is relatively easy to build or download ready-made gcc for multiple platforms. I wouldn't get caught up in anything that required IDE and tool developers to do. These tools are good and in some cases necessary to get started with micro, but eventually you may need to explore the pros and cons of alternatives.

In terms of learning C, it's good if you know assembler than any other language including assembly, just syntax. I'm sure everything you need can be found on the Internet using Google. When you get the eval and micro board (stellaris has some good stuff), start by looking at their sample programs and then use google to find other sample programs and move from there. Particularly with microcontrollers, but in general, you want to avoid the gee whiz functions of any language, stick to simple, simple things, things that are the same in any programming language. Compilers you are testing for, for example, embedded compilers for microprocessors will not handle corner cases like gcc or microsoft or borland.It will also make your code more portable to switch to other microphones or other languages ​​(I would avoid anything above asm and C though, esp is for microns). If you have a book, get K&R or whatever is used as a replacement. Note that K & RC, straight out of the first edition book, is not usually compiled anywhere. But it preserves the basics and keeps you away from problem areas of the language.

Linux device drivers are extremely high (almost at the application level, most of the code has nothing to do with metal). You are not going to run Linux on a micro microcontroller, nor are you going to learn from Linux devices - this is a good exercise for other purposes, but not for this. You want to avoid the operating system at all costs, specifically Linux and Windows, you want to learn programming without the C operating system. Look at the WINARM examples. (including RTOS).

0


source


For 16-bit Microchip photos, there is

http://www.amazon.com/Programming-16-Bit-PIC-Microcontrollers-Technology/dp/0750682922

IIRC that was decent, but they focus very heavily on doing one thing per chip. Our applications multiplex a lot of I / O, and for that, the examples / casestudies in the book (which were supposed to be used exclusively) were difficult to practice.

When I started working with this architecture, it is very easy to get a ready-made sample tablet (from Microchip, range $ 50 to $ 100), especially if you are targeting roughly the same option as the sample board.

This is because it made it easier to check for hardware or software associated with running on the sample board.

0


source


There are companies specializing in C training for embedded systems, such as Feabhas in the UK, or Netrino in the US. Look around the net.

In addition to the processors mentioned in other posts, the STM32 family from ST is worth looking at. They are 32-bit, extremely cost effective, and come in a wide variety of packages.

ST seems to be working hard to get people up and running quickly with their product, coming up with development hardware like the STM32 Circle .

0


source


The first thing that comes to mind is the documentation for writing Linux device drivers. This has little to do with what you're interested in, but coding for 16-bit devices is covered in this O'Reilly book on driver programming. In general, at least there should be at least a lot of useful coding style rules.

-1


source


There are many books out there on teaching C programming, especially for the architectures you mentioned. Check out amazon with a search for "microcontroller".

In addition, Microchip has many workshops / classes for their specific compilers and chips - they tend to be inexpensive and there are several training centers throughout the US. With many engineers in need of training, you might consider contacting Microchip directly and see what the homeschooling costs are.

-Adam

-1


source







All Articles