14

I am looking to start from scratch to learn to program embedded systems. After some time looking around I found myself a bit confused.

I can program both C and C++ but I just don't know where to start with embedded programming, should I buy some kind of device to practice on, use a microprocessor emulator (if so, which one?) - stuff like that, any advice or resource on where to start is very welcome.

5
  • 1
    You might want to narrow the scope of your goal. An "embedded system" might run the range from a 32-bit 1GHz ARM CPU, 1GB RAM, 32GB of storage, running Linux; down to an 8-bit microcontroller with 1KB of RAM running no O/S at all. Try to imagine, more specifically, what sorts of things you want to create, and go from there.
    – Robᵩ
    Mar 22, 2012 at 16:31
  • @DeadMG: It is quite clear in context that he means he can program in both. Just for you I made it clearer.
    – Clifford
    Mar 22, 2012 at 17:28
  • 1
    Give some scope to the question: What kind of applications are you interested it? What is your budget? In the broad spectrum of embedded systems, it is not possible to guide you unless you narrow down the scope a little.
    – Clifford
    Mar 22, 2012 at 17:32
  • What I'm looking for is to learn the basics of embedded. So I guess I'm willing to purchase a cheap board or device to experiment on - for educational/hobby purposes. And @DeadMG, yes, I meant both C and C++.
    – nuno
    Mar 22, 2012 at 17:37
  • I have a number of simulators with some sample code (asm and C), github.com/dwelch67. thumbulator and amber_samples in particular. plus examples for many sub $50 boards. The stm32f4 discovery is about $20 and is in theory a microcontroller but goes way beyond that, esp for the price of the eval board.
    – old_timer
    Mar 23, 2012 at 4:58

7 Answers 7

9

In my opinion, skip Arduino. I've always seen it as kind of a dumbed down system for non-programmers. Go for something that lets you apply your C knowledge to getting as low level as possible, at first. You want to understand how interrupt vectors work, how your limited RAM limits your stack, how to debug.

Check out Freescale's 8-bit and 16-bit Microcontrollers, especially the HCS08 or HCS12. There are some $100-200 and some sub-$100 development systems with built in debug interface (Background Debug Mode). These are also higher performance and memory than Arduino. The CodeWarrior software is free (code size limitations, but in most cases the limitation number is greater than the amount of flash on these devices), and fully functional. I don't know if you can set code debug breakpoints with Arduino, but you can with these. There is another benefit to CodeWarrior -- while you do at first want to delve into datasheets to understand how memory-mapped registers for the various modules operate (eg, how a flag should be cleared, how to set a mode, whatever), CodeWarrior comes with Processor Expert which will generate functions for you for specific HCSxx family derivatives and their specific modules. Since most of these products reuse the logic between derivatives, with some minor differences, it makes sense to reuse code. Processor Expert has come a long way since its beginning 10 or so years ago. In the long run it is a huge savings to development time, as these functions take care of writing the very low level actions (eg, configure a PWM timer output pin for a xx/yy duty cycle with one C function call).

Then you can use some of the OS's that will run on these, or you can move up to ARM or ePPC. I know of at least one HCS12 demo board that comes with Linux and a webserver, which you could always wipe out for your first development, and then put it back when you're ready. Freescale is also very good with providing tutorials, application notes, and documentation, except that their site is sometimes hard to navigate. I suppose that's just a symptom of a large ecosystem. Good luck!

2
  • 1
    In my opinion Arduino (the device) is a pretty good cheap uC dev platform. Just don't use the Arduino library. Dec 2, 2012 at 20:47
  • Valid points however the MCU recommended in this answer is no longer supported. Freescale also merged in 2015 with NXP Semiconductors. They're all part of NXP now. Would be nice to get latest model recommendation.
    – nullspace
    Nov 20, 2021 at 21:53
4

There are several embedded platforms out there that are popular with hobbyists and very easy to use. The Arduino is probably the most popular. Boards are cheap ($20-30) and easy to use, and there's plenty of good software. The main web site for the Arduino platform is http://arduino.cc. You'll find plenty of links there to other resources that'll help you get started.

You may want to check out SparkFun, which is primarily a hobbyist-level supplier of electronics parts (including Arduino and other useful boards) and tools. They've got a lot of great content on their web site to help you get started with both the hardware and software.

3

why dont you start with something like that:

http://www.bytecraft.com/downloads/firststeps.pdf

this should cover a lot of the ground you are looking for.

or a lot can be found here: http://www.eetimes.com/electrical-engineers/education-training

have fun with your first steps =)

3

One could divide embedded systems into two classes:

  • Those that run a full OS. If there is a documented way to get the OS and boot it up, then these aren't really handled any different than desktops, except you will need to build or download a cross-compiler. For things like phones, of course, elaborate development environments with debuggers are provided by the environment's sponsor.

  • Those that run a program on what's called "bare metal". These will have little more than your program and the language runtime loaded. (Some of these are really simple and run either a simple interpreter or assembly language. These have the advantage of not needed complex programming just to set up the integrated peripherals.)

You may not need an emulator or other hardware debugging setup, in fact, you may not even need hardware to get started. If possible, try to do initial development in a virtual machine.

As always, you get what you pay for. In a commercial project lots of environment is available but these are presumably not used much for robot projects and the like.

There are lots of platforms that come with reasonable amounts of support. The latest rage (due to its remarkable US$35 price point) is the Raspberry Pi, however, it is not immediately available at this time.

2

You have tons of options! I guess you'll start with an emulator (it doesn't matter what type of embedded OS you'll use, probably you won't use a x86 CPU). If you'll work with a X86 CPU you don't need any emulator but you may need a Virtual Machine.

You tagged your question with "arm" so I guess you want to use an ARM processor (then you'll need an emulator). Start to look here, you'll find tutorials and resources to begin with embedded programming.

3
  • ping. You can probably undelete your answer on Why do ARM chips have an instruction with Javascript in the name (FJCVTZS)?. The weird last paragraph asking about ARM design meetings was been removed, so your answer fits the question now. Sep 5, 2018 at 19:10
  • @PeterCordes yes but there is already another answer, it won't add that much to undelete mine. Sep 6, 2018 at 10:58
  • I like that yours estimates the cost of doing the operation JS needs at ~10 instructions without it; it's not essential but I liked it. Sep 6, 2018 at 15:36
2

I would suggest trying out some of TI's EZ430 series of development tools. Some of the tools can be purchased for as little as $20 and have basic functionality, as well as ways to expand them out. You can easily buy two eZ430-F2013 and have them talk to each other or to another computer.

TI comes with Code Composer Studio for their MSP430s which is free and full featured (it's based on Eclipse) so the programming environment is very user friendly. TI also provides a large number of code samples which cover most of the system's functionality.

With the MSP430, you will be programming on "bare metal" code as its said, so you're not just going to be programming C, you're going to be toggling outputs and bit-banging. But it looks like you're interested in learning it down at this level, so this is a great place to start.

On the other hand, if you want an embedded OS (such as Linux) check out the gumstix website.

2

Because your question provides little information as to application type, performance requirements, and budget etc., no answer will be particularity well focussed.

However given that I would suggest that you pick an ARM architecture device, simply for the reason that this covers devices from a few dollars with performance in the 10's of MIPS, and small on-chip memories to application processors on boards costing a few hundred dollars capable of running Linux, WinCE or Android for example.

Like it or not ARM is ubiquitous in the embedded systems world; everything else is niche in terms of design-in and market share. A Cortex-M3 based device on a simple development/evaluation board is a good place to start. You will be frustrated however if you do not factor in the cost of tools and debug hardware.

5
  • Are there not some software tools I can use just so that I can try out a little bit of programming going on? For instance, some tutorials using microprocessor emulators? Or do you advise to start right away with a physical chip?
    – nuno
    Mar 22, 2012 at 17:46
  • 1
    +1 for trying to get the OP to narrow down the scope of the question. I suggest to the OP that he or she spend some time to decide as to what the embedded device must do. If it must do everything, it's going to be one of the more expensive boards. If it's just a telemetry device or something simple (i.e. temperature monitoring of a fridge or something) it can be a much cheaper board.
    – ldav1s
    Mar 22, 2012 at 18:44
  • I agree that the scope of my question can be extremely generic - sorry for that. I was just trying to get some tips on how to start doing some pretty simple programs, just for fun. So I guess I would just simple start with some simple/cheap boards or even an emulator if that is possible
    – nuno
    Mar 22, 2012 at 19:07
  • You could download Keil's evaluation version of uVision ARM-MDK. It includes a simulator with which you can run code in teh debugger, but with no I/O it won't be particularly interesting, it is rather intended for testing code and checking execution performance without hardware. The only "special" thing about programming embedded system is directly accessing hardware. C code is C code (or C++), so a simulator might not teach you much you don't already know.
    – Clifford
    Mar 22, 2012 at 23:37
  • Consider one of these boards, and order a "Starter Kit" rather than a stand-alone board since the kit includes a JTAG debugger board so you can program the board and debug the code running on the board (stepping, breakpoints, watchpoints etc.) within the uVision IDE.
    – Clifford
    Mar 22, 2012 at 23:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.