Crank up the frequency until the measurement becomes


Pulse-width measurement. Use the input-capture function to measure the pulse width. The procedure is as follows:

Step 1

Set the function generator output to be square wave and adjust the output to between 0 and 5 V. Connect the signal to the PAI (PT7) pin.

Step 2

Connect the signal to an oscilloscope or a frequency counter to verify your measurement.

Step 3

Output the message "Do you want to continue to measure the pulse width? (y/n)".

Step 4

Set up the appropriate period (frequency) of the signal to be measured and enter y or n to inform the microcontroller if you want to continue the measurement.

Step 5

Your program would read in the answer from the user. If the character read in is n, then stop. If the answer is y, then repeat the measurement. If the character is something else, then repeat the same question.

Step 6

Perform the measurement and display the period in μs in decimal format on the screen and go back to step 3. Use as many digits as necessary. The output format should look like

The signal period is xxxxxx microseconds.

Crank up the frequency until the measurement becomes inaccurate. What is the shortest period that you can measure?

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Crank up the frequency until the measurement becomes
Reference No:- TGS01467043

Expected delivery within 24 Hours