3 Microcontrollers and Embedded Processors

Dr K. Vani

 

In this module, microcontrollers and embedded processors will be discussed in detail. To start with, the definitions of embedded systems, the architecture of embedded systems and advantages of embedded systems will be discussed. The difference between microprocessors and microcontrollers will be discussed. Examples of embedded systems will also be listed.

 

1.1 Embedded System

 

An Embedded system is defined as “A system that has software embedded into the computer-hardware, which makes a system dedicated for an application(s) or specific part of an application or product or part of a larger system”; (or as ) “A system that has a dedicated purpose software embedded in a computer hardware; that is, it is designed for a unique purpose. Or as, “A dedicated computer based system for an application(s) or product”. It may be an independent system or a part of a large system. Its software usually embeds into a ROM (Read Only Memory) or flash.

 

Embedded systems are electronic systems that contain a microprocessor or a microcontroller, but we do not think of them as computers – the computer is hidden or embedded in the system. In short, the system consists of both software and hardware.

 

It is often a “special purpose” unit, (e.g.) a simple cell phone (it does not run MS-Word). We are not talking about smartphones ! A simple cell phone is used only for a specific purpose, that is, communication. It has a CPU, memory and programs that control mainly physical things. All the programs are pre-installed. When we are buying a simple cell phone, all the programs are already installed and we cannot change any settings. Normally a CPU is an independent unit, with program memory, and peripherals, residing outside the main CPU; whereas now, processors are used to control systems intelligently with inherent input-output devices, memory and interrupts, all built in.

 

Figure 1.1 Embedded System

 

In an embedded system, the program is pre-installed and cannot be changed easily. It has many advantages, like, limited processing power, limited electrical power and limited data storage. That is, memory requirement is not high, since all the programs are pre-installed. It has “intelligence”. It can be configured, personalized and programmed for a specific purpose. For example, consider a remote-control for car or a TV remote, which is designed for a specific purpose that purpose should be understandable by the system and that function should be configured.

 

1.1.2 Components of Embedded system

 

An embedded system embeds hardware to give computer like functionalities. It consists of a CPU which is designed for a special purpose. For embedding the code into the processor, memory is needed, which is the program memory and also the permanent memory. There will be Input and Output devices which are connected to the CPU (Fig 1.1). There will be sensors for measuring the physical values and actuators for controlling the physical things. Additional components can also be attached to the system according to the requirements.

 

It embeds the main application software generally into a flash or a ROM and the application software performs a number of tasks concurrently. The most important aspect is monitoring the system. For that purpose, a Real time Operating system is used which is different from the operating system used in general purpose computers. Real time operating system(RTOS) is embedded, for supervising the application-related tasks running on the hardware and organizing the accesses to system resources according to the priorities and the timing constraints of the tasks in the system.

 

The main difference between the Real time Operating System and a general-purpose OS is that RTOS schedules the task with “priorities” and these priorities may be static or dynamic. Both dynamic and static priorities are handled by the RTOS while an application is running on the system.

 

1.2 Comparison of Microprocessors & Microcontrollers

 

A Microprocessor is a general purpose microcomputer which does not have RAM, ROM and I/O ports (Fig 1.2). ROM, RAM, I/O ports and Timers are added externally to a general purpose microprocessor, such as Pentium, to make it functional. This whole system is called as a computer. In contrast, a microcontroller has CPU (microprocessor), RAM, ROM, I/O ports, Timer, ADC and other peripherals (Fig 1.3). All the components are available in a single chip, so that for designing a simple application like a toy, a remote control, or automatic door opener etc, this Microcontroller alone is sufficient.

 

 

These additions make the system bulkier and more expensive. But microprocessor has advantages of versatility and multi-functional.

 

A microcontroller has ROM, RAM, I/O ports, Timers and serial communication port on a single chip in addition to CPU . So there is no requirement for additional inclusions while developing an application. Serial communication port is used for communication purpose. I/O port is used to read and write onto the system. It is cheap, consumes very less power and the capability is very high.

 

1.3 Real time operating system (RTOS)

 

An embedded system has a Real time operating system (RTOS). It enables execution of concurrent processes or threads or tasks. RTOS also handles multiple threads. RTOS provides a mechanism to let the processor run each process as per schedule and to do context-switch between the various processes (threads or tasks). It sets the rules during execution of application processes to enable finishing of a process within the assigned time interval and with assigned priority.

 

1.4 Need for Embedded Processors

 

One of the most critical needs of the Embedded system is to decrease power consumption, space and cost. This can be achieved by integrating more functions into the CPU chip. Nowadays the entire computer can be built up on a single chip to reduce power consumption.

 

1.5 Applications

 

Some of the real world examples of embedded systems are listed below:

 

➢ Telephones, security systems, garage door openers, answering machines, TVs, cable TV tuner, VCR, camcorder, remote controls, video games, cellular phones, musical instruments, sewing machines, lighting control, paging camera, toys, exercise equipment are some appliances.

 

➢ In office telephones, security systems, fax machines, microwave, copier, laser printer, color printer, paging are some examples of embedded systems.

 

➢ In Automobile industry also these kind of systems are used. Some of them are Engine control, air bag, ABS, instrumentation, security system, transmission control, entertainment, climate control, cellular phone, keyless entry etc.

 

Though many embedded systems are available, mobile phone is a widely used product. As everybody knows about this product, in this section, Antilock breaking system (ABS) in automobile industry will be discussed in detail.

 

1.5.1 Antilock Braking System

 

ABS is one of the most popular systems in automotive electronics. ABS is a mechanism to prevent skidding due to locking up of the wheels. Consider a situation in which a vehicle is moving at a high speed and is suddenly confronted by an obstacle in its path. In a moment of panic, the driver applies full brakes, the wheels are locked and hence they start skidding on the road. As a result of this, the vehicle does not change direction but skids in the direction of obstacle. If the wheels had not got locked up, the vehicle would have changed direction and this collision could have been prevented. This is the basic concept behind ABS.

 

An ABS (Fig 1.4) consists of an ECU, wheel sensors and Hydraulic brakes. The wheel sensors inform the ECU about the speed of the wheels. The speed of the wheels relative to each other is important and hence their differences are analyzed. Whenever a wheel is moving significantly slower or faster than the other wheels, the ABS applies hydraulic brakes appropriately.

 

If one wheel is moving faster than the other wheels, the ABS increases the brakes applied on the wheel and if one wheel is moving slower than the other wheels, the ABS decreases the brakes applied on the wheel. After a few accelerations and decelerations, all the wheels will be having similar speeds. The latest ABS mechanism makes use of brake pulsing in which the wheels are subject to a sequence of quick alternate accelerations and decelerations.

 

The main advantage of ABS is that it prevents wheel lockup and hence, gives the driver steering control, even after application of the full brake. This reduces the risk of accidents. ABS also has the added advantage of lesser braking distance when compared to vehicles without ABS.

 

Braking distance is the distance a vehicle travels after application of brakes before coming to a stop. This also depends on road conditions. On snow-covered roads, vehicles without ABS have lesser braking distance than the ones with ABS. However, ABS still gives the driver better control over the car on such roads.

 

2. Summary

 

In this lecture we have outlined the definitions of embedded systems. The architecture of embedded system is discussed. Differences between microprocessors and microcontrollers are discussed and embedded system examples are listed. ABS is discussed as a real world embedded system example.

 

3.References

  1. The 8051 Microcontroller and Embedded Systems Using Assembly and C Second Edition Muhammad Ali Mazidi, Janice Gillispie Mazidi and Rolin D.McKinlay Pearson Education, Second Edition 2008
  2. Embedded systems An integrated approach by LYLA.B.DAS, Pearson first edition 2013 (for Anti Lock Braking System)

 

Supporting books

 

Web Links

  • http://en.wikipedia.org/wiki/Embedded_system
  • http://en.wikibooks.org/wiki/Embedded_Systems/Embedded_Systems_Introduction