Engineering Questions with Answers - Multiple Choice Questions

MCQs on Timer Programming

1 - Question

In AVR, which of the following registers are not used for programming timers?
a) TCNT
b) TCON
c) TIFR
d) None of the mentioned

View Answer

Answer: b
Explanation: In the timer programming of an AVR microcontroller, mainly used registers are TCNTn that stores the values of the count. TCCRn that is used to assign the mode of operation of a timer and TIFR that stores the status of various flags of the timers. Two more registers are used they are OCRn and OCFn. They are used for comparison with the count register.




2 - Question

What is the use of the prescalar in the operation of the timer?
a) for fast calculations
b) for increasing the time delay given by the timer by decreasing its frequency of operation
c) for removing the concept the reloading of count
d) for easy counter operations

View Answer

Answer: b
Explanation: Prescalars are used in the operation of the timers because they generally increase the time delay generation by decreasing the frequency of its operation.




3 - Question

What modes are generally used in the operation of the timer0?
a) Normal mode
b) CTC mode
c) PWM mode
d) All of the mentioned

View Answer

Answer: d
Explanation: Modes of a timer are decided by the WGM00 and WGM01 bit of the TCCR0 register and for timer0 these modes are normal mode, CTC mode, pwm mode and the fast pwm mode.




4 - Question

Timer 0 can act as a counter ____________
a) if the CS02-CS00 are 110 or 111
b) if the FOC0 bit is set to 110
c) none of the mentioned
d) all of the mentioned

View Answer

Answer: a
Explanation: Timer0 can act as a counter if the CS02-CS00 bits are from 110-111.




5 - Question

Which of the timer can operate in the 16 bit condition?
a) timer0
b) timer1
c) timer2
d) all of the mentioned

View Answer

Answer: b
Explanation: Timer0 and Timer2 can operate in the 8 bit condition while only Timer 1 operates in the 16 bit condition.




6 - Question

Which of the following will generate the maximum time delay?
a) f/2
b) f/4
c) f/16
d) f/32

View Answer

Answer: d
Explanation: f/32 has the lowest frequency as it is divided by the maximum value of the constant, so as time and frequency are inversely related to each other so this will generate the maximum amount of machine cycle which will as a result generate the greatest delay.




7 - Question

What is the difference in the operation of a normal and a CTC mode of a timer?
a) in CTC mode PWM is used
b) here serial timer is monitored
c) in CTC mode, timer counts up until contents of TCNT register becomes equal to the contents of OCR
d) none of the mentioned

View Answer

Answer: c
Explanation: In CTC mode, timer counts up until the contents of TCNT register becomes equal to the contents of OCR; then the timer will be cleared and the OCF0 flag will be set when the next clock occurs. In Normal mode, timer counts until max i.e. 0xFFH. When it rolls over from 0xFFH to 0x00H, it sets TOV(Timer Overflow).




8 - Question

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

View Answer

Answer: a
Explanation: A counter can count pulses on the positive or the negative edge of the clock.




9 - Question

Which pin is used for the input clock of the counter0?
a) PORTB.0
b) PORTB.1
c) PORTB.2
d) PORTB.3

View Answer

Answer: a
Explanation: In ATmega32/16, T0 is the alternative function of PORTB.0. T0 is Timer/Counter 0 External Clock Input.




10 - Question

Which resource provides the clock pulse to AVR timers if CS02-00=6?
a) internal clock of the AVR
b) external clock of the AVR
c) none of the mentioned
d) all of the mentioned

View Answer

Answer: b
Explanation: The External clock is used for providing the pulse to the AVR timers if CS02-00=6.

Get weekly updates about new MCQs and other posts by joining 18000+ community of active learners