Frequency Measurement; Pulse Width Modulation; Pulse & Period Measurement - Conrad C-Control Pro Mega Series Manual

Table of Contents

Advertisement

Timer3 (16 Bit)
Example: Frequency Generation with 10*1,085 µs =10,85 µs Period and 2*1,085µs =2,17 µs Phase Shift
Timer_T3FRQX(10,2,PS_8);

6.19.3 Frequency Measurement

Timer_1 (16Bit) and Timer_3 (16Bit)
frequency. The pulses per second are being counted, the result is then delivered in Hertz units. The
maximum frequency is 64kHz and is yielded by the 16 bit counter. An example for this kind of
frequency measurement can be found under "Demo Programs/FreqMeasurement". By shortening the
measuring time also higher frequencies can be measured. The result has then to be re-calculated
accordingly.

6.19.4 Pulse Width Modulation

There are two independent timers available for pulse width modulation. These are Timer_0 with 8 bit and
Timer_1 with 16 bit. By use of a pulse width modulation Digital-Analog-Converters can be realized very
easily. On the Mega128 Timer_3 can be used additionally.
Timer0 (8 Bit)
Example: Pulse Width Modulation with 138,9 µs Period and 5,42 µs Pulse Width, changed to 10,84 µs
Pulse Width
//
Pulse: 10*542,5 ns = 5,42 µs, Period: 256*542,5 ns = 138,9 µs
Timer_T0PWM(10,PS0_8);
Timer_T0PW(20);
Timer1 (16 Bit)
Example: Pulse Width Modulation with 6,4 ms Period and 1,28 ms Pulse Width Channel A and 640 µs
Pulse Width Channel B
Timer_T1PWMX(10,20,10,PS_1024);
6.19.5 Pulse & Period Measurement
By use of Timer_1 or Timer_3
Here by use of the Input Capture Function (specific register of the Controller) the time between two
signal slopes is measured. This function utilizes the Capture-Interrupt (INT_TIM1CAPT). A pulse is
measured between a rising and the next falling signal edge. A period is measured between two rising
signal edges. Because of the Input Capture Function program delay times will not as an inaccuracy
© 2008 Conrad Electronic
(only
Mega128)
(only
//
Pulse: 20*542,5 ns = 10,84 µs
(only
Mega128) pulse widths and signal periods can be measured.
Mega128) can be used for direct measurement of a
//
Period: 100*69,44 µs = 6,94 ms
//
PulseA: 20*69,44 µs = 1,389 ms
//
PulseB: 10*69,44 µs = 694,4 µs
Libraries
198

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the C-Control Pro Mega Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

C-control pro mega32C-control pro mega128

Table of Contents