AVR Microcontroller Test
AVR Microcontroller Test
1. Find a TCNT0 value needed to generate 125Hz of frequency on PB3. Use Timer0, Normal Mode,
Prescaler 256. XTAL=8MHz.
a) 80H
b) 85H
c) 83H
d) 88H
2. A LED is connected to PC4. Find the value of suitable prescaler required to generate a delay of 1
second for blinking that LED. Use Timer1, CTCl Mode, XTAL = 8MHz.
a) 8
b) 64
c) 256
d) 1024
3. For given Timer0 delay program, find after how many clock cycles TOV0 flag will set ?
a) 256
b) 13
c) 15
d) 242
4. Find the amount of Time delay generated by following Timer delay program. XTAL=8MHz.
a) 12.5 µs
b) 0.125 µs
c) 25.75 µs
d) 6.25 µs
5. Find the value of TCCR2 if we want to program Timer2 in Normal Mode with prescaler of 64 using
internal clock source
a) 02H
b) 04H
c) 01H
d) 03H
6. What is the output of following program for interrupt programming ?
10. Which register is responsible for handling all the external hardware interrupts?
a) TIMSK
b) GICR
c) MCUCR
d) IVCE
11. With fosc=8 MHz, what will the count that has to filled in the UBRR register to
account for the 9600 baud rate?
a) 67H
b) CEH
c) 33H
d) 34H
12. What is the value of UCSRB & UCSRC registers to configure USART for
asynchronous mode, 8 data bit, no parity and 1 stop bit.
a) 04H & 18H
b) 14H & 08H
c) 18H & 04H
d) 08H & 14H
13. Which bit of the UCSRA is used for doubling the baud rate of the
transmission?
a) DOR
b) PE
c) U2X
d) MPCM
14. What is the main function of the LPM instruction used in LCD?
a) for initializing the LCD in the read mode
b) for initializing the LCD in the write mode
c) for sending a long string of characters to the LCD
d) all of the mentioned
17. Which of the following commands takes more than 100 microseconds to run?
a) shift cursor left
b) shift cursor right
c) set address location of the DDRAM
d) clear screen
18. In 4X4 keyboard interfacing , to detect key press which of the following is
grounded ?
a) all rows
c) both a) & b)
19. For 8 bit ADC Vref= 2.56V. Calculate digital output D7-D0 if analog input is
2.1V.
a) 10101010
b) 11010010
c) 01010101
d) 01110110
20. AVR is connected to 1MHz crystal. Calculate ADC clock frequency for
ADPS2:0 = 001 of ADCSRA register.
a) 2MHz
b) 0.5MHz
c) 8MHz
d) 4MHz
21. LM35 provides _______ V for each degree count?
a) 1
b) 0.1
c) 0.001
d) 10
22. Calculate the output voltage of 8 bit DAC converter if digital input is
10000000. Given R=5KΩ, Iref=5mA.
a) 1v
b) 1.5v
c) 5v
d) 2.5v
24. Why are opto isolators normally used between the microcontrollers and the
ULN2803?
a) to optimize the current
b) to reduce the back emf
c) to increase the current
d) to increase the voltage
25. Why are ULN2803 normally used between the microcontrollers and the
relays?
a) for switching purposes
b) for increasing the current capability required by a relay
c) for increasing the voltage capability required by a relay
d) all of the mentioned
27. For a normal 4 step sequence, what are the number of teeth required to
accomplish a 2 degree step angle?
a) 180
b) 90
c) 360
d) 45
28. What are normal 4 step sequence of a stepper motor if we start to move in
clockwise direction with 0110 value?
a) 1100,1001,0011,0110
b) 0011,1001,1100,0110
c) 1001,1100,0110,0011
d) 0101,1010,0101,1010
29. if a stepper motor takes 90 steps to complete one revolution, what is the step
angle for this motor?
a) 2°
b) 4°
c) 3°
d) 6°
30. For SPI Port if CPHA= 0 and CPOL=1, then which of the following is true?
a) read on rising edge, changed on a falling edge
b) read on falling edge, changed on a rising edge
c) write on rising edge, changed on a falling edge
d) write on rising edge, changed on a falling edge
33. To select the value of the clock to be fosc/16, what are the appropriate
values?
a) SPI2X= 0, SPR1= 0, SPR0=1
b) SPI2X= 0, SPR1= 1, SPR0=0
c) SPI2X= 1, SPR1= 1, SPR0=0
d) SPI2X= 0, SPR1= 1, SPR0=1
34. For given Assembly code determine the operating mode & Operating Clock
of SPI port.
38. Which bit is polled to know that whether the TWI is ready or not?
a) TWWC
b) TWINT
c) TWEA
d) All of the mentioned
40. For I2C Port interfacing observing following waveform identify the slave
address sent from Master.
a) 1001101
b) 0010110
c) 1011001
d) 0011010
41. Calculate the Serial clock frequency(SCL) of I2C port, given TWPS bit in
TWSR is 01and value of TWBR is 80H.
a) 10.30kHz
b) 25.15kHz
c) 7.69kHz
d) 8kHz
42.