Question: Question 4 ( 1 5 Marks ) a . The unfinished program in Figure 3 is to be used to continuously measure the pulse width

Question 4(15 Marks)
a. The unfinished program in Figure 3 is to be used to continuously measure the pulse width of a 50 Hz square wave. The square wave is sent to the input capture pin of the ATMega32. The program uses a prescaler value that gives the pulse width in microsecond (us) using a 16 bits (2 bytes) data type. The lower byte of the result is displayed on PORTA and the upper byte on PORTB. Assuming XTAL \(=8\mathrm{MHz}\) and the timer is operated in normal mode. Complete the program by filling in the missing information wherever a question sign (?) occurs in Figure 3.
```
#include
int main ()
l
unsigned int tl,t2, Period;
DDRD =?; ///1/2 Mark]
DDRA =?; \/1/2 Mark]
DDRB =?; ///1/2 Mark]
TCCR1A =?; //[1/2 Mark]
while(l)
l
TCCR1B =2; //[2 Marks/
while ((TIFR& (l
Question 4 ( 1 5 Marks ) a . The unfinished

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!