You are on page 1of 6

08/07/2023 09:53 MC - Review Questions

Review Questions
2:04 AM Saturday, June 10, 2023
Q1 ) There are two switches S1 and S2 are connected to pin 3 and 6 of port B respectively. There is a
LED is connected to pin 4 of port D and a motor that needs more current is connected to pin 5 of the same
port D. If S1 is only closed, then turn the LED on and turn the motor off. If S2 is only closed, turn the
LED off and turn the motor on. Otherwise, switch both of LED and motor off. Draw the suitable circuit
block diagram.

Q2) To transmit 8 Mega Character data file using RS232 serial link operating at
9600 bps, it took 102 min. If the system does not use parity bit, how many bits
are there to represent each character? and how many stop bits are used?

Q3)An AVR microcontroller with two ports B and A is shown below. A 4-bit input is coming from sensors
that determine Carbon Dioxide (CO2) level in a room. The shown configuration is a part of a bigger system

Review Questions Page 1

about:blank 1/6
08/07/2023 09:53 MC - Review Questions

to monitor pollution level in that room. Three LEDs (LED1, LED2 and LED3) are interfaced with pins PA1,
PA3 and PA7 as shown. The LEDs will indicate CO2 level in the room as follows:
- If the reading is between 0 – 3 (inclusive) all LEDs are OFF
- If the reading is between 4 – 8 (inclusive) LED1 is ON and the rest are OFF
- If the reading is between 9 – 12 (inclusive) LED1 & LED2 are ON, LED3 is OFF
- Otherwise, LED1, LED2 & LED3 are ON
Write the main c code (without pre-processor directives) that continuously checks the sensors and indicates
CO2 level. Hint: Logic 1 will turn and LED ON.

Review Questions Page 2

about:blank 2/6
08/07/2023 09:53 MC - Review Questions

Q4) The string of bits shown below was received via RS-232 using 8N2 mode of transmission.
The first bit from left to right is a start bit. Refer to the ASCII table below and decode the
message.

0010101 1 01010100 1

D E F G H I J K L M
Letter A B C
Hex 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D
Letter N O P Q R S T U V W X Y Z
Hex 4E 4F 50 51 52 53 54 55 56 57 58 59 5A

Q5) It takes 12.28s to transmit 50% of a 2KB file via RS-232 using 8O2 mode of transmission. Find the baud rate?

Review Questions Page 3

about:blank 3/6
08/07/2023 09:53 MC - Review Questions

Q6) For interrupts in the ATMega 8:


(a) Write instructions to enable external interrupt 1 such that a rising edge generates an interrupt.
(b) Write an ISR that increments a global variable z by three.
(c) If initially z = 5, and a TTL clock signal of 40 Hz is connected to the interrupt pin, what will
be the value of z after one minute? (assume interrupt is the same as that of parts (a) and (b).

Review Questions Page 4

about:blank 4/6
08/07/2023 09:53 MC - Review Questions

Q7) What is the purpose of the function sei() in relation to WinAVR? What is its opposite function?

Review Questions Page 5

about:blank 5/6
08/07/2023 09:53 MC - Review Questions

Q8 ) The size of a memory is 512K memory locations, find how many address lines are there
if each memory location has 4 bytes? [5 points]

Review Questions Page 6

about:blank 6/6

You might also like