Birla Institute of Technology & Science, Pilani Work-Integrated Learning Programmes Division First Semester 2009-2010 Comprehensive

Examination (EC-2 Regular) Course No. Course Title Nature of Exam Weightage Duration Date of Exam Note:
1. 2. 3. 4.

: EEE ZG512 : EMBEDDED SYSTEM DESIGN : Open Book : 60% : 3 Hours : 24/10/2009 (FN)

No. of Pages =2 No. of Questions = 5

Please follow all the Instructions to Candidates given on the cover page of the answer book. All parts of a question should be answered consecutively. Each answer should start from a fresh page. Mobile phones and computers of any kind should not be used inside the examination hall. Use of any unfair means will result in severe disciplinary action.

List the pseudo codes to change the memory map of the C32 microcontroller from Special Single chip to Normal Expanded Narrow Mode by properly indicating the bit values of registers required to remap. Q.1 (b). Write instructions to elevate the priority of Timer Channel 4 as the highest one. [3 + 2 = 5] Q.2. An 8-bit number is stored in memory location MEM1 as shown below.
Q.1 (a).

D7 D6 D5 D4 D3 D2 D1 D0 Write an assembly language program to perform bit- reversal and store the new pattern in memory location MEM2 as shown below: D0
Q.3.

D1

D2

D3

D4

D5

D6

D7 [10]

Two LEDs and two switches are attached to Port T of a 9s12C32 controller as shown below. The other 4 bits of Port T are used for other unrelated tasks. Note: when the switch is pushed the input becomes 0.

3.1

Devise your logic and write pseudo codes (like READ, IF, ELSE, AND, OR etc.) that continuously reads the two inputs. After reading the value of the two switches you should turn on both LEDs if either switch is pressed or turn off both LEDs if both switches are not pressed. If you were asked to use the switch connected at PT3 as input capture which generates an interrupt, indicate the required registers that will be used for this purpose with the corresponding bit values you will have to program. [6 + 4 = 10] Page 1 of 2

3.2

EEE ZG512 (EC-2 Regular)

5. [9] Design an embedded system which controls parking of cars with the following specification using MC9S12C32 microcontroller. 5.4.5.1.2. [26] ********* EEE ZG512 (EC-2 Regular) Page 2 of 2 . Give the complete block diagram showing all the internal modules that you are going to use. The system should read the temperature and control the speed of the fans accordingly.5 KHz PWM output on PWM channel 2 of the C32 microcontroller with a duty cycle of 55%. 5. The system should read the temperature values from the sensors and should compute the average value. State the purpose and justify the choice of various units you have selected.4. List the various units of 9S12C32 that will be used for controlling the parking of cars. If the average temperature is below 35°C the duty cycle should be 20%. First Semester 2009-2010 Page 2 What is the difference between output compare based PWM wave and the one which is generated using PWM module? Give the register details and calculations for generating a 5. If the average temperature is above 35°C the duty cycle should be 55%. Specify the register details used by each unit and the modes configured if any.3. 5. c) At any given time only one car can enter or exit (use separate sensors). d) If the numbers of cars inside the parking are more than 200 the doors are deactivated (i. a) The basement of a building is being used as parking area with a maximum capacity of 200 cars. Q.EEE ZG512 (EC-2 Regular) Q. Based on the temperature the ac vents should be opened or closed. g) Four large induction fans placed in the parking room are used for cooling the parking. An interrupt should be raised every 30 seconds to the microcontroller to indicate the time. These fans rotate at two varying speeds. For speed control the duty cycle of a signal whose frequency is 20 KHz should be varied. no further entry) and one LED should be activated to indicate FULL at the entry door. b) There is a separate entry and exit point. f) The temperature sensors give a uni-polar voltage output 0-4.5 V for temperatures from 0-50°C.e. h) The temperature monitoring should be done every 30 seconds. e) The parking area is monitored for rise in temperature by means of six sensors placed at different points.