Download Lab Report: Measuring Signals with Input Capture and PWM using µC/OS-II - Prof. Janos L. G and more Lab Reports Microcomputers in PDF only on Docsity! Laboratory Six Input Capture, Pulse Width Modulation (PWM) and µC/OS-II Objectives: i. To use the Input Capture function of the ECT Module to measure the period time and the pulse width of a digital signal. ii. To use the PWM Module to generate a periodic digital output signal with a programmable duty cycle. iii. To use some of the facilities provided by µC/OS-II. Task One Develop a C program that will take measurements of the pulse width and the period time of a periodic digital input signal. Set up a digital Pulse Generator for a TTL compatible signal of approx. 2 KHz frequency. Verify the signal waveform, frequency, high and low periods using an oscilloscope and make sure that the signal doesn't drop below 0V, and doesn't rise above 4.8V. Record these data for your Lab Report. Then connect the signal through a suitable buffer chip to the Port T pin specified in the Prelab Assignment, or will be determined by your Lab TA. i. Use the input capture function of the 9S12DP512 ECT Module to measure the signal period time, and the width of the high and low periods, respectively. Store the results in memory locations. By using your calculator compare these results to measurements taken by a logic analyzer and explain any differences. Your program should use the corresponding Timer Channel interrupts to accomplish this task. Use a logic analyzer to record the input waveforms for your lab report. ii. Now gradually increase the frequency of the input signal to find that signal frequency at which the system collapses (i.e., your program results become inconsistent with measurements done by the help of a logic analyzer). Use a logic analyzer to capture the input waveforms for your lab report. Task Two Develop a C program to generate a periodic digital output signal using the PWM Module. The selected Port P bit, the duty cycle value and the approximate signal frequency will be given in the Prelab Assignment, or will be determined by your Lab TA. The Port P output signal is to be buffered by a suitable buffer chip. Use a logic analyzer to verify your results and record the waveforms for your lab report. Explain any differences.