Introduction to embedded systems with Linux and the TI MSP430 Microcontroller

Programming embedded systems requires a combination of skills. You should have a good idea of processor architecture. You need to understand at a basic level the working of systems programming tools like compilers, assemblers, linkers. You need good C programming skills; you should know how various C constructs map to assembly language. You need to understand the working of basic peripherals (i/o ports, uart's, adc, timer etc). And, if you are into the hardware side, you should definitely have a good grip over analog/digital electronics.

Besides all the above, there is something much more important - and that is the ability to move down layers upon layers of abstractions and understand how things really work on the bare hardware. The objective of this course can be summed up in a single sentence: bring you close to the machine!

Please check out the Course FAQ as well as the syllabus given below to decide whether the course is suited for you. If you are still confused, get in touch with us at mail@pramode.net and we will help you decide!

The course is composed of more than 35 lessons grouped into 3 parts. Part 1 provides an introduction to the GNU/Linux programming environment, Part 2 focuses on programming the MSP430 controller in C and performing simple interfacing experiments and Part 3 deals with assembly language programming.

We are providing the PDF documents associated with six lessons (2 in each section) for your review.

Part 1 Introduction to the GNU/Linux programming environment

  1. General concepts regarding GNU/Linux and Free Software. The objective of the lesson is to introduce participants to some broad non-technical issues concerning Free Software; issues like licensing, copyright etc.
  2. Command line basics - part 1. This lesson introduces a few essential commands without which it is impossible to work on a GNU/Linux system.
  3. Understanding the GNU/Linux filesystem. This lesson is basically a tour of the file system - students will gain a broad understanding of the nature of data stored in various directories in the file system.
  4. Command line basics - part 2. We examine a few more commands in this lesson.
  5. An introduction to the "vi" editor.
  6. Understanding the C compilation process [sample PDF] . The journey of a C program from source to machine code involves many complex processing phases - this lesson provides a general idea of these phases (pre-processing, compilation proper, assembling, linking) by compiling sample C programs with different command-line switches and examining the output generated.
  7. Understanding the GNU/Linux shell. The shell is the most important "power tool" in the hands of the Unix programmer. This lesson provides a solid understanding of the nature of the shell.
  8. Introduction to the GNU Debugger, gdb. "gdb" is a tool used for troubleshooting programs - it is an integral part of the programmer's toolkit. This lesson introduces gdb.
  9. Understanding bit operations in C. It is impossible to do embedded systems programming without having a solid understanding of bit manipulation. This lesson introduces you to the world of bit-twiddling!
  10. Introduction to git, the distributed revision control tool [sample PDF]. Version control is an integral part of modern software engineering practice - this lesson provides an introduction to the most popular DVCS tool out there, git. Participants will use GitHub to share the source code of the exercises/projects they will do as part of the course.

Part 2 Programming and interfacing the MSP430 microcontroller

  1. Introduction to general embedded system concepts. Participants will do some research on the net and familiarize themselves with the terminology associated with embedded systems.
  2. General information regarding microcontrollers (microcontroller families, peripherals etc).
  3. Using mspdebug and msp430-gcc [sample PDF]. This lessons introduces the tools you will use to program the msp430 microcontroller.
  4. Writing our first msp430 program: use a GPIO pin to control an LED.
  5. Understanding digital inputs. In this lesson, we learn to use a GPIO pin to read a mechanical switch.
  6. Basics of Timer-A. Timers are very useful for a number of things like generating precise time delays, producing waveforms, counting events etc. In this lesson, we learn to use Timer-A of the msp430 microcontroller.
  7. Implementing a Fibonacci Linear Feedback shift register.
  8. Understanding hardware interrupts.
  9. Compiler optimizations - part 1. The compiler generates better quality code when you compile with optimizations enabled; but unless you understand what is really happening underneath, subtle bugs may bite you! In this lesson, we learn about the pitfalls associated with optimizations.
  10. Analog to digital conversion - part 1. We learn to use the ADC on the MSP430 processor in this lesson.
  11. Analog to digital conversion - part 2. An LED can be used as a light sensor! In this lesson, you will write a very interesting program which will use the msp430's ADC and an LED on the launchpad board to measure light intensity.
  12. Running LED's - in this lesson, you will build a small running led display on a breadboard and interface it with the launchpad board!
  13. Interfacing a seven segment display.
  14. Implementing Pulse Width Modulation. PWM is a common technique used for applications like motor speed control.
  15. Interfacing a potentiometer.
  16. Programming the watchdog timer [sample PDF]. The watchdog is an important part of the design of safety critical systems; in this lesson, you will learn how to program the msp430's watchdog timer.

Part 3 Introduction to mps430 architecture and assembly language programming

  1. MSP430 assembly language basics - part 1. In this lesson, we write a very simple assembly language program and use mspdebug to analyze the resulting machine code.
  2. MSP430 assembly language basics - part 2. In this lesson, we use mspdebug to set breakpoints and analyze the working of a few basic instructions.
  3. MSP430 assembly language basics - part 3. In this lesson, we put together a complete assembly language program (blinking LED's) using the ideas covered in parts 1 and 2.
  4. Stack Manipulation - part 1. Understanding the working of the stack is crucial to learning how the compiler generates code for subroutine calls, local variables etc. This lesson will get you started.
  5. Stack manipulation - part 2. This lesson reinforces the ideas presented in the first part.
  6. Understanding Compiler code generation - part 1.
  7. Understanding compiler code generation - part 2 [sample PDF].
  8. Compiler optimization, part 2. We read the assembly output produced by gcc and find out what really happens when the compiler starts optimizing our code.
  9. Understanding hardware interrupts - part 2. In a previous lesson, we had written an interrupt service routine in C - we now repeat the process in assembly language in order to gain a more low-level understanding.
  10. Writing startup code [sample PDF]. Many things have to be done (sort of behind-the-scene) before the "main" function in your C code can start running. The so-called startup code itself may be very complex in the case of microcontrollers like those in the ARM family. Fortunately, the startup code required for our msp430 processor is very small. In this lesson, we study the startup code in detail.
  11. Understanding the linker. The linker is what provides addresses to the symbols in your program. In this lesson, we learn some very simple ideas regarding the working of the linker.