Question: 5) For the provided C-Code below, assume that it will be Compiled and Downloaded to the PIC16F887 Microcontroller. Given Fosc = 20 MHz. Comment all

5) For the provided C-Code below, assume that it will be Compiled and Downloaded to the PIC16F887 Microcontroller. Given Fosc = 20 MHz. Comment all lines of C-Code below marked with comments // and answer the questions that follow: Assume RD0 is Connected to an LED.

Unsigned int ms = 0; //

Void main()

TRISD0 = 0; //

T2CKPS0 = 1; //

T2CKPS1 = 0; //

TOUTPS0 = 0; //

TOUTPS1 = 0; //

TOUTPS2 = 1; //

TOUTPS3 = 0; //

PR2 = 250; //

TMR2ON = 1; //

if(TMR2IF = = 1) //

{

TMR2IF = 0; //

ms++; //

if(ms > = 1000) //

{

ms = 0; //

RD0 = ?RD0; //

}

}

}

}

Timer2 Prescaler ___________

Timer2 Postscaler __________

PR2 Register Equals _________

Timer2 Counts from __________ to ___________

TMR2IF Flag is set from _____________ operation and increases value of __________ Register.

Inverting of the LED Status at RD0 will occur every _________ sec

Calculate this and show your work:

Each Count Requires ____________ us

Calculate this and show your equations and work:

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