Click here to Skip to main content
14,549,334 members

Robotics/Embedded Systems - Part I

Rate this:
4.85 (33 votes)
Please Sign up or sign in to vote.
4.85 (33 votes)
31 Oct 2006CPOL
This article is the first part of a series of articles which will discuss embedded systems and their applications. It will use the BASIC Stamp II microcontroller for the creation of a simple robot.

Article Series

Image 1

Image 2


This article is Part I of a series of articles which is an attempt to introduce the reader into the world of embedded systems and their applications in the industry. I have decided to divide the topic into several parts that will be presented gradually as I complete them. The objective of the series will be a general discussion of embedded systems and what they are. In the process, I will also show how to assemble a basic robot using a robotics kit provided by Parallax which will be controlled through the BASIC Stamp II microcontroller. Towards the end of the series, I will start using the Microsoft Robotics Studio to illustrate some of the features available through the new IDE provided by Microsoft, if time permits.

So what is an embedded system? In general terms, an embedded system is any device that includes a programmable computer for a specific task. Sometimes it is also said that, an embedded system is nearly any computing system other than a desktop computer. Embedded systems are found everywhere these days! Your cell phone, digital camera, portable video games, calculators, digital watches, and etc… the list can go on for a really long time. This gives you an idea of the broad application base of embedded systems.


Understanding of computer architecture and microcontrollers is a plus for this series of articles. I will be discussing system design and theoretical concepts of microprocessor. Also some basic electronics knowledge would be helpful once we get into circuit design for the robot. All this will be provided and I will try to make it a good learning experience.

Characteristics of Embedded Applications

Embedded systems have several common characteristics that distinguish them from other computing systems: Single Function, Tightly Constrained, and Reactive to Real Time.

  • Single Function: An embedded system usually executes a specific program repeatedly.
  • Tightly Constrained: All computing systems have constraints on design metrics, but these constraints can be extremely tight on embedded systems.
  • Reactive and Real Time: must continually react to changes in the system's environment and must compute certain results in real time without delay.

An example of a real time embedded system is the computing systems in most of modern day cars. For example, BMW uses highly sensitive and sophisticated embedded systems to make the ride a better and safer experience for the driver. The 5 series, for example, makes several million calculations per second and uses this information to make proper adjustments to the critical components of the vehicle. Let's take a closer look at some of these components for a better understanding.

ABS (Antilock Brake System) and (ASC+T) Automatic Stability Control + Traction

An antilock brake system reduces skidding by pumping the brakes. An automatic stability and control system intervenes with the engine during maneuvering to improve the car's stability. These systems actively control critical systems of the car.

With ABS, sensors measure the speed at which the wheels are turning. If this decreases rapidly, the electronic steering system reports blocking danger. The pressure of the hydraulics is reduced immediately and then raised to just under the blocking threshold. The process can be repeated several times per second, and you can notice it by the pulsation on the brake pedal.

To improve ABS, BMW places a sensor on every single wheel. The advantage of 4 sensors is the higher regulation precision. By sensing 4 individual rpm's of the wheels, the braking power on the rear axle can be adjusted with a great deal more sensitivity.

BMW's four wheel-speed sensors are in constant contact with all four wheels, providing greater accuracy than systems that use just three sensors. Each sensor carries accurate feedback from a specific wheel independently. A three-sensor system provides an average wheel-speed figure for rear wheels.

Image 3

Image 4

Automatic Stability Control + Traction is a suspension control system that reduces engine output, until the vehicle can move or acceleration can take place, without the wheels spinning. This happens regardless of how the driver is using the accelerator. If the reduction in acceleration is not enough, each drive wheel is braked individually until both wheels have optimum traction. Braking is under control of the BMW pioneered Anti-lock Braking System (ABS) system.

Intelligent regulation systems prevent the vehicle from swerving when accelerating on a loose surface, insuring that directional stability is reliably maintained.

  • If a wheel threatens to spin, the wheel brake is applied or else the system intervenes to regulate the engine management accordingly. Only so much throttle is applied to insure lateral stability, even if the accelerator is fully depressed.
  • An integrated engine drag torque regulation system stops the drive wheels from blocking if the driver suddenly removes his foot from the accelerator.
  • The system can be switched off if you desire.

The ABS and ASC+T systems must clearly communicate because the ASC+T interacts with the brake system. Since the ABS was introduced several years earlier than the ASC+T, it was important to be able to interface ASC+T with the existing ABS module, as well as other existing embedded modules. The engine and control management units include the electronically controlled throttle, digital engine management, and electronic transmission control. The ASC+T control unit has two microprocessors, one of which concentrates on logic-relevant components, and the other on performance specific components.

Image 5

Now that we have seen an example of a real world embedded system and its usefulness, let us concentrate on the technology itself.

Processor Technology

Processor technology relates to the architecture of the computation engine used to implement a system's desired functionality.

General Purpose Processors: The designer of a general purpose processor or a microprocessor builds a programmable device that is suitable for a variety of applications to maximize the devices sold.

Single Purpose Processor: A single purpose processor is a digital circuit designed to execute exactly one program.

Application Specific Processor: An application specific instruction set processor (ASIP) can serve as a compromise between the general purpose processor and the single purpose processor. As ASIP is a programmable processor optimized for a particular class of applications having common characteristics, such as embedded control, digital-signal processing, or telecommunications.

Using a general purpose processor in an embedded system may result in several design benefits. Flexibility is high because changing functionality requires changing only the program. Time to market would be low, and unit cost would be low in small quantities compared to designing your own processors. Performance may not be as great for some more computation intensive applications.

Using a single purpose processor in an embedded system results in several design metric benefits. Performance may be fast, size and power may be small, and unit cost may be low for large quantities.

Using an ASIP in an embedded system can provide the benefit of flexibility while still achieving good performance, power and size. Microcontrollers and digital signal processors are two well known types of ASIPs that have been used for several decades. A microcontroller is a microprocessor that has been optimized for embedded control applications.

Digital signal processors (DSPs) are another common type of ASIP. A DSP is a microprocessor designed to perform common operations on digital signals, which are the digital encoding of analog signals likes video and audio.

We will be more concentrating on general purpose processors.

General Purpose Processors

A general purpose processor is a programmable digital system intended to solve computational problems in a large variety of applications.

Image 6

The same processor can be used to solve computational problems in applications as diverse as communication, automotive, and industrial embedded systems.

Basic Architecture

A general purpose processor consists of a data path and a control unit tightly linked with a memory.

Image 7


The datapath consists of the circuitry for transforming data from and for storing temporary data. It consists of an arithmetic logic unit (ALU) capable of transforming data through operations such as addition, subtraction, logical AND, logical OR, inverting and shifting.

The datapath also contains registers capable of storing temporary data. Processors are typically distinguished by their size, and we usually measure the size of the processor as the bit width of the datapaths components. Common processor sizes include, 4-bit, 8-bit, 16-bit, 32-bit and 64-bit. The processor which we will be using for our robot construction is a 16-bit general purpose processor.

In some cases a particular processor may have different sizes among its registers, ALU, internal bus or external bus. For example, a processor may have a 16-bit internal bus, ALU and registers, but have old 8-bits of external but to reduce the number of pins on the processor's IC.

We will discuss the processor in more detail in the second part of the article.

Control Unit

The control unit consists of circuitry for retrieving program instructions and for moving data to, from and through the datapath according to those instructions.

For each instruction the controller typically sequences through several stages, such as fetching the instruction from memory, decoding it, fetching operands, executing the instruction in the datapath, and storing the results. Each stage may consists of one or more clock cycles. A clock cycle is usually the longest time required for data to travel from one register to another.


While registers server a processor's short-term storage requirements, memory server the processor's medium and long-term information-storage requirements. We can classify storage information as either program or data.

Program information consists of the sequence of instruction that cause the processor to carry out the desired system functionality. Data information requests the values being input, output and transformed by the program.

Points of Interest

This introduction is only a scratch on the surface of computer architecture. It covers the basic ideas and gives a footing for the reader for the remaining parts of the article series. There are a lot of good books on computer architecture available that you can study to get a deeper understanding of the subject. I will list some of the books that I have used and think that are worthwhile for reading and reference.

  • Computer Organization, by Carl Hamacher, Zvonko Vranesic, Safwat Zaky
  • Computer Architecture: A Minimalist Perspective (The International Series in Engineering and Computer Science) (Hardcover), by William F. Gilreath, Phillip A. Laplante

There are of course more books on the subject which you might want to consider. Keep in mind the objective of this article is not computer design and architecture, but how to use the concepts to implement a simple embedded system; we will use a robot to demonstrate the concepts.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Vahe Karamian
Software Developer Noorcon Inc.
United States United States
Published Books:

Introduction to Game Programing: Using C# and Unity 3D designed and developed to help individuals that are interested in the field of computer science and game programming. It is intended to illustrate the concepts and fundamentals of computer programming. It uses the design and development of simple games to illustrate and apply the concepts.

Book Preview:
Preview all chapters

Available from:
Barnes and Noble Book Store
Amazon Kindle (eBook)
iTunes - iBook (eBook)

Vahé Karamian

Comments and Discussions

Questionvectors firesale Pin
Fouad Saber8-Nov-14 13:00
MemberFouad Saber8-Nov-14 13:00 
GeneralMy vote of 5 Pin
Omar Khaled Mekkawy28-Aug-13 0:29
MemberOmar Khaled Mekkawy28-Aug-13 0:29 
GeneralRe: My vote of 5 Pin
Vahe Karamian6-Mar-15 10:25
MemberVahe Karamian6-Mar-15 10:25 
GeneralGood Work Pin
James Kamau2-Nov-10 19:00
MemberJames Kamau2-Nov-10 19:00 
QuestionYou wrote TETRIS?? Pin
MikeKosak27-Jul-10 8:46
MemberMikeKosak27-Jul-10 8:46 
GeneralVery Nice work. Pin
Pal Subramaniam3-Jun-08 5:40
MemberPal Subramaniam3-Jun-08 5:40 
GeneralRe: Very Nice work. Pin
MikeKosak27-Jul-10 8:52
MemberMikeKosak27-Jul-10 8:52 
GeneralNice Article Pin
rilov12-Jul-07 13:41
Memberrilov12-Jul-07 13:41 
GeneralQuestion about your web site. Pin
craigk17-Nov-06 4:06
Membercraigk17-Nov-06 4:06 
GeneralRe: Question about your web site. Pin
Vahe Karamian18-Dec-06 13:12
MemberVahe Karamian18-Dec-06 13:12 
GeneralRe: Question about your web site. Pin
Vahe Karamian5-Feb-07 11:29
MemberVahe Karamian5-Feb-07 11:29 
GeneralGreat Stuff Pin
moegoe9-Nov-06 20:34
Membermoegoe9-Nov-06 20:34 
GeneralRe: Great Stuff Pin
Vahe Karamian10-Nov-06 12:15
MemberVahe Karamian10-Nov-06 12:15 
GeneralNice work Pin
gemex8-Nov-06 3:49
Membergemex8-Nov-06 3:49 
GeneralRe: Nice work Pin
Vahe Karamian8-Nov-06 9:37
MemberVahe Karamian8-Nov-06 9:37 
QuestionVisual Studio Robtics Pin
Taner Riffat1-Nov-06 18:48
MemberTaner Riffat1-Nov-06 18:48 
AnswerRe: Visual Studio Robtics Pin
Vahe Karamian8-Nov-06 9:42
MemberVahe Karamian8-Nov-06 9:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 31 Oct 2006


116 bookmarked