Embedded Systems

Mid Semester Exam

February 23, 2012

Maximum Marks: 20

Maximum Time: 90 minutes

Total Questions: 7

Question-1: Assume that there are two devices communicating over point to point serial interface. Device 1 wants to transmit a packet of 2 bytes of data to Device 2. Calculate the time required to transmit the packet from Device 1 to Device 2 for each of the following interfaces (Take appropriate care of the necessary overhead in each case):

1.  Communication of I2C bus running in standard mode (data rate of 100 KB/s)

2.  Communication over SPI bus (also running at 100 KB/s)

3.  Communication over SPI bus when Device 1 also wants to read a packet of 2 bytes from Device 2 in addition to the original transmission

Also specify how many microcontroller pins will be required for each of the above three cases [3 marks]

Question-2: Answer the following briefly (in 1-3 sentences) [6 marks]

1.  What are 4 different types of core microcontroller components, essentially available in every microcontroller unit

2.  If a wireless radio is transmitting at 3 dBm, what is the transmit power in mW?

3.  If the program memory of a microcontroller is of size 16 kB and memory is organized into 16 bits for each address, what is the minimum size of Program Counter required for such a device?

4.  What are three different ways in which a different clock can be provided to a microcontroller component (e.g. a peripheral)

5.  Besides the specific sleep modes provided in an Atmel microcontroller, how can one do a finer resolution power management? What precaution should be taken when performing such power management?

6.  Why does servicing an interrupt or returning from interrupt incurs a delay?

7.  For each of compare and capture mode of Timer/Counter in xMega, specify when does the Buffer Value gets set and reset

8.  What are the different reasons for non-determinism in clock synchronization across different nodes in the network?

9.  If timer/counter in AVR is working in waveform generation mode and the desired frequency of waveform on WG output is 1/32 of the frequency of timer/counter clock, what is the value you should configure in Compare Channel Register (CCA). Assume prescaler factor for the clock as 1. Specify how you derive your answer

10.  For the 16-bit RTC running in xMega, what is the highest resolution you will get if 32.768 KHz clock is selected and what is the maximum timeout period?

11.  For the 12-bit ADC in xMega with 3.3V reference voltage, what is the voltage resolution you can get with the ADC?

12.  How is error detection implemented within PID field of USB packet? Explain with an example.

Question-3: Give full form of the following: [2 marks]

1.  UART 4. I2C

2.  GPIO 5. SPI

3.  ADC 6. USB

Question-4: What is the frequency selection scheme for the Bluetooth communication? Explain your answer with specific details of length of each timeslot, frequency range and number of channels used in the range [1 mark]

Question-5: Assume that we modify the CAN communication to support Wired-OR in place of Wired-AND as is discussed in the class. Assume four bit device ID and for a network where 3 devices, each with id 7, 9 and 10, start transmitting simultaneously, which device will get the bus control after the contention detection phase? Explain how the two loosing device will back off at different stages of bit transmissions. Assume that MSB of id is transmitted first. [1 mark]

Question-6: Are the following task sets schedulable by a static priority based preemptive scheduler? If yes, what priorities would you use? Indicate lowest priority by 1, next higher priority by 2, and so on. Wherever required, show "time lines" at all the relevant critical instants to justify your answers [3 marks]

1. Task T C

A 50 12

B 40 10

C 30 10

2. Task T C

A 80 32

B 40 5

C 16 4

Question-7: Assume that you purchased a water level detector system which returns an analog voltage proportional to the level of the water in the tank. You are required to interface your EVK1100 board with this level detector using and sound an alarm when water crosses a height 'h' meters. Assume you need to give high on a GPIO to sound the alarm. Write pseudo code for the level detection application, specifically mentioning the detailed steps (including register/pin configuration) required in the following high level steps:

a.  Clock selection

b.  Appropriate pin configuration for ADC as well as for GPIO

c.  ADC configuration and operation

You need not specify the exact register/pin name as long as you know what is the purpose of the register/pin as you write your pseudo code [4 marks]