You are on page 1of 1

Assignment 4 / Submission Deadline: Friday Dec 12 (Control) Dec 14

(Computer) (Fixed)

Re write Demo 1 code using timer interrupt instead of wait function for delay. The advantage of using
timer is you can delay for exact amount time. This time delay for around 1 second) for all 4 MCUs.

• Check your code in Proteus. Make sure that you have connected a crystal oscillator with
appropriate frequency to All MCUs. Refer their respective datasheet for values of associated
capacitors.

Deliverables and Grading: Same as Assignment 3 (But in Group).

N.B. I will randomly choose few groups to present in class and grade accordingly!

Appendix:
Note that some MCUs may not able to generate 1 second delay just using the timers directly.

E.g. In AT89c51 has 16 bit Timer 0 register -> it counts 216 Timer clock to the maximum

-> 216 * 1µs = 65.536 ms delay to the maximum

In such cases, you need to use some techniques, for instance, write a loop in your ISR corresponding to
the selected timer that counts number times the timer interrupt is requested.

E.g. In AT89c51, you can set Timer0 to delay 10 millisecond and count in ISR for 100 Timer0
interrupt requests before you modify port pins ( 100*10ms= 1 second ).

Manuals for all of the 4 MCUs give sufficient description on how to use their timer modules. Choose the
appropriate section from the content page of the respective manuals and read how timer module
operates.

You might also like