0% found this document useful (0 votes)
6 views2 pages

Mid Sem PES18092018

The document is a mid-semester examination paper for a course on Programmable Embedded Systems at the Indian Institute of Technology Kharagpur. It includes various questions related to embedded programming concepts, interrupt handling, motor control systems, preemptive scheduling, and definitions of key terms in embedded software. Students are required to answer all questions, demonstrating their understanding of the topics covered in the course.

Uploaded by

suzume san
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)
6 views2 pages

Mid Sem PES18092018

The document is a mid-semester examination paper for a course on Programmable Embedded Systems at the Indian Institute of Technology Kharagpur. It includes various questions related to embedded programming concepts, interrupt handling, motor control systems, preemptive scheduling, and definitions of key terms in embedded software. Students are required to answer all questions, demonstrating their understanding of the topics covered in the course.

Uploaded by

suzume san
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/ 2

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Department of Electrical Engineering


Mid Semester Examination for Programmable Embedded System (EE60098)
Date: September 18, 2018 Time: 09:00AM – 11.00AM Full Marks 120
Answer ALL questions. The mark for each question indicates the time allocated for the answer. State your
assumptions clearly.

1. (a) Explain how embedded programs perform input/output using interrupts (preferably using sequence diagrams
of the UML framework). (4+2)
(b) Explain the terms ISR and interrupt priority (3+3)
(c) Mention any one “good practice” while coding and ISR and explain its advantage (3)
2. Consider the two similar but not identical code segments shown below. Each of the segments consist of a main()
function and an ISR corresponding to an asynchronous interrupt related to I2C bus communication. Upon
interrupt, the ISR reads two bytes from the bus buffer into the variable Data and returns. The variable Data is
transferred to another variable named LocalData in main(). One of the code segments is marked correct while the
other is marked incorrect in the sense that in the incorrect code segment, under some circumstances, the
LocalData variable may hold values different from those which have been received over the bus.

unsigned int Data; unsigned int Data;


void main () void main ()
{ {
unsigned int unsigned int LocalData;
LocalData;
-- --
while(1) while(1)
{ {
LocalData = Disable_interrupts;
Data;
-- LocalData = Data;
} Enable_interrupts;
} --
}
}
Void I2C_ISR(void) Void I2C_ISR(void)
{ {
Data = I2C_BUF[0]; Data = I2C_BUF[0];
Data = Data =
(Data <<8) | (I2C_BUF[1]); (Data <<8) | (I2C_BUF[1]);
} }
Case1: Incorrect Case2: Correct

(a) Model the joint execution of the main function and the ISR using a possibly hierarchical state machine
framework. Define the states and transitions of your model in terms of the code and its execution. Assume that
this is the only code running and there is no other interrupt in the system (15)
(b) By using reachability analysis on your state machine, justify or contradict the correct/incorrect markings of the
code segments. (10)
3. Three phase induction motors will spin either clockwise or counterclockwise, depending on the connection to
the power lines. In applications requiring motor operation in both directions, two separate contactors (power
relays) might be used to make the connections, one for each direction. Also, in some applications of large
motors, the motor starts through a transformer that reduces the impact on the power supply. The transformer is
bypassed by a third contactor after the motor has been given enough time to come up to speed. There are three
momentary control inputs: requests for forward, reverse, or off. When the motor is off, forward or reverse
requests cause the motor to start up and run in the requested direction. A reverse request is ignored if the
motor is starting or running in the forward direction and vice versa. An off request at any time shuts the motor
off. An embedded software is supposed to control the operation of the induction motor through operation of
various contactors.
(a) Define the various inputs and outputs of the embedded system, including relay outputs for contactors,
potential free relay contact inputs, pushbutton inputs, indicators, sensors etc. as planned by you. (5)
(b) Define the control logic of the embedded software using a statechart diagram of UML. (15)

4. (a) Describe the different states of a computing task under preemptive priority scheduling using a state machine
diagram. (15)
(b) Explain with appropriate examples why preemptive priority scheduling is very desirable for most real-time
embedded systems with multiple hard real-time tasks. (10)
(c) An RT embedded system consists of four scanner tasks that scan sensor data from the field and write on to a
buffer that is read by a data handler once every 100 ms. For each round of scanning each scanner takes 5 ms to
transfer data and the data handler takes a further 20 ms of CPU time. If the scanning cycle is invoked
periodically by a timer which consumes 20 ms of CPU time each time it is triggered, determine whether the
tasks can be feasibly scheduled by a fixed priority preemptive scheduling policy, (ignoring other factors such
as context switch time etc.) under a suitable priority assignment scheme. Further, determine what can be the
minimum of period of cyclic scanning (assume only integer periods in milliseconds) possible so that all tasks
can be feasibly scheduled. (5+10+2)
5. Explain the following terms in the context of embedded software. (53)
 Hard real-time systems
 Priority inversion
 V-model for embedded software development

End of Question Paper

You might also like