Professional Documents
Culture Documents
Tracnghiem Avr
Tracnghiem Avr
com/mcq/avr-microcontroller/
Microprocessors
Microcontrollers
Bit processors
Amplifiers
Hint
2). AVR is the first MC to use on-chip ___ memory for program storage?
PROM
EEPROM
ROM
Flash
Hint
3). AVR Microcontroller has a ______ architecture?
Single
Von Neumann
None of these
Hint
4). AVR is a ____ RISC Single chip microcontroller?
3-bit
4-bit
6-bit
8-bit
Hint
Read more about RISC and CISC difference.
5). AVR Stands for _______?
Alf and Vegar’s RISC processor
None of these
Hint
6). AVR core with FPGA can run up to ____ Mhz?
20
30
40
50
Hint
Read more about FPGA
7). AVR DX family has a ____ bit ADC?
10
12
11
13
Hint
8). AVR DX family has a ____ bit DAC?
10
12
11
13
Hint
9). AVR DA series has no _____ high-frequency crystal?
Internal
External
Visible
Simple
Hint
10). AVR DB series has ____ on chip opamps?
1-2
2-3
3-4
4-5
Hint
11). Each GPIO port on mega or tiny AVR drives up to ___ pins?
2
4
6
8
Hint
Read more about Op-amps.
12) Each GPIO port is controlled by _____ 8-bit registers?
One
Two
Three
Four
Hint
13). DDRx registers configure the pins as either _____ or outputs?
Transfer
Receive
Inputs
Inputs
Hint
14). In DDRx, PORTx, PINx, x represents the port ____?
Number
Sign
Value
Identifier
Hint
15). PORTx sets the output values on ____ configured as outputs?
Memory
Pins
Lines
Buses
Hint
16). PORTx enables or disables the ____ resistor on pins configured as inputs?
Patch Up
Pull-Up
Pull-Down
Patch Down
Hint
17). PINx Input register which reads an ____ signal?
Input
Output
Difference
Sum
Hint
18). All AVR microcontrollers have internal _____ for semi-data storage?
ROM
RAM
EEPROM
PROM
Hint
19). EEPROM access much ______ than other internal RAM?
Faster
Slower
Medium
Constant
Hint
20). ATMega 32 AVR Microcontroller has ___ bytes of internal static RAM?
1kilo
2kilo
3kilo
4kilo
Hint
1024
526
256
None of these
Hint
22). Atmega 32 AVR has one ____ timer/counter with a separate Prescaler?
8-bit
16-bit
32-bit
64-bit
Hint
23). ____kilo bytes of system self-programmable flash program memory?
4
16
32
64
Hint
24). _____ Programmable I/O lines in AVR microcontrollers?
16
24
32
4
Hint
25). PWM Channels that exist in AVR microcontrollers are ___?
2
3
4
5
Hint
26). How many sleep modes exist in AVR microcontrollers?
2
3
6
9
Hint
27). ATmega32 microController is a low-power ____ technology based controller?
PMOS
NMOS
CMOS
MOSFET
Hint
28). ATmega 32 microcontroller is a ___ pin DIP?
20
30
40
50
Hint
29). Port A serves as ___ inputs for A/D Converter?
Digital
Analog
Virtual
Discrete
Hint
30).____ is an analog signal reference pin for the analog to digital converter?
AREF
ADIG
AAR
None of these
Hint
31).____ acts as input for inverting amplifiers and clock circuits?
XTAL1
XATTR
XCLK
None of these
Hint
32).____ acts as output from inverting oscillator amplifiers?
XTAL1
XATTR
XCLK
XTAL2
Hint
33)._____ is a supply voltage pin connected to A/D Converter?
AVcc
Aref
and
None of these
Hint
34). How many addressing modes exist for data memory?
2
3
4
5
Hint
35).____ I/O registers are accessible by SRAM memory?
16
24
32
64
Hint
1
2
3
4
Hint
37). All registers in ATmega8 microcontrollers are connected directly to ____?
Special registers
SPI
I2C
ALU
Hint
38). PORT D and PORT B have ___ I/O lines?
6
7
8
9
Hint
39). Port C has ____ I/O lines of ATmega 8 MC?
6
7
8
9
Hint
40). Using pins 4 and 5 of Atmega 8 MC are used as ____ interrupts?
Internal
External
Medium
None of these
Hint
41). Pins 12 and 13 are used as analog _____ inputs?
Comparator
Subtractor
Amplifier
None of these
Hint
42). Pins 6 and 11 are used as _____/timer sources?
Counter
Comparator
Amplifier
None of these
Hint
43). Pins 23 to 28 are used for ____ channels?
DAC
Sampling
ADC
None of these
Hint
44). Pin 19 is used as ____ clock input for the SPI channel?
Slave
Master
Both a and b
None of these
Hint
45). ______ mode is used for saving the operational power of a microcontroller?
Idle
Power Saving
Stand By
Power down
Hint
46).______ mode stops the functioning of the CPU?
Idle
Power Saving
Stand By
Power down
Hint
47).____ mode stops all the generated clocks?
Idle
Power Saving
Stand By
Power down
Hint
48). In ___ mode, only an oscillator is allowed to operate all operations of MC?
Idle
Power Saving
Stand By
Power down
Hint
49).DDR Stands for _____?
None of these
Hint
50). USART protocol supports the _____ protocol?
Half-Duplex
Full-Duplex
Semi
None of these
Hint
51). AVR USART generates a high _____ baud rate?
Peak
Resolution
Speed
Visible
Hint
52). AVR USART consists of two ____ bits?
Data
Parity
Stop
Low
Hint
53). USART protocol of the AVR microcontroller operates in ___ modes?
One
Two
Three
Four
Hint
54). Data is transmitted and received bit by bit without ____ by the predefined baud
rate?
Speed
Clock Pulses
Temperature
None Of these
Hint
55). In asynchronous double speed mode, data is transferred at double the ____ rate?
Speed
Temperate
High
Baud
Hint
56). If UMSEL is 0, then the mode is ______?
Asynchronous
Synchronous
Alternative
Normal
Hint
57). If UMSEL is 1, then the mode is ______?
Asynchronous
Synchronous
Alternative
Normal
Hint
58). Expand PDI stands for ____?
None of these
Hint
59). ATmega 16 works on ___ Mhz of maximum frequency?
12
14
16
18
Hint
2.3
4.4
5.5
6.2
Hint
61). JTAG is interfaced for on-chip _____ and programming?
Debugging
Transition
System
Transfer
Hint
62). AVR can execute single ___ execution for each second?
Mode
Cycle
Time
None of these
Hint
63). If the operating frequency is high then the speed is also ____?
Low
Medium
High
Constant
Hint
64). 16 interrupts are ____ in the AVR microcontroller?
External
Internal
Medium
Last
Hint
65). Watchdog timer is present with internal ____?
Timer
Oscillator
Tuner
Processors
Hint
66). Expand SRAM ______?
None of these
Hint
67)._____ is used to connect a network for devices?
SPI
I2C
TWI
DAC
Hint
68). Set the SPI to enable bit inside the ___ register?
SCR
SPCE
SPCR
SPI
Hint
69). SPI exchange the contents of SPDR register of master and _____?
Timer
User
Source
Slave
Hint
70). In SPCR Prescaler bits are _____ to configure?
Pre-Used
Unused
Necessary
Constant
Hint
71). For interfacing ADC0804 with any microcontroller, a minimum of ___ pins are
required?
9
10
11
12
Hint
72).____ is a square wave with varying low and high amplitude signals?
Timer
Counter
PWM
WDM
Hint
73). _____ represents the percentage of the period when the signal remains ON?
PWM
Duty cycle
On-time
Off-time
Hint
74). ____ is the sum of on and off-time of pulse width modulation?
Period
Duty Cycle
Off-Time
Hint
75).____ operation is performed by averaging the PWM signal?
Voltage regulation
Duty cycle
On-time
Off-time
Hint
AVR Microcontroller
a) PORT
b) PIN
c) DDR
2. The data will not go from the port registers to the pin unless:
a) 0
b) 1
d) 0 & 1
Answer: 0
a) true
b) false
d) can’t be determined
Answer: false
a) SBI
b) PORT
c) CBI
Answer: PORT
c) It is a 4 byte instruction
9. Which of the following instruction can be used to toggle a bit of the PORT?
a) SBI
b) CBI
a) Z
b) C
c) N
a) SUB
b) SBC
c) SUBI
4. What steps are involved when we subtract two numbers present at two different
locations?
Answer: when carry is generated only from D6 to D7 or carry is generated only from D7
8. To set the bits of a register R1 to 1, we must OR the contents of the register with?
a) 00H
b) 11H
c) FFH
d) 0FH
Answer: FFH
a) true
b) false
d) can’t be said
Answer: false
c) it rotates the contents of the register from left to right through carry
d) it rotates the contents of the register from right to left through carry
Answer: it rotates the contents of the register from left to right through carry
Timer Programming
1. In AVR, which of the following registers are not used for programming timers?
a) TCNT
b) TCON
c) TIFR
Answer: TCON
b) for increasing the time delay given by the timer by decreasing its frequency of operation
Answer: for increasing the time delay given by the timer by decreasing its frequency of
operation
a) Normal mode
b) CTC mode
c) PWM mode
b) timer1
c) timer2
Answer: timer1
a) f/2
b) f/4
c) f/16
d) f/32
Answer: f/32
7. What is the difference in the operation of a normal and a CTC mode of a timer?
c) in CTC mode, timer counts up until contents of TCNT register becomes equal to the
contents of OCR
Answer: in CTC mode, timer counts up until contents of TCNT register becomes equal to
the contents of OCR
8. We can count the pulses on the positive or the negative edge triggered pulse of the
clock?
a) true
b) false
c) can’t be determined
d) depends on the circumstances
Answer: true
a) PORTB.0
b) PORTB.1
c) PORTB.2
d) PORTB.3
Answer: PORTB.0
10. Which resource provides the clock pulse to AVR timers if CS02-00=6?
Interrupt Programming
1. On reset, what are the contents of the SREG register?
a) 00h
b) ffh
c) 1fh
d) 11h
Answer: 00h
2. TIMSK register is used for?
b) used for masking the interrupts flags of the Timer0, Timer1 and Timer2
Answer: used for masking the interrupts flags of the Timer0, Timer1 and Timer2
b) because it returns to the main program with all the flags of the SREG raised
c) because it returns to the main program where interrupt is generated and set the global
interrupt enable bit in SREG
Answer: because it returns to the main program where interrupt is generated and set the
global interrupt enable bit in SREG
a) 0002h
b) 0004h
c) 0006h
5. What is the address in the interrupt service routine assigned for the timer0 overflow flag?
a) 0012h
b) 000Ah
c) 0016h
Answer: 0016h
6. Is the same address is assigned for the timer0 and timer1 overflow flag in the interrupt
vector table of the interrupts?
a) true
b) false
c) can’t be determined
Answer: false
a) PORTD.2
b) PORTD.3
c) PORTB.2
8. Which register is responsible for handling all the external hardware interrupts?
a) TIMSK
b) GICR
c) MCUCR
d) IVCE
Answer: GICR
b) level triggered
10. What will happen in that condition, if an interrupt occurs while the microcontroller is
serving any other interrupt?
c) the interrupt that is more priority in the interrupt vector table will be served first
d) the interrupt having low priority in the interrupt vector table will be served first
Answer: the interrupt that is more priority in the interrupt vector table will be served first
b) they are the RS232 connectors used to connect two incompatible devices
c) they are the TTL logic connector pins used for communication
d) they are just data transfer pins used to transfer the data
Answer: they are the RS232 connectors used to connect two incompatible devices
c) this pin is high during a reception in order to tell that the device is busy at this particular
time
Answer: this pin is high during a reception in order to tell that the device is busy at this
particular time
c) one needs some additional circuitry to operate while the other doesn’t have that
d) one is used just for transmission while the other is used for both transmission as well as
reception
Answer: one needs some additional circuitry to operate while the other doesn’t have that
4. Which of the following is correct about the baud rate during serial transmission?
5. 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
Answer: 33H
6. The USART in AVR based microcontrollers operate at which of the following modes?
b) master synchronous
c) slave synchronous
7. Which bit of the UCSRA is used for doubling the baud rate of the transmission?
a) DOR
b) PE
c) U2X
d) MPCM
Answer: U2X
8. What is the use of the PE and the FE bits of the UCSRA register?
a) they are used for keeping a check at the speed of transmission and reception
b) they are used for keeping a check at the data bits to be transferred
9. Which of the following bits are used for setting the data frame size?
a) UCSZ0
b) U2X
c) DOR
d) MPCM
Answer: UCSZ0
10. Which of the following parameters should the transmitter and the receiver agree upon
before starting a serial transmission?
a) baud rate
b) frame size
c) stop bit
a) Input/Output
b) Analog to Digital
c) Digital to analog
Answer: Input/Output
a) RD
b) WR
c) D0-D7
d) All of the mentioned
3. Find the control word for PA= out, PB= in, PCL=out, PCH=out (Mode0)?
a) 0x02H
b) 0x82H
c) 0x83H
d) 0x03H
Answer: 0x82H
4. Which pins are used to select the ports and the control register?
a) CS
b) A1
c) A0
5. What is the value of the control register when RESET button is set to zero?
a) 0x00H
b) 0xFFH
c) 0x11H
6. Why MOVX instruction is being used to access the ports of the 8255?
Answer: In BSR mode, only the individual bits of PORT C can be programmed
8. How many pins of the 8255 can be used as the I/O ports?
a) 8
b) 16
c) 24
d) 32
Answer: 24
a) 16
b) 8
c) 40
d) 60
Answer: 40
10. 8255 has handshaking capability?
a) yes
b) no
c) cant be said
Answer: yes
a) 2 modes
b) 3 modes
c) 4 modes
d) 5 modes
Answer: 4 modes
a) conversion
b) communication
d) memory management
2. RTC chips use ______ to compute time, date when the power is off.
a) ac supply
b) generators
c) rectifiers
d) battery
Answer: battery
a) Communication device
c) RTC chip
a) true
b) false
c) cant be said
Answer: false
a) 16, 8Mhz
b) 8, 16Mhz
c) 16, 32Mhz
d) 8, 32Khz
Answer: 8, 32Khz
6. Vbat requires a positive signal of
a) 3V
b) 5V
c) 9V
d) 12V
Answer: 3V
7. In DS1307, which out of the following is correct about the SQW pin?
a) input pin
b) output pin
c) i/o pin
a) 32
b) 64
c) 128
d) 256
Answer: 64
a) 00H
b) 03H
c) 07H
d) 10H
Answer: 07H
a) clock high
b) clock halt
c) clear high
d) clear halt
c) they are used to reduce the back emf from the motors
2. Why are ULN2803 normally used between the microcontrollers and the relays?
a) SPST
b) SPDT
c) DPDT
5. Reed switches show connectivity whenever they are in the presence of an electrical field?
a) true
b) false
c) can’t say
Answer: false
a) in printers
b) in robots
c) in vehicles
d) all of the mentioned
7. 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
Answer: 0011,1001,1100,0110
9. 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
Answer: 45
b) false
c) can’t say
Answer: true
SPI Protocol
1. Why do we make the connection of the SCLK for communicating serially between two
devices?
c) In 3 wire SPI, there is only one pin for transmission and reception
d) In 3 wire SPI, there are three pins MOSI, MISO and SCLK
Answer: In 3 wire SPI, there is only one pin for transmission and reception
a) true
b) false
c) can’t be said
Answer: false
a) SPSR
b) SPCR
c) SPDR
a) We set the MSTR bit, and make the CPOL= 1 and CPHA=0
b) We set the MSTR bit, and make the CPOL= 0 and CPHA=1
c) We reset the MSTR bit, and make the CPOL= 1 and CPHA=0
d) We reset the MSTR bit, and make the CPOL= 0 and CPHA=1
Answer: We set the MSTR bit, and make the CPOL= 0 and CPHA=1
a) true
b) false
d) can’t be said
Answer: false
a) fosc/4
b) fosc/64
c) fosc/16
d) fosc/2
Answer: fosc/2
10. To select the value of the clock to be fosc/16, what are the appropriate values?
I2C Protocol
1. Which of the following is correct?
a) I2C is a technique by which data is transmitted with the help of only eight pins
a) the data line cannot change when the clock line is high
b) the data line can change when the clock line is high
c) the clock line cannot change when the data line is high
d) the clock line can change when the data line is high
Answer: the data line cannot change when the clock line is high
a) true
b) false
c) cant be said
Answer: true
4. The STOP condition is generated by a
a) high to low change in the SDA line when the SCL is low
b) high to low change in the SDA line when the SCL is high
c) low to high change in the SDA line when the SCL is low
d) low to high change in the SDA line when the SCL is high
Answer: low to high change in the SDA line when the SCL is low
b) Address packet
a) true
b) false
c) cant be said
d) depends on the conditions
Answer: true
8. Which of the following is a register used for programming AVR’s I2C module?
a) TWBR
b) TWCR
c) TWSR
9. Which bit is polled to know that whether the TWI is ready or not?
a) TWWC
b) TWINT
c) TWEA
Answer: TWINT
a) yes
b) no
d) cant be said
Answer: yes
LCD Interfacing
1. In AVR, the LCD operates in two main modes, it can be in 8 bit or 4 bit data.
a) true
b) false
d) can’t be said
Answer: true
2. What can be the sequence of commands that may be used for initializing an LCD?
3. When the LCD operates in the 4 bit mode, then what more commands are added to it?
a) 33
b) 32
c) 28
a) input pin
b) output pin
8. What is the address of the second column and the second row of the 2*20 LCD?
a) 0x80
b) 0x81
c) 0xc0
d) 0xc1
Answer: 0xc1
9. Which of the following commands takes more than 100 microseconds to run?
d) clear screen
a) 1
b) 0
c) F
d) 10
Answer: 1
Keyboard Interfacing
1. In reading the columns of a keyboard matrix, when no key is pressed then all the pins
show?
a) 0
b) 1
c) F
d) 7
Answer: 1
a) true
b) false
c) can’t be said
Answer: true
3. Identify the row and the column for the following case when for the row D3-D0= 1110 and
for the column D3-D0= 1101
4. What are the actual steps that are followed in identifying any key that is being pressed?
5. To identify that the key is present in which row and the column
c) we connect the bits of the row to the logic level 1 one by one
6. The key detection and the key identification are two different procedures?
a) true
b) false
d) difficult to tell
Answer: true
KCODE0<<1
8. If the pins of the keyboard are used as an interrupt, then these pins will cause an interrupt
of what type?
b) Timer interrupt
c) TI/RI interrupt
9. What will happen if the two keys of the keyboard are pressed at a time?
b) the key which is being actually pressed(for more then 20microseconds) will be displayed
Answer: the key which is being actually pressed(for more then 20microseconds) will be
displayed
10. Why initially all keys are considered open before detecting the key pressed?
Answer: to remove the errors caused by other pressing keys during detection
a) 16
b) 4
c) 8
d) 48
Answer: 8
4. Which of the following factors can affect the step size calculation?
a) number of bits
b) input current
c) output current
a) parallel
b) 12 bit
c) serial
d) all of the mentioned
Answer: serial
6. Why do we connect a capacitor between the Vref and the Gnd pin?
d) to make Vref stable and also to increase the precision of the ADC
Answer: to make Vref stable and also to increase the precision of the ADC
7. Which of the following are the registers that are used for controlling the ADC conversion
in the AVR?
a) ADCSRA
b) ADMUX
c) SPIOR
a) 5V
b) 3.3V
c) 2.56V
Answer: 2.56V
a) electrical pulse
b) current
c) voltage
Answer: current
a) analog, digital
b) current, voltage
c) digital, analog
d) analog, current
Sensor Interfacing
1. Which of the following is correct about the word sensors?
b) for testing
4. What is the difference between the LM34 and the LM35 based sensors?
b) one has output voltage proportional to the Celsius scale while others have to the
Fahrenheit scale
Answer: one has output voltage proportional to the Celsius scale while others have to the
Fahrenheit scale
a) true
b) false
c) can’t say
Answer: true
b) 0.1
c) 0.001
d) 10
Answer: 0.001
8. What is the temperature for LM35 sensor if the analog output is 0011 1001?
a) 3
b) 9
c) 57
d) 41
Answer: 57
9. In an external hardware, there are how many pins available for the LM35 and the LM34
based sensors?
a) 2
b) 3
c) 10
d) 1
Answer: 3
a) yes
b) no
d) can’t say
Answer: yes