Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Zeal Education Society’s

ZEAL POLYTECHNIC, PUNE.


NARHE │PUNE -41 │ INDIA

THIRD YEAR (TY)


DIPLOMA IN E&TC ENGINEERING
SCHEME: I SEMESTER: V

NAME OF SUBJECT: EMBEDDED SYSTEMS


Subject Code: 22532

MSBTE QUESTION PAPERS & MODEL ANSWERS


1. MSBTE SAMPLE QUESTION PAPER
2. MSBTE WINTER-19 EXAMINATION

Page 1 of 10
Scheme – I
Question Paper Profile

Program Name : Electronics Engineering Programme Group


Program Code : DE/EJ/ET/EN/EX/EQ/IS/IC
Semester : Fifth 22532
Course Title : Embedded System (Elective for IS/IC)
Marks : 70 Time: 3 Hrs.

Instructions:
(1) All questions are compulsory.
(2) Illustrate your answers with neat sketches wherever necessary.
(3) Figures to the right indicate full marks.
(4) Assume suitable data if necessary.
(5) Preferably, write the answers in sequential order.

Q.1) Attempt any FIVE of the following: 10 Marks


(a) Define the terms: RISC and CISC
(b) List any two applications of Harvard Architecture.
(c) State the protocol used for:
i. Modems
ii. Automation and Control

(d) Illustrate any two data types used in C with their ranges.
(e) Define the terms: Scalability, Predictability related to RTOS.
(f) Label the missing bits in the following TCON Register:

(g) List the various temperature sensors used in industry.

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


(a) Explain with block diagram the hardware components used in Embedded system.
(b) Write a C language program to toggle all bits of P0, P1, P2 and P3 continuously
with certain delay.
(c) Draw the 9 pin RS 232C connector and state the significance of DTR and DSR
signals.
(d) State any two applications for each of the following:
i. Small Scale Embedded System.
ii. Medium Scale Embedded System.

1
Q.3) Attempt any THREE of the following. 12 Marks
0
(a) Write a ‘C’ language program to rotate stepper motor by 90 clockwise. Assume step
angle of 1.80 and 4 step sequence.
(b) Compare desktop OS and RTOS on following points
i) Time behaviour
ii) Context switching
iii) Memory requirement
iv) Kernel used
(c) Describe CAN bus with frame format.
(d) Write a C language program to transfer message “MSBTE” serially at 9600 baud
rate. Assume crystal frequency of 12MHz.

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


(a) Describe how assembly language can be included in 89C51 C program. Give an
example.
(b) Compare Zigbee and Bluetooth on the basis of following points:
i. Modulation Technique.
ii. Communication Range.
iii. Power Consumption.
iv. IEEE standard.
(c) Draw the interfacing diagram of ADC with 89C51 and explain the function of
following pins: SOC, EOC and OE.
(d) Explain the frame format of I2C with suitable diagram.
(e) Draw the interfacing diagram of 4x4 matrix keyboard with 89C51.

Q.5) Attempt any TWO of the following. 12 Marks


(a) Explain pre-emptive and round robin scheduling in RTOS.
(b) Draw the interfacing diagram of DAC to 89C51 and write a C language program
to generate triangular waveform using DAC.
(c) Write a C language program to generate square waveform of 5KHz on pin P1.5 of
89C51.

Q.6) Attempt any TWO of the following. 12 Marks


a) Explain in detail the term deadlock and techniques to prevent it.
b) Explain in detail any six characteristics of Embedded System.
c) Draw the interfacing of key and LED to 89C51 to pins P1.0 and P2.0. Write a C
language program to read the status of Key and Display on LED.
[key open = LED OFF ; Key close = LED ON]

2
Scheme – I
Question Test Paper - I

Program Name : Electronics Engineering Programme Group


Program Code : DE/EJ/ET/EN/EX/EQ/IS/IC
Semester : Fifth 22532
Course Title : Embedded System (Elective for IS/IC)
Marks : 20 Time: 1 Hour.

Instructions:
(1) All questions are compulsory.
(2) Illustrate your answers with neat sketches wherever necessary.
(3) Figures to the right indicate full marks.
(4) Assume suitable data if necessary.
(5) Preferably, write the answers in sequential order.

Q.1 Attempt any FOUR. 08 Marks


(a) Define the terms: RISC and CISC
(b) Write two applications of ARM processor.
(c) List various data types in embedded C with their data range. (any two)
(d) List various standard baud rates for serial communication.
(e) State the protocol used for:
i) Modems
ii) Automation and Control

Q.2 Attempt any THREE. 12 Marks


(a) Explain the frame format of I 2C with suitable diagram
(b) Write a C language program to generate square waveform of 5KHz on pin P1.5 of
89C51
(c) If the content of ACC = 0 × 02 and P1 = 0 × F3. State the result after execution of
following statements independently:
i) result = ACC & P1
ii) result = ACC | P1
iii) result = ACC ^ P1
iv) result = ~ P1
(d) Compare between assembly language program with an embedded ‘C’ program with
reference to following points:
i) Execution time
ii) Time for coding
iii) Hex file size
iv) Debugging

3
Scheme – I
Question Test Paper - II

Program Name : Electronics Engineering Programme Group


Program Code : DE/EJ/ET/EN/EX/EQ/IS/IC
Semester : Fifth 22532
Course Title : Embedded System (Elective for IS/IC)
Marks : 20 Time: 1 Hour.

Instructions:
(1) All questions are compulsory.
(2) Illustrate your answers with neat sketches wherever necessary.
(3) Figures to the right indicate full marks.
(4) Assume suitable data if necessary.
(5) Preferably, write the answers in sequential order.

Q.1 Attempt any FOUR. 08 Marks


(a) List the any two temperature sensors used in industry.
(b) Write specifications of ADC.
(c) State the methods of task synchronization
(d) Define Hard and Soft real time
(e) List any four functions of RTOS.

Q.2 Attempt any THREE. 12 Marks


(a) Draw the interfacing diagram of DAC to 89C51 and write a C language program to
generate triangular waveform.
(b) Compare desktop OS and RTOS [any 4 points]
(c) Explain the concept of starvation and deadlock in RTOS
(d) Write ‘C’ program to rotate the stepper motor by two complete rotations and then
stop. Assume step angle as 1.8°.

4
22532
11920
3 Hours / 70 Marks Seat No.

Instructions – (1) All Questions are Compulsory.


(2) Answer each next main Question on a new page.
(3) Illustrate your answers with neat sketches wherever
necessary.
(4) Figures to the right indicate full marks.
(5) Assume suitable data, if necessary.
(6) Use of Non-programmable Electronic Pocket
Calculator is permissible.
(7) Mobile Phone, Pager and any other Electronic
Communication devices are not permissible in
Examination Hall.

Marks

1. Attempt any FIVE of the following: 10


a) List out four types of embedded systems.
b) State four advantages of embedded system.
c) State the use of MAX  232 in communication.
d) Illustrate any two logical operators used in C with their examples.
e) State two examples of RTOS.
f) Develop a ‘C’ program to transfer the data from port P0 to
port Pl.
g) Sketch pin-out diagram of LM35 and label it’s pin.

P.T.O.
22532 [2]
Marks
2. Attempt any THREE of the following : 12
a) Compare features of PIC and AVR microcontrollers (any four)
b) Write a C language program to operate port 0 and port 2 as
output port and port 1 and port 3 as input port.
c) Compare synchronous and asynchronous communication. (any
four points)
d) Explain the need to consider following factors in design matrix
of embedded system:
(i) Processor
(ii) Memory
(iii) Power
(iv) Non  -  recurring engineering cost.

3. Attempt any THREE of the following: 12


a) Sketch circuit diagram showing interfacing of one 7 - segment
display to 89C51. Write a ‘C’ program to display ‘F’ and ‘Fi’
alternately.
b) Explain the term ‘Deadlock’. State reason of occurance.
c) Explain the process of handshaking in RS232 standard based
communication.
d) Write a ‘C’ language program to mask the upper four bits of
the data given in port 0 and write the answer in port 1.

4. Attempt any THREE of the following: 12


a) Write ‘C’ program to generate delay of 50 m sec for microcontroller
89C51 with crystal frequency of 11.0592  MHz.
b) List out eight features of USB.
c) Draw the interfacing diagram of ADC with 89C51 and state the
function of SOC, EOC and OE pins.
d) Explain ‘CAN’ bus protocol and list out it’s two applications.
e) Sketch interfacing diagram to interface LCD display with 89C51.
22532 [3]
Marks
5. Attempt any TWO of the following: 12
a) Explain resource allocation and interrupt handling function of
RTOS.
b) Write a ‘C’ language program for 89C51 to generate triangular
waveform.
c) Write a ‘C’ language program for serial communication to transfer
letter ‘M’ serially at 9600 baud continuously.

6. Attempt any TWO of the following: 12


a) List out characteristics of RTOS and explain any four characteristics
b) Compare :
(i) RISC with CISC processor
(ii) Harward with Von Neuman architecture.
c) Explain with sketch interfacing of stepper motor with 89C51.
Write ‘C’ language program to rotate the motor clockwise.
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
WINTER – 19EXAMINATION
Subject Name: Embedded System
Important Instructions to examiners:
Model Answer Subject Code: 22532
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

10-Total
Q.1 Attempt any FIVE of the following:
Marks
a) List out four types of embedded systems. 2M
Ans: 1. Small Scale Embedded Systems (any 4:
2. Medium Scale Embedded Systems ½ mark
3. Sophisticated Embedded Systems each)
4. Stand Alone Embedded Systems
5. Real Time Embedded Systems
6. Networked Embedded Systems
7. Mobile Embedded Systems
b) State four advantages of embedded system. 2M
Ans: 1) Design and Efficiency (any 4:
2) Cost ½ Mark
3) Accessibility each)
4) Maintenance
5) Redundancies
c) State the use of MAX 232 in communication. 2M
Ans: MAX 232 is line driver that converts from RS232 voltage levels to TTL voltage levels & Correct
vice versa in serial communication answer 2
M

d) Illustrate any two logical operators used in C with their examples. 2M


Ans: Sr Operator Bitwise logical operator Example (any 2 :
no: 1mark
1. NOT ~ Y= ~A each )

2. AND & Y= A&B

Page 1/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
3. OR | Y= A|B
4. EX-OR ^ Y=A ^B
e) State two examples of RTOS. 2M
Ans: 1. LynxOS. ( any 2:
2. OSE. 1 mark
3. QNX. each )
4. RTLinux.
5. VxWorks.
6. Windows CE.

f) Develop a ‘C’ program to transfer the data from port P0 to port P1. 2M
Ans: (correct
#include<reg51.h>
program
void main (void )
:2
{
marks )
unsigned char X;
Any
P0=0XFF; // P0 as input port
other
P1=0X00;//P1 as output port
correct
while(1) //do forever
program
{
logic
X = P0;//read port0
should
P1 = X;// output data to port1
be given
}
marks
g) Sketch pin-out diagram of LM35 and label its pin. 2M
Ans: 2M

Attempt any THREE of the following: 12-Total


Q.2
Marks
a) Compare features of PIC and AVR microcontrollers (any four) 4M

Ans: Parameters PIC AVR (any 4


Bus width 8/16/32-bit 8/32-bit features:
Communication UART, USART, LIN, CAN, UART, USART, SPI, I2C, 1 mark
Protocols Ethernet, SPI, I2C (special purpose AVR support each)
CAN, USB, Ethernet)
Speed 4 Clock/instruction cycle, operating 1 clock / instruction cycle,
Frequency upto 20MHz. operating frequency up to
Page 2/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
25MHz.
Memory SRAM, FLASH,EEPROM Flash, SRAM, EEPROM
ISA Some feature of RISC RISC
Memory Harvard architecture Modified
Architecture
Power Low Low
Consumption

Families PIC16,PIC17, PIC18, PIC24, PIC32 Tiny, Atmega, Xmega, special


purpose AVR

Manufacturer Microchip Average Atmel

Popular PIC18fXX8, PIC16f88X, Atmega8, 16, 32, Arduino


Microcontrollers PIC32MXX Community

Write a C language program to operate port 0 and port 2 as output port and port 1
b) 4M
and port 3 as input port.
Ans: (correct
program
#include<reg51.h> :4
void main (void ) marks )
{ Any
unsigned char X,Y other
P0=0X00; // P0 as output port correct
P2=0X00;// P2 as output port program
P1=0XFF;//P1 as input port logic
P3=0XFF;// P3 as input port should
while(1) be given
{ marks
X= P1; as there
Y=P3; are
P0=X; many
P2=Y; other
}//end of while ways of
}//end of main writing
same
program
c) Compare synchronous and asynchronous communication.(any four points) 4M
Ans: SR NO. Synchronous communication Asynchronous communication (any 4
1. Single clock is used for both Two different clocks are used for points :
transmitter and receiver both transmitter and receiver 1mark
2. Data bits are transmitted with sync No sync character is required each )
character

Page 3/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
3. Start and stop bits are not used Start and stop bits are used
4. Used for data transfer rate >= 20 Used for data transfer rate <= 20
Kbps Kbps
5. Used for transferring block of data at Used to transfer one character at a
a time time
6. Character is received at a constant Character is received at a any rate
rate
7. Less reliable More reliable
Explain the need to consider following factors in design matrix of embedded system:
(i) Processor
d) (ii) Memory 4M
(iii) Power
(iv) Non- recurring engineering cost.
1. Processor: 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 video signals
2. Memory: Designer has to make an estimate for memory requirement and must make
provision for expansion. There are different types of memories in a system, like RAM,
( 1 mark
Ans: ROM, EEPROM etc. Flash memories are used in embedded system; hence operating
systems can be ported in target hardware system. each )
3. Power : It is the amount of power consumed by the system which may determine
lifetime of battery , or cooling requirements of the IC , since more power means more
heat
4. NRE cost (Non-Recurring Engineering cost):It is the one-time monetary cost of
designing the system. Once system is designed any number of units can be
manufactured without incurring any additional design cost.
12-Total
Q.3 Attempt any THREE of the following:
Marks

Sketch circuit diagram showing interfacing of one 7-segment display to 89C51. Write
a) 4M
a ‘C’ program to display ‘F’ and ‘Fi’ alternately.
Ans: Note :
 Since Fi cannot be displayed in single digit seven segment display, program is written
to display F and E alternately.
 Both common anode and common cathode interfacing is given here. Marks to be
given if student write any one
 Any other program with correct logic may be given marks
For common cathode display:

Page 4/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

DISPLAY DP G F E D C B A HEX VALUE

F 0 1 1 1 0 0 0 1 0x71

E 0 1 1 1 1 0 0 1 0x79

#include<reg51.h>

#define Led P1

Void Delay();

Void main()
{
Led = 0x00;
while(1)
{
Led = 0x71;
Delay();
Led = 0x79;
Delay();
}
}
Void Delay()
{
Unsigned int x,y;
for(y=0;y<10;y++)
for(x=0;x<1275;x++);
}
For Common anode display

Page 5/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

DISPLAY DP G F E D C B A HEX VALUE

F 1 0 0 0 1 1 1 0 0x8E

E 1 0 0 0 0 1 1 0 0x86

#include<reg51.h>

#define Led P2

Void Delay();

Void main()

Led = 0x00;
while(1)
{
Led = 0x8E;
Delay();
Led = 0x86;
Delay();
}
}
Void Delay()
{
Unsigned int x,y;
for(y=0;y<10;y++) for(x=0;x<1275;x++);
}
b) Explain the term ‘Deadlock’. State reason of occurance. 4M
Ans: A deadlock is a situation where in two or more competing actions are each waiting for the 2M for
other to finish, and thus neither ever does.
Deadloc
 Assume thread/process T1 has exclusive access to resource R1.
k
 Thread/ process T2 has exclusive access to resource R2.
Page 6/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
 If T1 needs exclusive access to R2 and T2 needs exclusive access to R1, Explana
 Neither thread can continue. tion, 2M
 They are deadlocked. for
The simplest example is that of two tasks: 1 and 2. Each task requires two mutexes: A and Reasons
B. If Task 1 takes mutex A and waits for mutex B while Task 2 takes mutex B and waits
for mutex A, then each task is waiting for the other to release the mutex.:
These tasks may run without problems for a long time, but eventually one task may be
preempted in between the wait calls, and the other task will run. In this case, Task 1 needs
mutex B to be released by Task 2, while Task 2 needs mutex A to be released by Task 1.
Neither of these events will ever happen.

Causes of Deadlock
Mutual exclusion: only one process at a time can use a resource
Hold and wait: A process holding at least one resource is waiting to acquire additional
resources held by other resources
No preemption: A resource can be released only voluntarily by the process holding it after
that process has completed the task
Circular wait: A set of processes- P1 to Pn …P1 waiting for the resource held by P2, P2
waiting for resource held by P3 etc.
c) Explain the process of handshaking in RS232 standard based communication. 4M
Ans: RS232 monitoring hardware establishes a connection between data terminal equipment
(DTE) and data communication equipment (DCE). In order to link these devices, an RS232
D9 pinout is essential, as this pinout will allow you to connect two devices successfully.
An RS232 pinout 9 pin cable features nine pins:
1. Data Carrier Detect – After a data terminal is detected, a signal is sent to the data set
that is going to be transmitted to the terminal.
2. Received Data – The data set receives the initial signal via the receive data line (RxD).
3. Transmitted Data – The data terminal gets a signal from the data set, a confirmation
that there is a connection between the data terminal and the data set.
4. Data Terminal Ready – A positive voltage is applied to the data terminal ready
(DTR) line, a sign that the data terminal is prepared for the transmission of data.
5. Signal Ground – A return for all the signals on a single interface, the signal ground
(SG) offers a return path for serial communications. Without SG, serial data cannot be
transmitted between devices.
6. Data Set Ready – A positive voltage is applied to the data set ready (DSR) line, which
ensures the serial communications between a data terminal and a data set can be completed.
7. Request to Send – A positive voltage indicates the request to send (RTS) can be
performed, which means the data set is able to send information to the data terminal
without interference.
8. Clear to Send – After a connection has been established between a data terminal and a
Page 7/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
distant modem, a clear to send (CS) signal ensures the data terminal recognizes that
communications can be performed.
9. Ring Indicator – The ring indicator (RI) signal will be activated if a modem that
operates as a data set detects low frequency. When this occurs, the data terminal is alerted,
but the RI will not stop the flow of serial data between devices.

Write a ‘C’ language program to mask the upper four bits of the data given in port 0
d) 4M
and write the answer in port 1.
Ans: #include<reg51.h> 4M
Void main()
{
unsigned char a ,b;
P0 = 0xff; //P0 as an input port
P1 = 0x00; //P1 as an output port
while(1)
{
a = P0;
b=a & 0x0F; //masking lower 4 bit
P1=b;
}
}
(For any other logic marks can be given)
Q.4 Attempt any THREE of the following : 12- M

a) Write ‘C’ program to generate delay of 50msec for microcontroller 89C51 with 4M
crystal frequency of 11.0592 MHz.

Page 8/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Ans: 1M for
count
calculati
on, 3M
for
Progra
m

(For any other logic marks can be given)


b) List out eight features of USB. 4M
Ans: The Universal Serial Bus has the following features: 4 points.
1M each
 The computer acts as the host.
 Up to 127 devices can connect to the host, either directly or by way of USB hubs.
 Individual USB cables can run as long as 5 meters; with hubs, devices can be up to 30
meters (six cables' worth) away from the host.
 With USB 2.0,the bus has a maximum data rate of 480 megabits per second (10 times
the speed of USB 1.0).
 A USB 2.0 cable has two wires for power (+5 volts and ground) and a twisted pair of
wires to carry the data. The USB 3.0 standard adds four more wires for data
transmission. While USB 2.0 can only send data in one direction at a time (downstream
or upstream), USB 3.0 can transmit data in both directions simultaneously.
 On the power wires, the computer can supply up to 500 milliamps of power at 5 volts.
A USB 3.0 cable can supply up to 900 milliamps of power.
Page 9/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
 Low-power devices (such as mice) can draw their power directly from the bus. High-
power devices (such as printers) have their own power supplies and draw minimal
power from the bus. Hubs can have their own power supplies to provide power to
devices connected to the hub.
 USB devices are hot-swappable, meaning you can plug them into the bus and
unplug them any time. A USB 3.0 cable is compatible with USB 2.0 ports -- you
won't get the same data transfer speed as with a USB 3.0 port but data and power
will still transfer through the cable.
 Many USB devices can be put to sleep by the host computer when the computer
enters a power-saving mode.
Draw the interfacing diagram of ADC with 89C51 and state the function of SOC,
c) 4M
EOC and OE pins.
Ans: SOC [Start of conversion]: When High to low signal is appearing to this pin of ADC; function
ADC then starts conversion. s – 1M
EOC [End of conversion]: ADC sends this high EOC signal to Micro-Controller to each
indicate completion of conversion.
OE [Output Enable]: When a high signal is applied to this pin, the output latch of ADC
get enables and the converted data is then available to Micro-Controller.

diagram
– 1M

d) Explain ‘CAN’ bus protocol and list out its two applications. 4M
Ans: Controlled Area Network [CAN]:- Can is mainly used in automotive electronics. CAN bus explanat
is a standard bus in distributed network. It has a bi-directional serial line which receives or ion –
sends a bit at an instance by operating at maximum rate of 1Mbps. It employs a twisted pair 3M,
connection to each node. The pair can run to a maximum length of 40m.
applicati
ons – ½
M each

Page 10/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________

Applications: Copiers, Telescopes, Medical instruments, Elevator controllers, Automobile


industry.
e) Sketch interfacing diagram to interface LCD display with 89C51. 4M
Ans: 4M

Q.5 Attempt any TWO of the following: 12


Total
Marks
(a) Explain resource allocation and interrupt handling function of RTOS. 6M
Ans: i) Interrupt Handling:
3M-
Interrup
t
Handlin
g,

3M-
Resourc
When an interrupt occurs, interrupt Service Routines (ISR) is run. e
Most interrupt routines in RTOS Copy peripheral data into a buffer , Indicate to other code Allocati
that data has arrived and Acknowledge the interrupt (tell hardware) on
RTOS normally disable the interrupts while handling critical section and enable after the
critical section has been executed. Interrupt latency is a factor to look for, when selecting a

Page 11/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
RTOS.
Interrupt latency = Maximum amount of time interrupts are disabled+ time to start
execution of first instruction of ISR. It is desirable that RTOS should have minimum
interrupt latency
ii) Resource allocation:
Sharing of resources by competing tasks as per their execution schedules is a function
RTOS. This means that tasks should have the required resources allocated to them
whenever they are needed. The Operating System allocates resources when a task need
them. When the task terminates, the resources are de-allocated, and allocated to other tasks
that need them. Resources can be allocated in Round Robin method or Priority based. Some
resources are non-Pre emptible eg. Mutex.
In Round Robin, tasks are scheduled in FIFO manner. Fixed Time quantum is given to the
tasks after which it is pre-empted. Priority Scheduling, resources are allocated to processes
according to priorities.
(b) Write a ‘C’ language program for 89C51 to generate triangular waveform. 6M
Ans: 2M-
Diagram
,

4M-
Progra
m

Program:
#include < reg51.h>
unsigned char d;
void main(void)
{
while(1)
{
for(d=0; d<255; d++)
{
P1 = d;
}
for(d=255; d>0; d--)
{
P1 = d;
}
}
}

Page 12/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
( For any other relevant logic marks can be given)
Write a ‘C’ language program for serial communication to transfer letter ‘M’ serially
(c) 6M
at 9600 baud continuously.
Ans: #include <reg51.h> 4M
void main(void) Progra
{ m, 2 M
TMOD = 0x20; //Initialize timer 1 in mode 2
commen
TH1 = 0xFD; //baud rate 9600
SCON = 0x50; //start serial communication ( 8bit , 1 stop bit , ts
REN )
TR1 = 1; //start timer 1
while(1)
{
SBUF=’M’; // place value in buffer
while( TI==0);
TI=0; // clear TI
}
}
12Total
Q.6 Attempt any TWO of the following:
Marks
(a) List out characteristics of RTOS and explain any four characteristics. 6M
Ans: Characteristics of RTOS: 2M list,
1. Reliability
2. Consistency 1M each
3. Predictability characte
4. Performance ristic
5. Scalability explanat
6. Compactness ion
 Reliability: A reliable system is one that is available (continues to provide service) and
does not fail. Embedded systems and hence RTOS used in such systems must be
reliable.
 Consistency: A key characteristic of an RTOS is the level of its consistency
concerning the amount of time it takes to accept and complete an application's task;
the variability is 'jitter’. A 'hard' real-time operating system has less jitter than a 'soft'
real-time operating system.
 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.
 Performance: This requirement dictates that an embedded system must perform fast
enough to fulfill its timing requirements.
 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.
 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.
Compare:
(b) 6M
(i) RISC with CISC processor
Page 13/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
(ii) Harward with Von Neuman architecture.

Ans: i) RISC with CISC processor 1M each


SR.
RISC CISC
NO.
Reduced instructions take Complex instructions
1
1 cycle require multiple cycles
Only Load and Store
Many instructions can
2 instructions can reference
reference memory
memory
Uses pipelining to execute Instructions are executed
3
instructions one at a time
4 Many general registers Few general registers
5 Emphasis on software Emphasis on hardware

ii) Harward with Von Neuman architecture.

(Any 3 points for RISC & CISC and Harvard & Von- Neumann)

Explain with sketch interfacing of stepper motor with 89C51. Write ‘C’ language
(c) 6M
program to rotate the motor clockwise.

Page 14/ 15
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
Ans: 3M-
Diagram

Program:
3M-
# include <reg51.h> program
void delay (unsigned int);
void main (void)
{
while(1)
{
P1=0x99;
delay (100);
P1=0xCC;
delay(100);
P1=0x66;
delay(100);
P1=0x33;
delay(100);
}
}
void delay(unsigned int k)
{
unsigned int x,y;
for (x=0;x<k;x++)
for (y=0;y<1275;y++);
}

Page 15/ 15

You might also like