06-13-2006 01:24 PM
06-13-2006 02:21 PM
Is it a factor of 1/2 or 2? Your message said 1/2, but the example you cited represents a factor of 2...
How are you "measuring" the actual frequency? Are you by any chance driving some other task with an internal signal named 'Ctr0InternalOutput'? Though it isn't obvious, that signal will actually produce 2 internal pulses per cycle of the pulse train. The physical output pin toggles its digital state each time the '...InternalOutput' signal pulses. So 2 internal pulses = 1 external pulse cycle.
In such a situation, the physical output pin operates at the requested frequency while the 'InternalOutput' internal signal operates at twice the requested frequency. If your situation is something different, post back with some more details...
-Kevin P.
06-13-2006 02:34 PM
06-14-2006 03:45 PM
Correction to my previous post: I'm not so sure about my comments regarding the difference between Ctr0InternalOutput and Ctr0's output pin. I *think* it depends on some other settings too, such as the property specifying whether to pulse or toggle on terminal count.
Here's a thread with some relevance. I believe that it's *possible" for Ctr0InternalOutput to produce 2 rising edges for every 1 rising edge at Ctr0's output pin, it isn't true all the time. In fact, for pulse generation I (now) believe that by default the internal and external signals will be the same. One needs to purposefully change to "pulse on tc" mode.
I think.
-Kevin P.