DSPRelated.com
Forums

Prescaler vs. Counter output pin as the primary source

Started by Hardeep April 5, 2005


Hi,

I am using the DSP56858. This question relates to the Quad Timers.

What is the difference between a prescaler as a primary source and
using a counter ouput pin as a primary source? On Timer3, I am
generating a clock pulse which uses a prescaler as the primary
source and then toggles the OFLAG output on successful compare.
Therefore this timer is creating a continuous square wave pulse(with
50% duty cycle) and inputted into another timer(Timer1) as it's
primary source. So, counter 3 output pin is Timer1's primary source.
Timer1 is supposed to be creating 15 pulses (gated clock), however,
when I look at these on the oscilloscope, they are quite narrow and
do not have a 50% duty cycle. This is the reason why I was using
another timer (Timer3) to produce pulses with 50% duty cycle and
simply count the edges of Timer3 as I would with a regular
prescaler, however, this does not seem to work.

Thank you in advance for your help.

Hardeep




Hi,

I have figured out how to achieve a 50% duty cycle. I still do not
know why my TMR1 was not producing exact square waves. If anyone
else is having a similar problem and would like to know how I got
around this problem, I've explained in the following paragraph.

Instead of using the output of TMR3 as the primary source of TMR1,
it's actually the reversed case. For the primary source of TMR3
field make it "counter 1 output pin". Then for TMR1 primary source,
make it prescaler divide by 2. Also change the compare register1
(TMR1) to 30. Run the code and it TMR3 should produce a 50% duty
cycle. Hardeep
--- In motoroladsp@moto..., "Hardeep" <hgida@i...> wrote:
>
>
> Hi,
>
> I am using the DSP56858. This question relates to the Quad Timers.
>
> What is the difference between a prescaler as a primary source and
> using a counter ouput pin as a primary source? On Timer3, I am
> generating a clock pulse which uses a prescaler as the primary
> source and then toggles the OFLAG output on successful compare.
> Therefore this timer is creating a continuous square wave pulse
(with
> 50% duty cycle) and inputted into another timer(Timer1) as it's
> primary source. So, counter 3 output pin is Timer1's primary
source.
> Timer1 is supposed to be creating 15 pulses (gated clock),
however,
> when I look at these on the oscilloscope, they are quite narrow
and
> do not have a 50% duty cycle. This is the reason why I was using
> another timer (Timer3) to produce pulses with 50% duty cycle and
> simply count the edges of Timer3 as I would with a regular
> prescaler, however, this does not seem to work.
>
> Thank you in advance for your help.
>
> Hardeep