Question: 5 . Given PIC 2 4 H running at Fosc = 2 0 MHz with one digital input at RA 1 and one digital output
Given PICH running at Fosc MHz with one digital input at RA and one digital output at RB
a Write a function to configure RA as an input and generate a change notification interrupt CN
b Assume that a clock signal is connected to RA The following code decide whether the clock speed is
faster than kHz or not. If the clock is faster than kHz then set RB to otherwise set RB to
void ISR CNInterruptvoid
CNcounter;
CNIF ;
uint CNcounter;
void main
CNcounter ;
configure;
TCONx;
PR;
LATB;
TIF;
TCONbits.TON;
whileCNcounter
if TIF
LATB;
TIF ;
break;
c Compute the percentage of CPU time taken by the above ISR.
Assume the following:
Each statement consumes one instruction cycle.
The RA input is a clock with a frequency equal to kHz
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
