Professional Documents
Culture Documents
Part B
10. Explain operational Quality Attributes of an Embedded System.
Any 5x2 = 10marks
11. Explain the role of the following circuit in Embedded system:
(a) Real-Time Clock (b) Watch-Dog Timer
a) 5marks b) 5marks
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 3
12. Explain the components of a typical embedded system.
Block diagram -2marks, Explanation -8 marks
13. Explain Memory Mapping of MSP430 Microcontroller.
Figure-4 marks, Explanation-6 marks
14. Explain Status Register and Constant Generator Registers in MSP430 Microcontroller
Explanation--Status register- 5marks, Constant generator-5marks
15. (a) Explain layout of Assembly Language.
Explanation 4 marks, Example- 1mark
(b) Explain MSP430 Shift and Rotate Instructions
Explanation – 3marks, Example- 2marks
16. Explain Editor, Assembler/Compiler, Linker, Stand-alone Simulator, Flash Programmer.
2x5 =10marks
17. Explain Hardware Multiplier with Hardware Multiplier Registers.
Block diagram- 4 marks, Explanation-6marks
18. Explain MSP430 Timer-A with block diagram
Block diagram- 4 marks, Explanation-6marks
19. Explain Architecture and Operation of MSP430 Comparator-A with block diagram
Block diagram-2 marks, Explanation- architecture-4 marks, operation- marks
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 4
VI Semester Diploma Examination, April/May-2021
EMBEDDED SYSTEMS
------------------------------------------------------------------------------
Time:3 Hours Max. Marks: 100
Instructions: i) Answer any six questions from Part – A.
ii) Answer any seven full questions from Part – B.
Model Answers
PART-A
1. List some applications of Embedded Systems.
Embedded Systems in Automobiles
Motor Control System
Cruise Control System
Engine or Body Safety
Robotics in Assembly Line
Car Entertainment
Car multimedia
Mobile and E-Com Access
Embedded systems in Telecommunications
Mobile computing
Networking
Wireless Communication
Embedded Systems in Smart Cards
Banking
Telephone
Security Systems
Embedded Systems in Missiles and Satellites
Defense
Aerospace
Communication
Embedded Systems in Computer Networking & Peripherals
Networking Systems
Image Processing
Printers
Networks Cards
Monitors and Displays
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 5
Embedded Systems in Digital Consumer Electronics
DVDs
Set top Boxes
High Definition TVs
Digital Cameras
Microprocessor Microcontroller
Microprocessors are multitasking in nature. Can Single task oriented. For example, a washing
perform multiple tasks at a time. For example, machine is designed for washing clothes only
on computer we can play music while writing
text in text editor.
RAM, ROM, I/O Ports, and Timers can be RAM, ROM, I/O Ports, and Timers cannot be
a added externally and can vary in numbers added externally. These components are to be
embedded together on a chip and are fixed in
numbers
Designers can decide the number of memory or Fixed number for memory or I/O makes a
I/O ports needed. microcontroller ideal for a limited but specific task
External support of external memory and I/O Microcontrollers are lightweight and cheaper than
ports makes a microprocessor-based system a microprocessor
heavier and costlier
External devices require more space and their A microcontroller-based system consumes less
power consumption is higher power and takes less space.
If any unit is not working, only that particular If any unit is not working then entire IC is to be
unit can be replaced as it is externally connected replaced
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 6
Register mode
Indexed mode
Symbolic mode (PC relative mode)
Absolute mode
Indirect Register mode
Indirect auto increment register mode
Immediate mode
SP- relative mode
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 7
8. Explain Non-Interruptible I/O with pin logic diagram.
Non-Interruptable I/O
I/O ports P3, P4, P5 and P6 are Non-Interruptable I/O. Use of non-interruptable I/O is simple. Each bit
is individually controllable. Each bit can be configured as input, output or dedicated function I/O.
Direction register
Input register
Output register and
Function select register
Direction Registors (PxDIR)
Direction registers are Read/Write 8-bit registers control the signal direction for port pins.
PxDIR configuration :
Bit =1: The port pin is set up as an output;
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 8
Bit = 0: the port pin is set up as an input.
Function Select Registers are read-write registers. These determine the use of the individual pins on the
1/O port general-purpose port or peripheral module function.
PxSEL configuration:
Bit = 0: I/O function is selected for the pin;
To use the on-chip temperature sensor, the analog input channel INCHx 1010 is selected. Any
other configuration is done as if an external channel was selected, including reference selection,
conversion memory selection, etc. The typical temperature sensor transfer function is shown as in the
above figure. When using the temperature sensor, the sample period must be greater than 30μs. The
temperature sensor offset error is large. Deriving absolute temperature values in the application
requires
calibration.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 9
Selecting the temperature sensor automatically turns on the on-chip reference generator as a voltage
source for the temperature sensor. However, it does not enable the VREF+ output or affect the
reference selections for the conversion. The reference choices for converting the temperature sensor are
the same as with any other channel.
PART B
10. Explain operational Quality Attributes of an Embedded System.
Operational Quality Attributes: These are the attributes related to operation or functioning of an
embedded system. The way an embedded system operates affects its overall quality.
Response: Response is a measure of quickness of the system. It gives you an idea about how
fast your system is tracking the input variables. Most of the embedded system demand fast
response which should be real-time.
Throughput: Throughput deals with the efficiency of system. It can be defined as rate of
production or process of a defined process over a stated period of time. In case of card reader
like the ones used in buses, throughput means how much transaction the reader can perform in a
minute or hour or day.
Reliability: Reliability is a measure of how much percentage you rely upon the proper
functioning of the system. Mean Time between failures and Mean Time To Repair are terms
used in defining system reliability. Mean Time between failures can be defined as the average
time the system is functioning before a failure occurs. Mean time to repair can be defined as the
average time the system has spent in repairs.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 10
Maintainability: Maintainability deals with support and maintenance to the end user or a client
in case of technical issues and product failures or on the basis of a routine system checkup. It
can be classified into two types:-
o Scheduled or Periodic Maintenance: This is the maintenance that is required regularly
after a periodic time interval. Example: Periodic Cleaning of Air Conditioners, Refilling
of printer cartridges.
o Maintenance to unexpected failure: This involves the maintenance due to a sudden
breakdown in the functioning of the system. Example: Air conditioner not powering on,
Printer not taking paper in spite of a full paper stack
Security
Confidentiality, Integrity and Availability are three corner stones of information security.
Confidentiality deals with protection data from unauthorized disclosure. Integrity gives
protection from unauthorized modification. Availability gives protection from unauthorized
user. Certain Embedded systems have to make sure they conform to the security measures. Ex.
An Electronic Safety Deposit Locker can be used only with a pin number like a password.
Safety
Safety deals with the possible damage that can happen to the operating person and environment
due to the breakdown of an embedded system or due to the emission of hazardous materials
from the embedded products. A safety analysis is a must in product engineering to evaluate the
anticipated damage and determine the best course of action to bring down the consequence of
damages to an acceptable level.
11. Explain the role of the following circuit in Embedded system:(a) Real-Time Clock
(b) Watch-Dog Timer
(a) Real-Time Clock
An RTC (Real time clock) is a component of embedded system which keeps track of
time. RTC holds information like current time in hours, minutes and seconds in 12 hour or 24
hour format, date, month, year, day of the week etc. and it supplies the timing reference to the
system.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 11
Maintaining timer's mechanisms that are able to notify the user program that a certain interval
of time has elapsed. A timer circuit is configured as system clock, which ticks and generates
interrupts periodically.
The clock circuits are used both to keep track of the current time of day and to make precise
time measurements.
The timer circuits are programmed by the kernel, so that they issue interrupts at a fixed,
predefined frequency; such periodic interrupts are crucial for implementing the software timers
used by the kernel and the user programs.
In real time programming, system clock is used for scheduling various tasks. Read-time clocks
are typically composed of a crystal-controlled oscillator, numerous cascaded counters, and a
battery backup. The crystal-controlled oscillator generates a very consistent high-frequency
digital pulse that feed the cascaded counters.
(b) Watch-Dog Timer
A watchdog timer (WDT) is a hardware timer that automatically generates a system reset if the
main program neglects to periodically service it. It is often used to automatically reset an embedded
device that hangs because of a software or hardware fault. The watchdog and CPU may share a
common clock signal, as shown in the block diagram below, or they may have independent clock
signals.
A watchdog timer is a hardware that can be used automatically detect software anomalies and resets
processor if any occur. Watchdog timer is based on a counter that counts down from some initial value
to zero.
A timer unit for monitoring the firmware execution. Depending on the internal implementation,
watchdog timer increments or decrements after running counter with each clock pulse and generates
reset signal to reset the processor if the count reaches zero for a down counting watchdog, or the
highest count value for an up counting watchdog.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 12
12. Explain the components of a typical embedded system.
Hardware,
Software
Real time operating system.
The Real time Operating System supervises the application software and
provides the mechanism to run the processor as per schedule switchingfrom one task
to another.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 13
A
typical
embedd
ed
system
is as
shown
in the
above
figure.
The elements are as follows:
1. System core: This can be a single chip controller consisting of ALU, controlunit, instruction decoder
etc. The core connects to every other unit of the system.
The system core can be a Microprocessor, a Microcontroller, FieldProgrammable Gate
Array (FPGA), Digital Signal Processor (DSP), Application Specific Integrated Circuit
(ASIC) or Application Specific Standard Product (ASSP).
7. Embedded firmware: This refers to the control program dumped intocode/program memory.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 15
14. Explain Status Register and Constant Generator Registers in MSP430 Microcontroller
STATUS REGISTER (SR): The status register keeps the content of arithmetic flags (C,
V, N, Z), as well as some control bits such as SCG1, SCG0, OSCOFF, CPUOFF, and GIE. The system
flags are changed automatically by the CPU depending on the result of an operation in a register. The
reserved bits of the SR are used to support the constant generator.
BIT 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OSC CPU
OP RESERVED V SCG1 SCG0 GIE N Z C
OFF OFF
V Overflow bit. It is set when arithmetic operation overflows the signed variable
range.
SCG1 System Clock Generator1- Turns off the SMCLK
SCG0 System Clock Generator 0 – Turns off the DCO DC generator
OSCOFF Oscillator off. It turns off the LFXT1 crystal oscillator
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 16
CPUOFF Turns off the CPU
GIE General Interrupt Enable. Enables Maskable Interrupts
N Negative Bit. It sets when the operation result of byte or a word is a negative
number.
Z Zero bit. It sets when the result of operation result of byte or a word is Zero.
C Carry Bit. It is set when the operation result in a byte or a word generates a
carry.
Depending on the source-register addressing modes (As) value, six commonly used constants can be
generated without a code word or code memory access to retrieve them. Thus, they need not be fetched
from memory whenever they are needed. This is a very powerful feature, which allows the
implementation of emulated instructions. For example, instead of implementing a core instruction for
an increment, the constant generator is used. It uses both R2 and R3 to provide a range of useful values
by exploiting the CPU's addressing modes. Values of constant generator are as below.
Register As Constant Remarks
R2 00 - Register Mode
R2 01 (0) Absolute Mode
R2 10 00004h +4, bit processing
R2 11 00008h +8, bit processing
R3 00 00000h 0, word processing
R3 01 00001h +1
R3 10 00002h +2, bit processing
R3 11 0FFFFh -1, word processing
RLC dst / RLC.W dst / RLC.B dst (Rotate left through Carry)
Example: RLC R7
Before Execution: R7= 1234H , C=1 [1 0001 0010 0011 0100]
• A rotate operation is a circular shift in which no bits are discarded. A rotate right of the 8 bit binary
number 1000 1011 gives 1100 0101.
RRA dst / RRA.W dst / RRA.B dst (Rotate Right Arithmatically)
Example: RRA R7
Before Execution: R7= 1234H , C=1 [0001 0010 0011 0100 1]
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 18
• An arithmetic right shift is similar to a logical right shift, except that the leftmost bits are filled with
the sign bit of the original number instead of 0's. An arithmetic right shift of the 8 bit number 1000
1011 gives 1100 0101.
RRC dst / RRC.W dst / RRC.B dst (Rotate Right through Carry)
Example: RRC R7
Editor: The very first tool in the development of software for an embedded system is a text editor. You
need to write source code. In Embedded System Development Tools, Editor is used to writing code for
embedded systems applications. It is the editor where you write that code. The code is written in
programming language either C++ or C. After the program is typed it can be saved in .asm format in
assembly programming and .C format in embedded programming in some secondary storage like hard
disk , floppy disk for permanent storage .
Assembler or Compiler: Compiler/Assembler is the second tool in embedded system software
development. Once source code is written , it needs to translate that code into the instructions on the
basis of which, the microcontroller will operate. The set of instructions in the microcontroller is called
as ‘Op Codes’. Most of the times, the Op Codes are not written in bits but in hexadecimal numbers.
And one hexadecimal number means 4 bits. Two hexadecimal number will represent 8 bits that mean 1
byte. Op Codes are actually bits (0 and 1) that are present in a sequence. The compiler is used to for
translating the source code into another code called ‘hex code’. This code now represents the machine’s
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 19
instruction code. The purpose of the compiler is the conversion of a high-level programming language
into a low-level programming language.
Linker: The codes are written into smaller parts for ease. The linker is a program that combines the
number of codes for execution. Linkers are used for linking the codes that are saved in different files
into one single final program. It also takes much care of allocation of memory of chips so that the
different modules saved into a single program do not overlap.
Stand-alone Simulator: It simulates the operation of MCU on a desktop computer without the real
hardware. Many simulator module a target CPU, memory system and I/O devices.
The main advantages of simulator are
- to know the behavior of the system without building actually it.
- Results are accurate in general, compared to analytical world
Main disadvantages are
- Expensive to build a MCU simulation model
- Many times simulation model is designed to simulate only important parts
Flash programmer: Flash programmer is a non-volatile memory type which can be electrically erased
and reprogrammed repeatedly. Flash programmer downloads the program into flash memory of the
MCU. Uses a hardware device and an on-chip debug connector like JTAG on the target system to down
load the program.
The type of operation is selected by the 1st operand is written to. It has two 16-bit operand registers
OP1, OP2 and three result registers RESLO, RESHI & SUMEXT.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 20
OP1 (Operand 1 reg): based on the different register for OP1 differentoperation is chosen.
◦ 130h – MPY
◦ 132h – MPYS
◦ 134h – MAC
◦ 136h – MACS
OP2 (operand 2): only after the 2nd operand is written, the multiplicationprocess starts.
The result is written in 3 registers.
SUMEXTEND – During MPY it carries 0000h always. During MPYS it carriesthe extended
sign of the result.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 21
◦ During MACS it contains the sign of the result extended.
Timer Block:
It consists of 16-bit TAR register sources of the clock, clock-divider unitand TAIFG which is raised
when the counter returns to 0.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 22
Capture/compare channels : Most events occur here are based on a register TACCRn. They all work in
the same way with the important exception of TACCRO. Each channel can be as below:
Capture an input, which means recording the "time" (the value in TAR) at which the input changes in
TACCRn; the input can be either external or internal from another peripheral or software.
Compare the current value of TAR with the value stored in TACCRn and update an output when they
match; the output can again be either external or internal.
Request an interrupt by setting its flag TACCRn CCIFG on either of these events; this can be done
even if no output signal is produced.
Sample an input at a compare event; this special feature is particularly useful if timer_A is used for
serial communication in a device that lacks a dedicated interface.
Timer_A is modular and the number of capture/compare channels varies between devices.
Capture/compare channel is special in two ways. Its register TACCR0is taken over for the modulus
value in Up/Down modes, so that it is no longer available for its usual functions. It also has its own
interrupt vector with a higher priority than the other interrupts from Timer A, which share a common
vector. Therefore channel 0 should be chosen for the most urgent tasks if it is free.
19. Explain Architecture and Operation of MSP430 Comparator-A with block diagram.
The comparator compares the analog voltges on its two input terminals, at the V+ and V- input
terminals. Its output is high if V+ > V- and low if V+<V-. Thus it provides a basic bridge between the
analog and digital domains and acts like a 1-bit ADC. The comparator can be switched ON or OFF using
control bit CAON. The comparator should be switched OFF when not in use to reduce current consumption.
When the comparator is switched OFF, the CAOUT is always low.
As shown in the Figure, the non-inverting input V+ can be connected to external signals CA0-CA2
or left without an external connection. Non-inverting input for comparator is selected using bits P2CA4
and P2CA0.
The inverting input V- can be connected to external signals CA1-CA7 (but not CA0) or left
unconnected, according to bits P2CA[3: 1].
An internal voltage reference can be connected to non-inverting input V+ or inverting input V
It can also be connected to an internal reference. The internal reference voltage VCAREF can be
chosen from 1/4 VCC, 1/2 VCC or a nominally fixed voltage from a transistor, Vdiode. This is selected
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 23
with the CAREFx bits. It can be applied to either input of the comparator according to the CARSEL
bit.
The output of the comparator can optionally be filtered through an RC circuit to reduce oscillations in
the signal, which may arise if the inputs vary slowly. This is selected with the CAF bit.
The filtered output is brought to an external pin CAOUT. It is also connected internally to capture
input CCI1B of Timer_A and to the flag CAIFG. The flag CAIFG is raised on either a rising or falling
edge of the comparator output, selected with the CAIES bit.
This can in turn request an interrupt if CAIE is set. The interrupts are maskable and GIE must
therefore also be set for an interrupt to occur. Comparator_A+ has its own interrupt vector and the flag
is cleared automatically when the interrupt is serviced.
The outputs of the two input multiplexers can be shorted together by setting the CASHORT bit. The
idea is that this can be used to connect a capacitor to the input to form a sample-and-hold circuit.
Operation of Comparator
The comparator can be used directly to compare a variable input voltage with a reference, which may
be either one of the internal references or a second input. For example, the variable input might be from
a temperature sensor and the comparator should detect when the equipment may freeze. It can be useful
to connect a noisy input signal to the comparator so that the MSP430detects when the input goes
through a well-defined level, such as 0.5VCC.
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 24
If an analog-to-digital converter is needed rather than a plain comparator, then this can be achieved by
adding a capacitor to form an RC circuit and using a timer to measure its dynamic behavior.
*********
Certificate:
I certify that the model answer script that are prepared by me for the subject code 15EC62T are
from the prescribed text books and model answer script and scheme of valuation prepared by me are
correct
(Vatsala S V)
SGL/EC
Govt. Polytechnic, Channasandra
Contact No.- 7975275772
___________________________________________________________________________________
15EC62T- Embedded Systems April/ May 20-21 25