Model Answers Winter 2018 PDF
Model Answers Winter 2018 PDF
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
1
In multi core technology architecture, a single physical processor contains the core
logic of two or more processors and these processors are packaged into a single
integrated circuit.
The multicore technology is mainly used for parallel computing which increases
computer speed and efficiency.
Multiple processes are used in mobile devices, desktops, workstations and servers.
Multicore processors will give the benefits to all software especially for
multithreaded program.
Page 1/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
2
(iv) Draw the labeled interfacing diagram to interface relay with 89C51 microcontroller. 4M
Ans: Correct
labeled
diagram
-4M
Page 2/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
3
(i) Draw the block diagram of an embedded system and describe the hardware units of an 6M
embedded system.
Page 3/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
4
Ans: Block
diagram
-2M
Descript
ion of
hardwar
e units-
4M
OR
Page 4/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
5
Explanation:
The embedded system consist of different components embedded into it as follows:
1) Embedded Processor
2) Power supply , reset and Oscillator circuits
3) System timers
4) Serial communication port
5) Parallel ports
6) Interrupt controller
7) Output and Input Interfacing and driver circuits
8) System application specific circuits
9) Program and Data memory
Processor:
The processor is the heart of embedded system. The selection of processor is based on the
following consideration
1. Instruction set
2. Maximum bits of operation on single arithmetic and logical operation
3. Speed
4. Algorithms processing and capability
5. Types of processor( microprocessor, microcontroller, digital signal processor, application
specific processor, general purpose processor)
Page 5/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
6
Interrupt controller:
It is used to receive interrupt from various sources and resolve the priority and provides the
service to that interrupts.
(ii) State the methods of task synchronization. Describe semaphore with suitable example. 6M
Page 6/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
7
Dead lock.
Mailboxes.
Descript
Message Queues. ion-3M
Semaphores: Example
It is a system of sending message by using flags. Multiple concurrent threads of execution -1M
with an application must be able to synchronize their execution & co-ordinate mutually
exclusive access to shared resources.
To fulfill this requirement RTOS kernel provides a semaphore object that one or more
threads of execution can acquire or release for the purpose of synchronization or mutual
exclusion. Semaphore is like a key that allows a test to carry out some operation or to
access a resource. When task acquires the semaphore, it receives an access to the resource.
The number of times the semaphore can be acquired by the task is determined by the
resource count of a semaphore.
A resource count is decremented by one, when a task acquires the semaphore and its
resource count is incremented by one when a task releases the semaphore.
A kernel supports many different types of semaphores :
Binary: Binary semaphores are used for both mutual exclusion and synchronization purposes. A
binary semaphore is used to control sharing a single resource between tasks..
Counting: it is a semaphore that increments when an IPC is given by a task. It decrements when a
waiting task unblocks and starts running.
Mutex or Mutually Exclusion semaphore: In this a mutex key is used to lock the shared
resource, if it is acquired by the task, so that any other task cannot acquire until it is released.
}
in process P2
{
wait(Sem);
S2;
Page 7/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
8
b) State any four ‘C’ data types with their value range. 4M
Page 8/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
9
d) Write a program in ‘C’ language for generating triangular waveform using DAC 0808. 4M
Ans: NOTE: Program may change. Student can also use the other logic. Please check the logic Correct
and understanding of students. any amount of delay program can also be used. program
Program: -4M
#include<reg51.h>
void main(void)
{
Page 9/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
10
unsigned char d;
while(1)
{
for(d=0; d<=255; d++)
{
P1 = d;
}
for(d=255; d>=0; d--)
{
P1 = d;
}
}
}
Page
10/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
11
Ans: Classific
ation-
2M and
Any one
type
detail
explanat
ion-2M
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
12
Ans: NOTE: Program may change. Student can also use the other logic. Please check the logic (Correct
and understanding of students. any other amount of delay program can also be used. program
Program: 4M)
#include < reg 51.h>
void delay (unsigned int);
void main (void)
{
while(1) //repeat loop
{
P1=0xff; //toggle all bits of port1
delay (400); //add delay
P1=0x00; //toggle all bits of port1
delay (400); //add delay
}
}
void delay (unsigned int)
{
Unsigned int x, y;
Page
12/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
13
Ans: An interrupt is a hardware mechanism used to inform the CPU that an asynchronous event has 4M for
occurred. correct
A fundamental challenge in RTOS design is supporting interrupts and thereby allowing asynchronous explanat
access to internal RTOS data structures. The interrupt and event handling mechanism of an RTOS ion
provides the following functions:
Defining interrupt handler
Creation and deletion of ISR
Referencing the state of an ISR
Enabling and disabling of an interrupt
Changing and referencing of an interrupt mask and help to ensure:
o Data integrity by restricting interrupts from occurring when modifying a data
structure
o Minimum interrupt latencies due to disabling of interrupts when RTOS is performing
critical operations
o Fastest possible interrupt responses that marked the preemptive performance of an
RTOS
o Shortest possible interrupt completion time with minimum overhead
Page
13/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
14
3. Accessibility: If something goes wrong with certain embedded systems they can be too
inaccessible to repair. This problem is addressed in the design stage, so by programming an
embedded system. So that it will not affect related system negatively when malfunctioning.
4. Maintenance: Embedded systems are easier to maintain because the supplied power is
embedded in the system and does not required remote maintenance.
4. Applied for a specific purpose:- By definition, embedded systems are constrained in their
objectives. If it is decided to "rehash" an existing embedded system for a completely
different purpose, it will normally result in significant change(s) in either or both its
hardware or/and software
e) Write 89C51 ‘C’ program to rotate stepper motor by 900 in clockwise direction. Motor has 4M
step angle of 1.80.
Page
14/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
15
Ans: NOTE: Program may change. Student can also use the other logic. Please check the logic (correct
and understanding of students. logic 4
Step angle=1.8 degree marks)
For Four step sequence , 1.8 X 4 = 7.2 degrees
Count for four step sequence = 90/7.2=12.5
Take count as 12 , as 12 X 7.2 = 86.4 degrees , give two more steps for further 3.6 degrees
Page
15/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
16
(i) Draw the format of SCON. Describe the function of each bit. 4M
Ans: (2M :
format ,
2M:Bit
explanat
ion)
SM0 SCON.7 : Serial port mode specifier
SM1 SCON.6 : Serial port mode specifier.
SM2 SCON.5 : Used for multiprocessor communication (Makeit0.)
REN SCON.4 : Set/cleared by software to enable/ disable reception.
TB8 SCON.3 : 9th bit to be transmitted in mode 2 and 3.
RB8 SCON.2 : 9th received bit in mode 2 and 3.
TI SCON.1 : Transmit interrupt flag. Set by hardware at the beginning of the stop Bit in
mode1. Must be cleared by software.
RI SCON.0 : Receive interrupt flag. Set by hardware halfway through the stop bit time in
mode 1. Must be cleared by software
(ii) Compare serial and parallel communication(any four points) 4M
Ans: ( 1M :
Sr. Parallel communication Serial communication each
no. point )
1 Group of data bits, usually 8 bits are One bit at a time is transferred serially
transferred at a time
2 It requires n- number of transmission It requires one or two lines for data
lines for n- bit data transfer
3 Speed of data transfer is fast Speed of data transfer is slow
4 Preferred for short distance Preferred for long distance communication
communication
5 Installation cost is high Installation cost is less
6 Less reliable More reliable
Ans: 1. Processor power: Selection of processor depends upon amount of processing power
and the register width required. Powerful 8bit, 16 bit , 32 bit & 64bit processors are
available . The clock speed and memory addressing capability is also measure of
processor power. Powerful DSPs are available for real time analysis of audio and ( 1M
Page
16/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
17
Page
17/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
18
Ans: ( 1M
Sr.no Desktop O.S. RTOS each
. point)
1. Does not have deterministic time It has deterministic time response
response
2. Generalized kernel Real time kernel
3. There is no task deadline There is task deadline in RTOS
4. Memory required depends on Memory required( footprint) is less
version
5. Applications are compiled Applications are compiled and linked
separately from O.S. together with RTOS
6. It is used in general desktop It is used in embedded systems
computer
7. It is less reliable It is more reliable
8. e.g. Windows, Linux e.g. RTLinux, VXWorks, Micro C / OSII
(i) Write ‘C’ program to generate frequency of 2.5 KHz on P2.7 . Use timer 1 in mode 2 to 6M
generate the delay.(fosc = 12 mHz)
Note: fosc should be in MHz, it seems to be typing mistake in question as mHz. So if Calculati
students have done the calculation with mHz, marks must be given for correct logic. ons ---
2Marks,
Calculations: Program
Crystal value = 12 MHz. --- 4
Frequency = 2.5khz Marks
Therefore Time period T = 1 /2.5KHZ = 0.4 ms
Therefore Required time delay = 0.4ms / 2 = 0.2 ms =200usec.
Required time delay = ( 12 / Fosc ) x number of increments (N)
200us = ( 12 / 12MHZ ) x number of increments (N)
200us = 1 usec. x N
N = 200
Using TIMER 1 in MODE 2,
COUNT = 28 - N
COUNT = 256 – 200 = 56= 38H
Therefore TH1 = 0X 38
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
19
void main(void)
{
TMOD=0x20;//timer1 mode2
TH1=0X38 ; // Load count
TR1=1; // start timer1
while (1) // repeat forever
{
while (TF1= = 0) ; // wait for Timer to overflow
SQR = ~ SQR ; // toggle bit P2^7
TF1=0; // clear TF1
} // end of while
} // end of main
(ii) Draw the labeled diagram of LCD interface with 89C 51. Write a program in ‘C’ language to 6M
display “WELCOME” on LCD.
Ans: (
Note: Student may use any other method interfaci
ng
diagram
: 02M,
program
: 04M )
PROGRAM:
#include <reg 51.h>
Sbit rs=P3^4;
Sbit rw=P3^2;
sbit en=P3^3;
void delay(unsigned int);
void lcdcmd(unsigned char);
void lcddta(unsigned char);
void main( void )
{
rs=0;
rw=0;
en=0;
lcdcmd(0x38);
Page
19/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
20
delay(10);
lcdcmd(0x0e);
delay(10);
lcdcmd(0x06);
delay(10);
lcdcmd(0x01);
delay(10);
lcdcmd(0x80);
delay(10);
lcddta('W');
delay(10);
lcddta('E');
delay(10);
lcddta('L');
delay(10);
lcddta('C');
delay(10);
lcddta('O');
delay(10);
lcddta('M');
delay(10);
lcddta('E’);
delay(10);
while(1) ;
}
}
void lcddta(unsigned char dta)
{
rs=1;
rw=0;
P1=dta;
en=1;
delay(2);
en=0;
}
void lcdcmd(unsigned char cmd)
{
rs=0;
rw=0;
P1=cmd;
en=1;
delay(2);
Page
20/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
21
en=0;
}
void delay(unsigned int t)
{
Unsigned in tx,y;
for(x=0;x<=t;x++)
for(y=0;y<=1275;y++);
}
a) Write 89C51 ‘C’ program to transfer character ‘MSBTE’ serially at 9600 baud rate 4M
continuously , use 8 bit data and 1 stop bit. Assume crystal frequency of 11.0592 MHz.
Ans: NOTE: Program may change. Student can also use the other logic. Please check the logic 4M for
and understanding of students. correct
program
#include <reg51.h>
void main(void)
{
unsigned char text[ ] = “MSBTE”; //initialize array
TMOD = 0x20; //Initialize timer 1 in mode 2
TH1 = 0xFD; //baud rate 9600
SCON = 0x50; //start serial communication ( 8bit , 1 stop
bit , REN )
Page
21/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
22
The maximum slew rate in RS232 is limited to 30V/µs. Also, a maximum bit rate of 20
Kbps is also defined. These limitations of the standard help in reducing the cross –
talk with adjacent signals.
A line driver such as the MAX232 chip is required to convert RS232 voltage levels to
TTL levels, and vice versa.
Page
22/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
23
8051 has two pins that are used specifically for transferring and receiving data
serially.
These two pins are called TxD and RxD and are part of the port 3 group (P3.0 and
P3.1).
These pins are TTL compatible; therefore, they require a line driver to make them
RS232 compatible.
We need a line driver (voltage converter) to convert the R232’s signals to TTL voltage
levels that will be acceptable to 8051’s TxD and RxD pins.
Page
23/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
24
Ans: Correct
drawing
-4M
Ans: • Each process gets a small unit of CPU time (time quantum), usually 10-100 2M
milliseconds. After this time has elapsed, the process is preempted and added to the explain
end of the ready queue.
2M
• If there are n processes in the ready queue (as a FIFO) and the time quantum is q, example
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
– q large
• FIFO
– q small
Page
24/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
25
is too high
Example:
P1 53
P2 17
P3 68
P4 24
Page
25/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
26
e) List the software development tools used in an embedded system and state the functions 4M
of any two.
• Compiler 1M each
for any 2
• Cross assembler
• Cross compiler
• Locators
• Loaders
• Simulators
• Debugger
Page
26/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
27
The function of
IDE is dedicated to a specific programming language, allowing a feature set that most
closely matches the programming paradigms [model] of the language. IDE’s typically present
a single program in which all development is done. This program typically provides many
features for authoring, modifying, compiling, deploying, and debugging software.
Page
27/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
28
Ans: 2M
Interfaci
ng
2M
explanat
ion
Explanation:
The maximum current which can be sunk from 89C51 is upto 15mA at 5V.
But DC motor needs more current depending on its type. Hence DC motor cannot be
connected directly to the microcontroller.
L293D motor driver stops the back emf produced by the motor from affecting the
microcontroller.
Port pins P1.0 and P1.1 are connected to the input pins 2 and 7 of L293D motor driver.
The output pins of the L293D ,pin 3 and 6 are connected to the DC motor.
Direction of the rotation of the motor can be changed by inverting the output terminals
Page
28/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
29
Ans: • The functionality usually offered by JTAG is Debug Access and Boundary Scan: 4M
Explanat
• Debug Access is used by debugger tools to access the internals of a chip making its ion
resources and functionality available and modifiable,
• Boundary Scan is used by hardware test tools to test the physical connection of a device,
e.g. on a PC.
Page
29/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
30
• The DTAB (Debug and Test Access Block) is implemented on the target chip as a
“passive” device that never sends data without request.
• The TAP (Test Access Port) with its physical connections (signals) to the
external world.
• The Debug Bus for communication with the on-chip debug logic.
• The TAP defines the interface between the DTAB and the debug tool.
• The IEEE standard defines the following TAP signals, used for the serial
communication and driving the TAP controller
• TMS: Test Mode: Select controls the TAP controller state transitions
Page
30/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
31
c) Draw the interfacing diagram of 4 x 4 matrix keyboard with 89C51 microcontroller. Draw 4M
the flowchart for detection and identification of key activation.
Page
31/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
32
Ans: 2M
Diagram
2M
Flowcha
rt
Page
32/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
33
d) Write program for 89C51 microcontroller in ‘C’ language to mask the lower four bits of P0 4M
and upper four bits of P1. Combine both ports and output result on port 2.
Page
33/34
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
WINTER– 18 EXAMINATION
Subject Name: Embedded Systems Model Answer Subject Code: 17658
34
Ans: Correct
drawing
4M
Page
34/34