
Principles of Operation
35
Period Count
By specifying the period count, you can determine the frequency of the pulse output signal.
Note:
You can also use the period count in event counting operations to determine the value
at which the counter/timer starts counting.
The period count defines the initial value that is loaded into the specified counter/timer.
Values range from 1 to FFFFFFFFh. The counter/timer counts from the period count to
FFFFFFFFh, rolls over to 0 (the terminal count), and then reloads the period count.
Use the following equations to determine the period count when performing pulse output
operations:
•
PeriodCount
= FFF 2 – (clock frequency / output frequency)
For example, if the clock input frequency is 18 MHz and the desired pulse output
frequency is 6.0 MHz, the required
PeriodCount
is FFFFFFFEh.
• #clks per output period = FFF 2 –
PeriodCount
For example, if
PeriodCount
= FFFFFFFEh, three clocks occur for each output period. In
this example, the counter counts FFFFFFFEh, FFFFFFFFh, 0, FFFFFFFEh, FFFFFFFFh, 0,
and so on.
• output period = (# clks per output period) x (clock period)
For example, if three clocks occur for each output period and the clock period is 55.555 ns,
then the output period is 166.666 ns.
• output frequency = 1 / output period
For example, if the output period is 166.666 ns, then the output frequency is 6.0 MHz
Pulse Width Count
The pulse width count determines when the output pulse of the counter/timer is activated.
Values range from 1 to FFFFFFFFh.
Use the following equations to determine the value for the pulse width count:
•
PulseWidthCount
= FFF 1 – (duty cycle x (clock frequency /output frequency))
For example, if the clock input frequency is 18 MHz, the frequency of the output pulse is
6.0 MHz, and the desired duty cycle is .66 (66%), then the required
PulseWidthCount
is
FFFFFFFEh.
• #clks per output pulse = FFF 1 –
PulseWidthCount
For example, if
PulseWidthCount
= FFFFFFFEh, two clocks occur for each output pulse. In
this example, the output is active for counts FFFFFFFFh and 0.
• output pulse width = (#clks per output pulse) x (clock period)
For example, if the clock period is 55.55 ns and two clock occur for each output pulse, then
the output pulse width is 111.11 ns.
Summary of Contents for DT9840 Series
Page 1: ...DT9840 Series UM 19197 T User s Manual Title Page ...
Page 4: ......
Page 44: ...Chapter 1 44 ...
Page 76: ...Chapter 2 76 ...
Page 98: ...Appendix A 98 ...
Page 124: ...Appendix B 124 ...