Introduction

Embedded programming deals with embedded systems. Embedded system is a computer system build into some device. Such system controls at least some aspects of device. Computer frequently performs functions that in the past were done by special-purpose hardware. Computer allows extra functionality, that were impossible or too expensive in the past.

Main aspect of embedded programming is interacting with external world. Due to diversity of embedded systems it is difficult to give general rules here, so this aspect is sometimes neglected in theoretical texts. However, there is a set of standard devices (interfaces) and we will learn how to deal with them.

First embedded system used computer consisting of several modules. However, advances in semiconductor technology allow putting complete computer system. including extra devices in a single chip. Such system is called microcontroller. Currently most embedded systems use microcontrollers (possibly using several microcontrollers as parts of a single system). Some embedded systems require heavy computations and contain either a larger general purpose microprocessor or a digital signal processor (DSP) or some special purpose computational hardware.

We will concentrate on microcontrollers as they are more affordable and simpler than alternatives. Typical microcontrollers are too small to run on them compilers and development environments. Also, embedded systems frequently lack devices like keyboard or screen. This means that programming methodology is different compared to programming PC-s. First, program is written on PC. Then a special compiler (cross compiler) running on PC generates code for microcontroller. Next, program is loaded to the target system. It is useful to have a development board containing debugging interface. However, we will start using Arduino environment.