Question: A PIC18 microcontroller is connected to a 4 MHz crystal. This microcontroller is programmed to operate in timer interrupt mode. Based on the information

 A PIC18 microcontroller is connected to a 4 MHz crystal. This microcontroller 

A PIC18 microcontroller is connected to a 4 MHz crystal. This microcontroller is programmed to operate in timer interrupt mode. Based on the information given, answer the following questions: (a) (b) (c) (d) List two differences between Timer 0 and Timer 2 in PIC18F4550. [4 marks] Determine the maximum possible delay to set the interrupt flag TMR2IF on each cycle for Timer 2. [5 marks] Explain the advantage of using interrupt compared to polling. [4 marks] By using Timer 0 interrupt, write a C program to produce a square wave with a duty cycle of 30% and a period of 25 ms on pin RA4. Note: load 0xF63C into Timer 0 counter register in the interrupt service routine of Timer 0. [7 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Differences between Timer 0 and Timer 2 in PIC18F4550 1 Timer 0 is an 8bit timer while Timer 2 is a 16bit timer 2 Timer 0 can be used as the source ... View full answer

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 Programming Questions!