0% found this document useful (0 votes)
606 views27 pages

Model Answer Paper Summer 2018

The document discusses answers to questions on embedded systems. It includes summaries of RAM organization in microcontrollers, functions of development tools like simulators, linkers and debuggers, descriptions of parallel communication protocols like PCI and PCI-X, and a diagram showing interfacing of an ADC with a microcontroller. It also classifies embedded systems and describes two of them.

Uploaded by

Tina Erin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
606 views27 pages

Model Answer Paper Summer 2018

The document discusses answers to questions on embedded systems. It includes summaries of RAM organization in microcontrollers, functions of development tools like simulators, linkers and debuggers, descriptions of parallel communication protocols like PCI and PCI-X, and a diagram showing interfacing of an ADC with a microcontroller. It also classifies embedded systems and describes two of them.

Uploaded by

Tina Erin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

MODEL ANSWER
SUMMER– 18 EXAMINATION
Subject Title: EMBEDDED SYSTEM
Important Instructions to examiners:
Subject Code:- 17658
1) The answers should be examined by key words and not as word-to-word as given in the model answer
scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to assess the
understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance (Not
applicable for subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the figure. The
figures drawn by candidate and model answer may vary. The examiner may give credit for any equivalent
figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may
vary and there may be some difference in the candidate’s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based
on candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on equivalent concept.

Q. Sub Answer Marking


No. Q.N. Scheme
Q.1 a) Attempt any THREE of the following; 12-Total
Marks
i) Draw internal RAM organisation of 89C5l microcontroller. Explain register 4 Marks
banks in it.
Ans: Labeled
diagram 2
Marks
Description of
Registration
bank
2 Marks

The 89c51 has 128 byte internal RAM and divided into 3 parts/area.
In first part :
32 bytes from addresses 00H to 1FH i.e. 32 registers organised in 4 banks. Each
bank contains 8 registers (each of 8 bit) and available at each address.
Registers are named as:

Page1
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Bank 0 –R0, R1, R2, R3, R4, R5, R6, R7


Bank 1 –R0, R1, R2, R3, R4, R5, R6, R7
Bank 2 –R0, R1, R2, R3, R4, R5, R6, R7
Bank 3 –R0, R1, R2, R3, R4, R5, R6, R7
If register banks are not selected, it can be used as general purpose area.
On reset Bank 0 is selected.
RS1 and RS0 bits (D3 and D4) of PSW register are used to select the register bank.

Note : Others parts of RAM not expected .

ii) State the function of simulator, linker compiler and debugger. 4 Marks

Ans: Simulator:- Only one


function of
1. It is the software that functions like the hardware without actual hardware. each :
2. Allows simulation of peripherals and I/O devices. 1 Mark
3. Allows checking of software before the hardware is available to the user.
Linker :-
1. Linker is used to link with the library and generation of executable file.
2. It is used for relocation process.
3. It is done during compilation also it can be done at run time by a relocating
loader.
4. It is a program that takes one or more objects generated by compiler and
combines them into a single executable program.

Compiler :-
1. It is program which converts high level language program to machine
language.
2. It also indicates the syntax errors in the program if any.
3. It generates object file corresponding to the target device.

Debugger :-
1. Debugger is used to find the error and it keeps the control over the system
environment and ability to test or follow the execution of the program.
2. Debugger allows the user to load program in to the system memory, executes the

Page2
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

program by single stepping and detect logical errors in the program.

iii) Describe parallel communication protocols. 4 Marks

Ans: Parallel Protocols : PCI and PCI-X Description or


any two
PCI :- features of :
PCI stands for Peripheral Component Interconnect/Interface bus. It is popular for
PCI
higher bandwidth processor independent which can function as peripheral bus. It is
(2 Marks)
introduced by Intel in 90’s.It is 32 bit local bus and extended up to 64 bit by
processor it requires. It has high speed I/O subsystem performance. The PCI is
PCI –X
designed to meet economically I/O requirement of modern system. It supports ten
I/O devices and provides 3 types of synchronous parallel interface. It has two (2 Marks)
versions: 32 bit (33 MHz) 64 bit (66 MHz).The data transfer rate for synchronous is
132 mbps and for asynchronous it is 528 mbps. The PCI driver can access hardware
automatically or by programmer can assign address. The automatic detection and
assignment of addresses of various devices simplifies the addition and removal of
the system peripheral. PCI is designed to support variety of microprocessor best
configuration including single and multi-processing system.

PCI-X :-
It is an extension of PCI bus and supports 64 bit, 100MHz transfer. PCI – X is revised
to double the maximum clock speed to improve the data exchange transfer between
processor and peripherals. The data exchange rate is 1.06 gbps.

iv) Draw a labelled interfacing diagram of ADC 0808 with 8951 microcontroller. 4 Marks

Ans: 4 Marks for


complete
labeled
diagram.

Note: Any labeled diagram showing handshaking signal of ADC (Data bus,
Channel Select, ALE,START, end of conversion, output enable ) Any port of
89C51 is considered for interfacing.

Page3
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

b) Attempt any ONE of the following: 06 Marks

i) Classify embedded system. Describe any two of them in short. 6 Marks


Ans: Classification
2 Marks

Description of
each 2 marks
( any two)

Small scale:-
8 bit or 16 bit microcontroller is used. These types of embedded systems are designed
with a single 8 or 16-bit microcontroller that may even be activated by a battery. For
developing embedded software for small scale embedded systems, the main
programming tools are an editor, assembler, cross assembler and integrated
development environment (IDE).

Medium scale:-
16 bit or 32 bit microcontroller or microprocessor is used. Such as DSP, RISC. These
types of embedded systems design with a single or 16 or 32 bit microcontroller, RISCs
or DSPs. These types of embedded systems have both hardware and software
complexities. For developing embedded software for medium scale embedded systems,
the main programming tools are C, C++, and JAVA, Visual C++, and RTOS, debugger,
source code engineering tool, simulator and IDE.

Sophisticated embedded system:-


ASIP, ARM, IP processors are used. These types of embedded systems have enormous
hardware and software complexities, that may need ASIPs, IPs, PLAs, scalable or
configurable processors. They are used for cutting edge applications that need hardware
and software Co-design and components which have to assemble in the final system.

Reactive and real-time:-


A real time embedded system is defined as a system which gives a required o/p in a
particular time. These types of embedded systems follow the time deadlines for
completion of a task. Real time embedded systems are classified into two types such as
soft and hard real time systems .Example is autopilot system in a flight.
 Hard Real Time: System gives absolute Guarantee. Strictly adhere to each
deadline.
 Soft Real Time Statistical Guarantee .Dead line are mostly met.
Page4
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Networked :-
These types of embedded systems are related to a network to access the resources. The
connected network can be LAN, WAN or the internet. The connection can be any wired
or wireless. This type of embedded system is the fastest growing area in embedded
system applications. The embedded web server is a type of system wherein all embedded
devices are connected to a web server and accessed and controlled by a web browser.
 Example for the LAN networked embedded system is a home security system
wherein all sensors are connected and run on the protocol TCP/IP Embedded
System

Mobile Embedded Systems:-


 Mobile embedded systems are used in portable embedded devices like cell
phones, mobiles, digital cameras, mp3 players and personal digital assistants,
etc. The basic limitation of these devices is the other resources and limitation of
memory.

Stand-alone :-
This embedded systems do not require a host system like a computer, it works by itself.
It takes the input from the input ports either analog or digital and processes, calculates
and converts the data and gives the resulting data through the connected device-Which
either controls, drives or displays the connected devices. Examples for the stand alone
embedded systems are mp3 players, digital cameras, video game consoles, microwave
ovens and temperature measurement systems.

ii) Explain pre-emptive scheduling and round-robin scheduling algorithms in 6 Marks


RTOS.
Ans: Preemptive scheduling :-
Preemptive scheduling ensures that every task will get CPU time for execution . The 3 Marks to
allotment of CPU time depends on the preemptive scheduling algorithm. It allows a each
process to be interrupted in the middle of its execution, taking the CPU away and
allocating it to another process. The scheduling algorithm has high overhead. System is
costly and complex in design.

Shortest Job first:-


Shortest Job first is the example of this preemptive scheduling.
If a new process arrives with a CPU burst length less than the remaining time of the
current executing process, pre-empt. This scheme is known as the Shortest-Remaining-
Time-First (SRTF).

Priority scheduling in pre-emptive :-


A preemptive approach will pre-empt the CPU if the priority of the newly-arrived
process is higher than the priority of the currently running process. (diagram)

Page5
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

PREEMPTIVE KERNEL
Low Priority Task
(1) (2) ISR
High Priority Task

(4)
(3)
(5)
ISR makes the high
Priority task ready
Time

(6)

(7)

Round-robin scheduling:-
In the round robin algorithm, each process gets a small unit of CPU time (a time
quantum), usually 10-100 milliseconds. After this time has elapsed, the process is pre
empted and added to the end of the ready queue. If there are ‘ n’ processes in the ready
queue and the time quantum is ‘q’, then each process gets ‘1/n’ of the CPU time in
chunks of at most ‘q’ time units at once. No process waits more than ‘ (n-1)q’ time
units.
Performance of the round robin algorithm
q large then FCFS
q small then q must be greater than the context switch time; otherwise, the
overhead is too high
One rule of thumb is that 80% of the CPU bursts should be shorter than the time
quantum
OR
In the round robin algorithm, the kernel allocates a certain amount of time for each task
waiting in the queue . The time slice allocated to each task is called quantum. As shown
in fig. if three tasks 1,2, 3 are waiting in the queue the CPU first executes task1 then
task2 then task 3 and the again task1 in round robin algorithm each task waiting in the
queue is given a fixed time slice . The kernel gives control to the next task if the current
task has completed its work within the time slice or if the current task has completed it
allocated time The kernel gives control to the next task if

a) the current task has completed within the time slice


b) the current task has no work to do
c ) the current task has completed its allocated time slice

Page6
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

This algorithm is very simple to implement but there is no priorities for any task. All
tasks are considered of equal importance . If time critical operation are not involved then
this algorithm will be sufficient . Digital millimeter , microwave oven has this algorithm.

Q2 Attempt any FOUR of the following: 16 Marks


a) Compare RISC and CISC architectures with any four points. 4 Marks

Ans: One mark for


each point

b) Explain the use of assembly language in C language with suitable example. 4 Marks

Ans: This is known as inline assembly which does not require separate assembly and link
steps. It is more convenient than separate a separate assembler. This uses the functions Uses(advantag
and variables of ‘c’ language. This helps to integrate the assembly language program ed
and ‘c’ language program easily. +) 2 Marks
Its uses following syntax Example 2
# include <reg51.h> marks
void main (void)
{
C Instructions;
# pragma asm
Assembly instructions
# pragma endasm
C Instructions;

Page7
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Example ( any suitable combination)


# include <reg51.h>
void main (void)
{
while(1)
{
P0 = ~ P0;
# pragma asm
MOV TMOD,#10H
MOV TH1,#0xFFH
MOV TL1,#0xFFH
SETB TR1
JNB TF1,$
# pragma endasm
}
}
c) Draw a labelled interconnection diagram between RS232 and 8951 4 Marks
microcontroller.
Ans: 4 Marks

Any labeled diagram showing line driver /Receiver( MAX232/233 etc)

d) A 230V AC bulb is connected through a relay at P2.2. A light sensor is connected 4 Marks
at P3.4. A light sensor produces logic high in dark condition. Write a ‘C’
program to switch ‘ON’ the bulb in ‘DARK’ condition and switch it OFF in
‘LIGHT’ condition.
Ans: # include<reg51.h> 4 Marks
sbit relay = P2^2; Any suitable

Page8
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

sbit sensor = P3^4; logic may be


void main (void) used.
{ Only program
sensor=1; //P3.4 as input line is expected NO
relay = 0; // Intially OFF Marks for
algorithm and
while (1) flow chart.
{ Appropriate
while ( sensor == 0); // check sensor if no dark wait// Marks for step
relay = 1; // dark ON bulb// may be
while ( sensor == 1); // wait till dark// awarded .

}
}

OR

# include<reg51.h>
sbit relay = P2^2;
sbit sensor = P3^4;
void main (void)
{
sensor=1; //P3.4 as input line
relay = 0; // Intially OFF

while (1)
{
if ( sensor == 1) // check sensor if dark //
relay = 1; // ON bulb//
else
relay=0;

}
}

e) Describe inter task communication in RTOS. 4 Marks

Ans: Software is the basic building block of RTOS. Task is a simply subroutine. Task must
1 Marks for
be able to communicate with one another to coordinate their activities or to share the
basics of inter
data. Kernel object is used for inter task communication. Kernel objects uses message
task
queue, mail box and pipes, Shared Memory, Signal Function and RPC a for inter task communicatio
communication. n
3 marks for
Message queue:- its any three
A message queue is a buffer like data structure, through which tasks and ISRs methods
communicate with each other by sending and receiving messages and synchronize with ( short

Page9
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

data. It temporarily stores the message from a sender until the intended receiver is ready description is
to read them. A message queue has queue control block, queue name, unique ID, expected)
memory buffers, a queue length. Kernel allocates the memory for message queue, ID,
control block etc.

Mail box:-
In general, mailboxes are similar to message queues. Mail box technique for inter task
communication in RTOS based system used for one way messaging. The task/thread
creates mail box to send the message. The receiver task can subscribe the mail box. The
thread which creates the mail box is known as mailbox server. The others are known as
client. RTOS has function to create, write and read from mail box. No of messages
(limited or unlimited) in mail box have been decided by RTOS.

Pipes :-
Pipes are kernel objects used for unstructured data exchange between tasks facilities
synchronization among tasks. Pipe provides a simple data transfer facility.

Shared Memory :-
Shared memory is simplest way of inter process communication. The sender process
writes data into shared memory and receiver process reads data.

Signal Function:-
Operating system provides the signal function for messaging among task (process).

Remote Procedure Call(RPC) and Sockets:-


RPC is a mechanism used by process(task) to call the procedure of another process
running on same or different CPU in the network. Sockets are used for RPC
communication and establishes full duplex communication between tasks.

f) Draw and explain block diagram of embedded system. 4 Marks

Ans: Diagram - 2
marks
Functional
description of
any four - 2
Marks

Page10
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

OR

Page11
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Processor:-
The processor is the heart of embedded system and selected as per application of interest.

Power supply is also called as “charge pump”. Power supply source or charge pump is
essential in every system .

Clock Oscillator Circuit and Clocking Units :- For processing unit, highly stable
oscillator is required and microprocessor clock out signal provides clock for
synchronizing all system unit with the processor. Reset and watch dog timer is also
available.

Memory :- A system embeds either in the internal flash or ROM, PROM or in an


external flash or ROM or PROM of the microcontroller.
Input, output and I/O Ports, I/O Buses and I/O Interfaces
A system connects to external physical devices and systems through parallel or serial
I/O ports. De-multiplexers and multiplexers facilitate communication of signals from
multiple channels through a common path. A system often n/w to other devices and
systems through an I/O bus. E.g. I2C, CAN, USB, ISA, PCI, etc.For automatic control
and signal processing applications, a system provides necessary interfacing circuit and
software for DAC unit and ADC unit.

Keyboard/keypad :- For inputs, a keypad or keyboard may interface to a system. The


system provides necessary interfacing circuit and s/w to receive I/p’s directly from the
keys or through a controller. The system may need the necessary interfacing circuit and
s/w for the o/p to the LCD display controller and the LED interfacing ports or for the
I/O’s with the touch screen.

Real Time Operating System (RTOS):-


It supervises the software application running on hardware and organizes access to
resource according to priorities of task in the system. It provides a mechanism to run the
process as per schedule and context switching between various processes.

Q.3 Attempt any FOUR of the following: 16 Marks


a) List wireless communication protocols and state four features of zigbee protocol. 4 Marks

Ans: Wireless Communication Protocols:- List-2marks


1. Infrared [IrDA] any 4 features
2. Bluetooth -2marks
3. Zigbee
4. Wi-Fi
Features of Zigbee:-
1. Support for multiple network topologies such as point to point, point to
multipoint and mesh networks, cluster tree.

Page12
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

2. ZigBee operates in the industrial, scientific and medical (ISM) radio bands:
2.4 GHz in most jurisdictions worldwide.
3. Low duty cycle provides long battery life.
4. 250 Kbps data rate.
5. Scalable and easy deployment.
6. Highly reliable and secure.
7. Low latency.
8. Cost effective.
9. Up to 65000 nodes per network.
10. 128 bit AES encryption for secure data connections.
Collision avoidance, retries and acknowledgments.

b) Write a ‘C’ program to toggle P2.1 continuously with 100 ms delay. (Use simple 4 Marks
delay subroutine).
Ans: #include <reg 51.h>
void add_delay (unsigned int);
sbit data_bit = P2^1;
void main (void)
{
while (1)
{
data_bit =1; // set P2.1 bit
add_delay (100);
data_bit =0; // reset P2.1bit
add_delay (100);
}
}

void add_delay (unsigned int delay_time)


{
unsigned int x,y;
for (x = 0; x <delay_time; x ++)
for (y =0; y<1275; y++);
}

c) Compare desktop operating system with RTOS with any four points. 4 Marks

Ans: Sr no OS RTOS Any four


points-1Mark
1 Non-Deterministic time Deterministic time behavior. each
behavior.
2 Used in general desktop Used in embedded system
computer system.
3 Generalized Kernel. Real time kernel.
4 OS services can inject random OS services consumes only known
delays into application and expected
software, may cause slow amounts of time regardless the

Page13
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

responsiveness of an number of
application at unexpected services.
time.
5 Slow context switching fast context switching

6 More memory requirements Less memory requirements

7 Ex: Windows XP, MS-DOS Ex: Windows CE, VxWorks

d) State any two advantages and disadvantages of embedded system. 4 Marks


Ans: Advantages :- Advantages
1. Cost is low. any 2 –
2. Small in size. 2 Marks
3. Highly reliable.
4. Operation is fast. Disadvantages-
5. Easy for mass production. any 2 –
6. Less interconnection. 2 Marks
7. Improves product quality.

Dis-Advantages:-
1. Hard for maintenance as it is use and throw device.
2. No technological improvement.
3. Hard to back up of embedded files.
4. Less power supply durability if it is battery operated.

e) Draw a labelled interfacing diagram of DAC 0808 with 8951 microcontroller. 4 Marks
Also write a ‘C’ program to generate triangular waveform using DAC.
Ans: Diagram -
2Marks

Program-
2Marks

#include<reg51.h>
unsigned char d;
void main(void)
{
while(1)
Page14
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

{
for(d=0; d<255; d++)
{
P1 = d;
}
for(d=255; d>0; d--)
{
P1 = d;
}
}
}

Q.4 a) Attempt any THREE of the following: 12 Marks


a) Draw format of TMOD register. Find the value of TMOD register to operate 4 Marks
timer 0 in mode 1.
Ans: TMOD Format: Format 2
marks

Value 2
marks

Value in TMOD to Operate Timer 0 in mode 1: 01 H

0 0 0 0 0 0 0 1
Gate C / T M1 M0 GATE C / T M1 M0

b) Explain CAN Bus protocol with the frame structure. 4 Marks

Ans: Controlled Area Network [CAN]:- Can is mainly used in automotive electronics. Frame format
CAN bus is a standard bus in distributed network. It has a bi-directional serial line which -2marks
receives or sends a bit at an instance by operating at maximum rate of 1Mbps. It employs
a twisted pair connection to each node. The pair can run to a maximum length of 40m. Description -2
marks

Page15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Field and its Description of each field in CAN frame


Length
1st field of 12 It is called arbitration field. It contains the packet 11-bit
bits destination address and the RTR [Remote Transmission
Request].
When this bit is at 1 this indicates the packet is for the
destination
address. If this packet for request for a data from a device
defined
by identifier.
The device is at destination address specified in the field.
2nd field of 6 bits It is called a control field. The 1st bit id the identifier extension.
The 2nd bit is always 1, and the last 4 bits are code for data
length.
rd
3 field of 0-64 Its length depends on data length code in the control field.
bits
4th field of 16- It is the CRC word. The receiver node uses it to detect errors
bits { 3rd if data during transmission.
field has no bit
present}
5th field of 2 bits 1st field is the ACK slot. The sender sends it as 1 and RX sends
back 0 in this slot when the receiver detects an error in the
reception. Sender after sensing 0 in the ACK slot transmits the
data
frame. The 2nd bit is the ACK delimiter bit. It signals the end
of the
ACK field. If the transmitting node does not receive and ACK
of
data frame within a specified time slot it should retransmit.
6 field of 7-bits It is for end of the frame specification and has seven 0’s.
th

c) State any eight design metrics of embedded system. 4 Marks

Ans: 1. Processing Power: Selection of processor is based on the amount of processing Any 8 Each
power to get the job done and also on the basis of register width required. 1/2Marks
2. Throughput or Performance : the execution time or throughput of the system.
Instruction execution time in the system measures performance. Smaller
execution time means higher performance. For eg. in mobile phone, voice

Page16
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

signals are processed between antenna and speaker in 0.1s shows phone
performance. The system may need to handle a lot of data in a short time.
3. Response: The system has to react to the changing events quickly.
4. Memory: Hardware design must make the best estimate of the memory
requirement and must make the provision for expansion.
5. Power consumption: Systems generally work on battery and design of both
software and hardware must take care of power saving techniques.
6. Number of units: The number of units expected to be produced and sold will
dictate the trade-off between production cost and development cost.
7. Expected life-time: Design decisions like selection of components to system
development cost will depend upon on how long the system is expected to run.
8. Program Installation: Installation of software on to the embedded system needs
special development tools.
9. Testability and Debug ability: Setting up test conditions and equipment will be
difficult and determining what is wrong with the software will become a difficult
task without a keyboard and usual display.
10. Reliability: It is always required that the system designed must give the output
for which it is designed.
11. Power Dissipation: For battery operated system this is important feature.
Examples are mobile phone or digital camera where if power dissipation is small
battery needs to be recharge less frequently.
12. Unit cost: the monetary cost of manufacturing each copy of the system,
excluding NRE cost.
13. NRE cost (Non-Recurring Engineering cost): The monetary cost of designing
the system. Once the system is designed, any number of units can be
manufactured without incurring any additional design cost (hence the term “non-
recurring”).
14. Size: the physical space required by the system, often measured in bytes for
software, and gates or transistors for hardware.
15. Flexibility: the ability to change the functionality of the system without incurring
heavy NRE cost. Software is typically considered very flexible. Flexibility in
design enables, without significant engineering cost, development of different
versions or product or to develop advanced version later on. For example
software enhancement by adding extra functions.
16. Maintainability: Deals with support and maintenance to the end user or client in
case of technical issues and product failure. A more reliable system means with
less maintainability. As reliability of the system increases chances of failure and
non-functioning also reduces.
17. Time-to-market: The amount of time required to design and manufacture the
system to the point the system can be sold to customers. The main contributors
are design time, manufacturing time and testing time. There may be multiple
players in the embedded industry who develop products of the same category
(like mobile phones, portable media players etc.). If you come with new product
and time to market is high competitor may take advantage of it with their
product.
18. Time-to-prototype: The amount of time to build a working version of the system,
which may be bigger or more expensive than the final system implementation,
Page17
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

but can be used to verify the system’s usefulness and correctness and to refine
the system's functionality. If the prototype is developed faster, the actual
estimated development time can be bought down.
19. Correctness: our confidence that we have implemented the system’s
functionality correctly. We can check the functionality throughout the process
of designing the system, and we can insert test circuitry to check that
manufacturing was correct.
20. Safety: the probability that the system will not cause harm. It deals with possible
damages that can happen to the operators, public and the environment due to
breakdown of embedded system, or due to the emission of radioactive or
hazardous materials from embedded products. Safety analysis is a must in
product engineering to evaluate the anticipated damages and determine best
course of action.

d) Explain the concept of deadlock with suitable example. 4 Marks

Ans: A deadlock is a situation where in two or more competing actions are each waiting for Explanation-
the other to finish, and thus neither ever does. In computer science, deadlock refers to a 2Marks
specific condition when two or more processes are each waiting for the other to release
a resource, or more than two processes are waiting for resources in a circular chain. Example-2
A deadlock, also called as deadly embrace, is a situation in which two threads are each Marks
unknowingly waiting for resource held by other.
 Assume thread/process T1 has exclusive access to resource R1.
 Thread/ process T2 has exclusive access to resource R2.
 If T1 needs exclusive access to R2 and T2 needs exclusive access to R1,
 Neither thread can continue.
 They are deadlocked.
 The simplest way to avoid a deadlock is for threads to:
 Acquire all resources before proceeding
 Acquire the resources in the same order
 Release the resource in the revere order
Deadlock is the situation in which multiple concurrent threads of execution in a system
are blocked permanently because of resources requirement that can never be satisfied.
A typical real-time system has multiple types of resources and multiple concurrent
threads of execution contending for these resources. Each thread of execution can
acquire multiple resources of various types throughout its lifetime.
Potential for deadlock exist in a system in which the underlying RTOS permits resources
sharing among multiple threads of execution.
Following is a deadlock situation between two tasks.

Page18
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

In this example, process 1 wants the resource 2 ex; scanner while holding the resource
1 ex: printer. Process 1 cannot proceed until both the printer and the scanner are in its
possession.
Process 2 wants the printer while holding the scanner. Process 2 cannot continue until it
has the printer and the scanner.
Because neither process 1 nor process 2 is willing to give up what it already has, the two
tasks are now deadlocked because neither can continue.

b) Attempt any ONE of the following: 06 Marks

a) Write a ‘C’ program to generate a square wave of 5 kHz.(Operate timer 0 in 6 Marks


mode 1).
Ans: Crystal frequency= 11.0592 MHz Calculation-2
1 Marks
1
11.0592MHz  921.6 KHz
I/P clock= ( crystal frequency) = 2
2 Program - 4
Tin =1.085μsec Marks
For5 kHz square wave
Fout = 5KHz
1
3
 200 sec
Tout = 5 x10
Tout =200μsec
Consider half of it=Tout = 100μ sec
Tout 100
   92.16
N Tin 1.085
65536-92= (65444)D =FFA5 H

Program:
#include<reg51.h>
void delay(void);
sbit p=P3^5;
void main (void)
{

Page19
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

while (1)
{
p=~p;
delay();
}
}
void delay()
{
TMOD=0X01; //set timer 0 in mode 1 i.e. 16 bit number
TL0=0XA5H; //load TL register with LSB of count
TH0=0XFFH ; //Load TH register with MSB of count
TR0 =1 ; //Start timer 0
While(TF0= = 0); //wait until timer rolls over
TR0=0; //Stop timer 0
TF0=0; //Clear timer flag 0
}

b) Draw labelled interfacing diagram of stepper motor with 8951. Write a ‘C’ 6 Marks
program to rotate it in counterclockwise direction.
Ans: Diagram-
3Marks

Program-
3Marks

OR

Page20
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Q.5 Attempt any FOUR of the following. 16 Marks


a) State ‘C’ language logical operators for AND, OR, NOT and EX-OR operation. 4 Marks
Give one example of each.

Page21
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Ans: 1 Mark each


Sr Operator Symbol Example
no:
1. AND & is called Logical AND operator. Y= A&B
2. OR | is called Logical OR operator. Y= A|B
3. NOT ~ is called NOT operator. Y= ~A
4. EX-OR ^ is called logical Ex-OR operator. Y=A ^B

b) Distinguish between synchronous and asynchronous communication with any 4 Marks


four points.
Ans: Any four
points -1 Mark
each

c) State number of port lines required for a keyboard matrix 4 Marks


having following keys:
(i) 16
(ii) 256
(iii) 64
(iv) 144
Ans: Number of port lines required for a keyboard matrix 1 Mark Each
having following keys:
(i) 16 -16 keys can be arranged in a matrix of 4X4, so number of port lines required are
4+4 =8
(ii) 256 - 256 keys can be arranged in a matrix of 16X16, so number of port lines required
are 16+16 =32
(iii) 64 - 64 keys can be arranged in a matrix of 8X8, so number of port lines required
are 8+8 =16
(iv) 144 -144 keys can be arranged in a matrix of 12X12, so number of port lines required
are 12+12 =24

Page22
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

d) State four key specifications of RTOS. 4 Marks


Ans: Key specifications of RTOS:- Any 4
1. Reliability: A reliable system must be available (continue to provide service) and 1 Mark each
should not fail. The combination of all system elements determines the reliability
of a system. ( Hardware, BSP, RTOS, and applications)
2. Predictability: The RTOS used in this case needs to be predictable to a certain
degree. The term deterministic describes RTOSes with predictable behavior, in
which the completion of operating system calls occurs within known
timeframes.
3. Performance: An embedded system must perform fast enough to fulfill its
timing requirements. Typically, the processor's performance is expressed in
million instructions per second (MIPS). Throughput also measures the overall
performance of a system, with hardware and software combined. One definition
of throughput is the rate at which a system can generate output based on the
inputs coming in. 
4. Compactness: In embedded systems, where hardware real estate is limited due
to size and costs, the RTOS clearly must be small and efficient. In these cases,
the RTOS memory footprint can be an important factor.
5. Scalability: Because RTOSes can be used in a wide variety of embedded
systems, they must be able to scale up or down to meet application-specific
requirements. Depending on how much functionality is required, an RTOS
should be capable of adding or deleting modular components, including file
systems and protocol stacks.

e) Describe in-circuit emulator. 4 Marks


Ans: In-circuit emulator:- 1 Mark
Diagram,

3 Marks
Explanation.

In-circuit emulator (ICE) is one of the oldest embedded debugging tools, and is still
unmatched in power and capability.
It is only tool that substitutes its own internal processor for the one in the target system
Using one of a number of hardware tricks, the emulator can monitor everything that
goes on in this on-board CPU , giving a complete visibility into the target code’s
operation.
The emulator is bridge between the target and workstation giving an interactive terminal
peering deeply into the target and a rich set of debugging resources.
ICE uses another circuit with a card that connect to target processor (circuit) through a
socket.

Page23
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

OR
• An in-circuit emulator (ICE) is a hardware device used to debug the software of
an embedded system. It was historically in the form of bond-out processor which
has many internal signals brought out for the purpose of debugging. These
signals provided information about the state of the processor.
• An in-circuit emulator provides a window into the embedded system. The
programmer uses the emulator to load programs into the embedded system, run
them, step through them slowly, and view and change data used by the system's
software.
• More recently the term also covers JTAG based hardware debuggers which
provide equivalent access using on-chip debugging hardware with standard
production chips.
• ICE’s attach a terminal or PC to the embedded system. The terminal or PC
provides an interactive user interface for the programmer to investigate and
control the embedded system.
• In usage, an ICE provides the programmer with execution breakpoints, memory
display and monitoring, and input/output control

f) Draw labeled interfacing diagram of 4 X 4 matrix keypad with 8951. 4 Marks

Ans: Interfacing diagram of 4 X 4 matrix keypad with 8951 Diagram


4 Marks

Q.6 Attempt any FOUR of the following: 16 Marks

a) Distinguish between assembly language and C language with reference to: 4 Marks
(i) Ease of programming
(ii) Memory requirement
(iii) Coding time
(iv) Execution time

Page24
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

Ans: Sr Parameters Assembly Language Embedded C 1 Mark each


no program
1. Ease of Less More.
Programming
2. Memory Less More.
requirement
3. Coding time More time is required Less time required for coding
for coding.
4. Execution Faster [Less Execution Slower [More execution time
Time time required] required]

b) Draw pin diagram of DB9. connector, stating function of each pin. 4 Marks

Ans: Pin diagram-


1Marks,
Pin Diagram:
function -
3Marks

Page25
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

c) Draw labelled interfacing diagram of 16 X 2 LCD with 8951 and state function of 4 Marks
RS and R/W pin.
Ans: Interfacing diagram of 16 X 2 LCD with 8951 labelled
interfacing
diagram-
2 Marks,

functions-
1 Mark each.

Function:-

RS: RS is used to make the selection between data and command register.
RS=0, command register is selected RS=1 data register is selected.
RW: -R/W gives you the choice between writing and reading.
R/W=1, reading is enabled.
R/W=0 ,writing is enabled

d) A key is connected at P3.2 and 8 LEDs are connected to P1 of 8951. Write a ‘C’ 4 Marks
program to display 0 to 255 in binary on LEDs, when a key is pressed.
Ans: (Asssuming that P3.2 =0, when the key is pressed) Program with
#include<reg51.h> correct logic –
sbit sw = P3^2; 4 Marks
void delay (unsigned int);
void main(void)
{
sw=1;
unsigned char i;
P1=0X00;
while(1)
{
if(sw==0)
{
for(i=0;i<=255;i++)
{
P1=i;
delay(100);

Page26
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)

}
}
else
P1=0;
}
}
void delay (unsigned int i time)
{
unsigned int i,j:
for (i=0;i<itime;i++)
for(j=0;j<1275;j++);
}
e) Manipulate the following table for data types used in ‘C’ 4 Marks
language.
Sr. No. Data type Bit size Data range

1. Unsigned char ? ?
2. Signed int ? ?
3. Sbit ? ?
4. Sfr ? ?

Ans: Sr. No. Data type Bit size Data range 1 Mark each

1. Unsigned char 8 0 to 255


2. Signed int 16 -32768 to +32767
3. Sbit 1 SFR bit addressable
4. Sfr 8 RAM addresses 80 to
FF only

Page27

You might also like