13.07.2015 Views

Data Acquisition

Data Acquisition

Data Acquisition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

When a counter is configured to enable counting on the active high level of the gate input,the internal counter starts counting the source input transitions at the next active transition,after the gate input pulse goes high and stops counting at the end of the pulse. The duration ofthe gate input pulse (T pw ) is found by reading the count register contents, determining thenumber of known clock transitions that occurred (N), and multiplying this by the timebetween each active transition of the clock (T S ). In this case, it does not matter whether thecount occurs on the positive or negative going edge of the source input. What is moreimportant is the frequency of the known clock signal applied to the source input. As shown inFigure 5.38, an error can occur in the counting of the clock transitions, depending on whenthe pulse begins and ends in relation to the active edge of the clock input. This error can bealmost two full clock cycles. Clearly, the higher the frequency of the clock signal, the smallerthe counting error will be, and the higher the resolution of the pulse measurement. Care mustalso be taken not to choose too high a frequency clocking source input as the counter mayreach its terminal count before the end of the pulse.Figure 5.38Measuring an unknown pulse widthConsider a 500 kHz clock signal, with a clock period of 2 µs, applied to the source input.As a 16-bit counter can count up to 2 16 –1 = 65,535 transitions of the clock input, themaximum measurable pulse width will be 65,535 * 2 µs = 131 ms. Decreasing the frequencyof the clock input source increases the pulse width that can be measured.Selection of the frequency of the clocking source input is therefore a compromise betweenthe resolution and accuracy required of the measurement and the pulse width that must bemeasured.Measuring an unknown frequencyCounters can also be used to measure the frequency of a periodic square wave, irrespective ofits duty cycle. This is accomplished by applying the unknown signal to the source input of thecounter and counting the number of cycles of the signal during a fixed duration pulse appliedto the gate input. The fixed duration gate input signal can come from an external source orfrom the output of another counter, configured to produce a pulse of the required duration.As was the case for pulse width measurement, the counter is configured to enable countingon the active high level of the gate input. The internal counter starts counting the sourceinput transitions at the next active transition after the gate input pulse goes high and stopscounting at the end of the pulse. The frequency of the signal at the source input, (f S ), is foundby determining the number of signal transitions (N), which occurred and dividing this by theperiod of the fixed duration gate input pulse, T pw . f S = N / T pw . This is shown in Figure 5.39.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!