Controllers: It's Uses and Embedded Systems

By Mona Kumari|Updated : July 4th, 2021

Embedded System

As its name suggests, Embedded means something that is attached to another thing. An embedded system can be thought of as a computer hardware system having software embedded in it. An embedded system can be an independent system, or it can be a part of a large system. An embedded system is a microcontroller or microprocessor-based system which is designed to perform a specific task. For example, a fire alarm is an embedded system; it will sense only smoke.

Embedded System

As its name suggests, Embedded means something that is attached to another thing. An embedded system can be thought of as a computer hardware system having software embedded in it. An embedded system can be an independent system, or it can be a part of a large system. An embedded system is a microcontroller or microprocessor-based system which is designed to perform a specific task. For example, a fire alarm is an embedded system; it will sense only smoke.

An embedded system has three components −

  • It has hardware.
  • It has application software.
  • It has Real Time Operating system (RTOS) that supervises the application software and provide mechanism to let the processor run a process as per scheduling by following a plan to control the latencies. RTOS defines the way the system works. It sets the rules during the execution of application program. A small-scale embedded system may not have RTOS.

So, we can define an embedded system as a Microcontroller based, software driven, reliable, real-time control system.

Characteristics of an Embedded System

  • Single-functioned− An embedded system usually performs a specialized operation and does the same repeatedly. For example: A pager always functions as a pager.
  • Tightly constrained− All computing systems have constraints on design metrics, but those on an embedded system can be especially tight. Design metrics is a measure of an implementation's features such as its cost, size, power, and performance. It must be of a size to fit on a single chip, must perform fast enough to process data in real time and consume minimum power to extend battery life.
  • Reactive and Real time− Many embedded systems must continually react to changes in the system's environment and must compute certain results in real time without any delay. Consider an example of a car cruise controller; it continually monitors and reacts to speed and brake sensors. It must compute acceleration or de-accelerations repeatedly within a limited time; a delayed computation can result in failure to control of the car.
  • Microprocessors based− It must be microprocessor or microcontroller based.
  • Memory− It must have a memory, as its software usually embeds in ROM. It does not need any secondary memories in the computer.
  • Connected− It must have connected peripherals to connect input and output devices.
  • HW-SW systems− Software is used for more features and flexibility. Hardware is used for performance and security.

byjusexamprep

Advantages

  • Easily Customizable
  • Low power consumption
  • Low cost
  • Enhanced performance

Disadvantages

  • High development effort
  • Larger time to market

Basic Structure of an Embedded System

The following illustration shows the basic structure of an embedded system −

byjusexamprep

  • Sensor− It measures the physical quantity and converts it to an electrical signal which can be read by an observer or by any electronic instrument like an A2D converter. A sensor stores the measured quantity to the memory.
  • A-D Converter− An analog-to-digital converter converts the analog signal sent by the sensor into a digital signal.
  • Processor & ASICs− Processors process the data to measure the output and store it to the memory.
  • D-A Converter− A digital-to-analog converter converts the digital data fed by the processor to analog data.
  • Actuator− An actuator compares the output given by the D-A Converter to the actual (expected) output stored in it and stores the approved output.

Assembly languages were developed to provide mnemonics or symbols for the machine level code instructions. Assembly language programs consist of mnemonics; thus, they should be translated into machine code. A program that is responsible for this conversion is known as assembler. Assembly language is often termed as a low-level language because it directly works with the internal structure of the CPU. To program in assembly language, a programmer must know all the registers of the CPU.

Different programming languages such as C, C++, Java and various other languages are called high-level languages because they do not deal with the internal details of a CPU. In contrast, an assembler is used to translate an assembly language program into machine code (sometimes also called object code or opcode). Similarly, a compiler translates a high-level language into machine code. For example, to write a program in C language, one must use a C compiler to translate the program into machine language.

Structure of Assembly Language

An assembly language program is a series of statements, which are either assembly language instructions such as ADD and MOV, or statements called directives.

An instruction tells the CPU what to do, while a directive (also called pseudo-instructions) gives instruction to the assembler. For example, ADD and MOV instructions are commands which the CPU runs, while ORG and END are assembler directives. The assembler places the opcode to the memory location 0 when the ORG directive is used, while END indicates to the end of the source code. A program language instruction consists of the following four fields −

[ label:]   mnemonics  [ operands ]   [;comment ]

A square bracket ( [ ] ) indicates that the field is optional.

  • The label fieldallows the program to refer to a line of code by name. The label fields cannot exceed a certain number of characters.
  • The mnemonicsand operands fields together perform the real work of the program and accomplish the tasks. Statements like ADD A, C & MOV C, #68 where ADD and MOV are the mnemonics, which produce opcodes ; "A, C" and "C, #68" are operands. These two fields could contain directives. Directives do not generate machine code and are used only by the assembler, whereas instructions are translated into machine code for the CPU to execute.

1.0000         ORG  0H           ; start (origin) at location 0

2 0000 7D25    MOV  R5,#25H       ;load 25H into R5

3.0002 7F34    MOV  R7,#34H       ;load 34H into  R7

4.0004 7400    MOV  A,#0          ;load 0 into A

5.0006 2D      ADD  A,R5          ;add contents of R5 to A

6.0007 2F      ADD  A,R7          ;add contents of R7 to A

7.0008 2412    ADD  A,#12H        ;add to A value 12 H

8.000A 80FE    HERE: SJMP HERE    ;stay in this loop

9.000C END                        ;end of asm source file

  • The comment fieldbegins with a semicolon which is a comment indicator.
  • Notice the Label "HERE" in the program. Any label which refers to an instruction should be followed by a colon.

Assembling and Running an 8051 Program

Here we will discuss about the basic form of an assembly language. The steps to create, assemble, and run an assembly language program are as follows −

  • First, we use an editor to type in a program like the above program. Editors like MS-DOS EDIT program that comes with all Microsoft operating systems can be used to create or edit a program. The Editor must be able to produce an ASCII file. The "asm" extension for the source file is used by an assembler in the next step.
  • The "asm" source file contains the program code created in Step 1. It is fed to an 8051 assembler. The assembler then converts the assembly language instructions into machine code instructions and produces an .obj file(object file) and a .lst file (list file). It is also called as a source file, that is why some assemblers require that this file have the "src" extensions. The "lst" file is optional. It is very useful to the program because it lists all the opcodes and addresses as well as errors that the assemblers detected.
  • Assemblers require a third step called linking. The link program takes one or more object files and produces an absolute object file with the extension "abs".
  • Next, the "abs" file is fed to a program called "OH" (object to hex converter), which creates a file with the extension "hex" that is ready to burn into the ROM.

 

 byjusexamprep

Debugging Tools in an Embedded System

Debugging is a methodical process to find and reduce the number of bugs in a computer program or a piece of electronic hardware, so that it works as expected. Debugging is difficult when subsystems are tightly coupled, because a small change in one subsystem can create bugs in another. The debugging tools used in embedded systems differ greatly in terms of their development time and debugging features. We will discuss here the following debugging tools −

  • Simulators
  • Microcontroller starter kits
  • Emulator

Simulators

Code is tested for the MCU / system by simulating it on the host computer used for code development. Simulators try to model the behavior of the complete microcontroller in software.

Functions of Simulators

A simulator performs the following functions −

  • Defines the processor or processing device family as well as its various versions for the target system.
  • Monitors the detailed information of a source code part with labels and symbolic arguments as the execution goes on for each single step.
  • Provides the status of RAM and simulated ports of the target system for each single step execution.
  • Monitor’s system response and determines throughput.
  • Provides trace of the output of contents of program counter versus the processor registers.
  • Provides the detailed meaning of the present command.
  • Monitors the detailed information of the simulator commands as these are entered from the keyboard or selected from the menu.
  • Supports the conditions (up to 8 or 16 or 32 conditions) and unconditional breakpoints.
  • Provides breakpoints and the trace which are together the important testing and debugging tool.
  • Facilitates synchronizing the internal peripherals and delays.

Microcontroller Starter Kit

A microcontroller starter kit consists of −

  • Hardware board (Evaluation board)
  • In-system programmer
  • Some software tools like compiler, assembler, linker, etc.
  • Sometimes, an IDE and code size limited evaluation version of a compiler.

A big advantage of these kits over simulators is that they work in real-time and thus allow for easy input/output functionality verification. Starter kits, however, are completely sufficient and the cheapest option to develop simple microcontroller projects.

Emulators

An emulator is a hardware kit or a software program or can be both which emulates the functions of one computer system (the guest) in another computer system (the host), different from the first one, so that the emulated behavior closely resembles the behavior of the real system (the guest).

Emulation refers to the ability of a computer program in an electronic device to emulate (imitate) another program or device. Emulation focuses on recreating an original computer environment. Emulators can maintain a closer connection to the authenticity of the digital object. An emulator helps the user to work on any kind of application or operating system on a platform in a similar way as the software runs as in its original environment.

Peripheral Devices in Embedded Systems

Embedded systems communicate with the outside world via their peripherals, such as following &mins.

  • Serial Communication Interfaces (SCI) like RS-232, RS-422, RS-485, etc.
  • Synchronous Serial Communication Interface like I2C, SPI, SSC, and ESSI
  • Universal Serial Bus (USB)
  • Multimedia
  • Cards (SD Cards, Compact Flash, etc.)
  • Networks like Ethernet, Lon Works, etc.
  • Fieldbuses like CAN-Bus, LIN-Bus, PROFIBUS, etc.
  • imers like PLL(s), Capture/Compare and Time Processing Units.
  • Discrete IO aka General-Purpose Input/Output (GPIO)
  • Analog to Digital/Digital to Analog (ADC/DAC)
  • Debugging like JTAG, ISP, ICSP, BDM Port, BITP, and DP9 ports

 

Candidates can practice 150+Mock Tests with BYJU'S Exam Prep Test Series for exams like GATE, ESE, NIELIT from the following link:

Click Here to Avail Electronics Engineering Test Series (150+ Mock Tests)

Get unlimited access to 24+ structured Live Courses all 150+ mock tests to boost your GATE 2021 Preparation with Online Classroom Program:

Click here to avail Online Classroom Program for Electronics Engineering

Thanks

Sahi Prep Hai To Life Set Hai.

 
Download BYJU'S Exam Prep, Best gate exam app for Preparation

Comments

write a comment

Follow us for latest updates