Zeal Polytechnic, Pune.: Third Year (Ty) Diploma in E&Tc Engineering Scheme: I Semester: V
Zeal Polytechnic, Pune.: Third Year (Ty) Diploma in E&Tc Engineering Scheme: I Semester: V
Zeal Polytechnic, Pune.: Third Year (Ty) Diploma in E&Tc Engineering Scheme: I Semester: V
Page 1 of 10
Scheme – I
Question Paper Profile
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.
(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:
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.
2
Scheme – I
Question Test Paper - I
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.
3
Scheme – I
Question Test Paper - II
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.
4
22532
11920
3 Hours / 70 Marks Seat No.
Marks
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.
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
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
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)
__________________________________________________________________________________________________
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)
__________________________________________________________________________________________________
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
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)
__________________________________________________________________________________________________
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.
(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