Question

Question 4 (20 marks) (a) A Timer 2 block diagram is shown in Fig.7. Timer 2 is used to generate a delay of 50 us. Determine

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:- Since pre-scalar and post-scalar both are 1:1, thus we can use 20/4 MHz = 5 MHz clock directly for the timer. The time period for the timer clock is-

T=\frac{1}{5}\ \mu s

Thus the number of count required is-

50 n = 1/5 = 250

Hence the value to be loaded in PR2 is 250 with TMR2 = 0.

When the TMR2 register count reaches to 250, it gets matched with PR2 register value. At this time, timer2 interrupt flag gets set i.e. TMR2IF is high. This interrupt causes micro-controller to know that 50 us delay has reached.

Add a comment
Know the answer?
Add Answer to:
Question 4 (20 marks) (a) A Timer 2 block diagram is shown in Fig.7. Timer 2...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT