8051 Applications (Pulse Measurement and Multiple Interrupts)
Pulse Measurement Sensors used for industrial and commercial control applications frequenT1y produce pulses that contain information about the quantity sensed. Varying the sensor output frequency, using a constant duty cycle but variable frequency pulses to indicate changes in the measured variable, is most common. Varying the duration of the pulse width, resulting in constant frequency but variable duty cycle, is also used. In this section, we examine programs that deal with both techniques. Measuring Frequency Timers TO and T 1 can be used to measure external frequencies by configuring one timer as a counter and using the second timer to generate a timing interval over which the first can count. The frequency of the counted pulse train is.then Unknown frequency = Counter/timer For example, if the counter counts 200 pulses over an interval of .1 second generated by the timer. the frequency is UF = 200/. 1 = 2000 Hz Certain fundamental limitations govern the range of fre...