DSPRelated.com
Forums

Question on Quad Timer

Started by praveen July 6, 2004
Hi All Anyone Know how the calculation is done in the case of a quad timer.

I am using DSP56f801, the IP bus is configured at 40 Mhz.

const qt_sState quadParam0=
{
/* Mode = */ qtCount,
/* InputSource = */ qtPrescalerDiv128,
/* InputPolarity = */ qtNormal,
/* SecondaryInputSource = */ 0,

/* CountFrequency = */ qtOnce,
/* CountLength = */ qtUntilCompare,
/* CountDirection = */ qtDown,

/* OutputMode = */ qtAssertWhileActive,
/* OutputPolarity = */ qtNormal,
/* OutputDisabled = */ 1,

/* Master = */ 0,
/* OutputOnMaster = */ 0,
/* CoChannelInitialize = */ 0,
/* AssertWhenForced = */ 0,

/* CaptureMode = */ qtDisabled,

/* CompareValue1 = */ 0x8000,
/* CompareValue2 = */ 0,
/* InitialLoadValue = */ 0xFFFF,

/* CallbackOnCompare = */ { CallBackOnCompare0, 0 },
/* CallbackOnOverflow = */ { 0, 0 },
/* CallbackOnInputEdge = */ { 0, 0 }}

I like to know what will be the time interval with which the
callback functions will be called if i use the above configuration.

Please give the formula for calculation.

Thanks
Praveen



RE: [motoroladsp] Question on Quad Timer

for the 56F8xx family, it might be: (65535 - 0) * 128 * 25 = nanoseconds, or 209.712 milliseconds from the time that the counter is enabled.

Add to that, context save time, and interrupt latency.

25ns = period for 40MhzCounting.
128 = prescaler.
65535 = preload value.
0 = compare value (compare register 2 for count down operation).

Jerry.

> -----Original Message-----
> From: praveen [mailto:p...@yahoo.co.in]
> Sent: Tuesday, July 06, 2004 3:46 PM
> To: m...@yahoogroups.com
> Subject: [motoroladsp] Question on Quad Timer
>
>
> Hi All
>
>
> Anyone Know  how the calculation is done in the case of a quad timer.
>
> I am using DSP56f801, the IP bus is configured at 40 Mhz.
>
> const qt_sState quadParam0=
>                             {
>  /* Mode = */                       qtCount,
>     /* InputSource = */             qtPrescalerDiv128,
>     /* InputPolarity = */           qtNormal,
>     /* SecondaryInputSource = */    0,
>
>     /* CountFrequency = */          qtOnce,
>     /* CountLength = */             qtUntilCompare,
>     /* CountDirection = */          qtDown,
>
>     /* OutputMode = */              qtAssertWhileActive,
>     /* OutputPolarity = */          qtNormal,
>     /* OutputDisabled = */          1,
>
>     /* Master = */                  0,
>     /* OutputOnMaster = */          0,
>     /* CoChannelInitialize = */     0,
>     /* AssertWhenForced = */        0,
>
>     /* CaptureMode = */             qtDisabled,
>
>     /* CompareValue1 = */           0x8000,
>     /* CompareValue2 = */           0,
>     /* InitialLoadValue = */        0xFFFF,
>
>     /* CallbackOnCompare = */       { CallBackOnCompare0, 0 },
>     /* CallbackOnOverflow = */      { 0, 0 },
>     /* CallbackOnInputEdge = */     { 0, 0 }}
>
> I  like to know what will be the time interval with which the
> callback functions will be called if i use the above configuration.
>
>  Please give the formula for calculation.
>
> Thanks
> Praveen 
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/PNArlB/TM
> --------------------------
> ------~->
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only
> the author of this message will receive your answer.  You
> need to do a "reply all" if you want your answer to be
> distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:  m...@yahoogroups.com
>
> To Post:  m...@yahoogroups.com
>
> To Leave: m...@yahoogroups.com
>
> Archives: http://www.yahoogroups.com/group/motoroladsp
>
> More Groups: http://www.dsprelated.com/groups.php3

> Yahoo! Groups Links
>
>

>
>
> ______________________________________________________________
> __________
> This email has been scanned for all viruses by the MessageLabs SkyScan
> service. For more information visit http://www.messagelabs.com
> ______________________________________________________________
> __________
>


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
________________________________________________________________________
You take the IPbus and divide by the prescaler to get the timer period.
 
Then, you look at the mode to find out how many ticks between interrupts. Generally it this is equal to the compare value minus the load value. This can be a little tricky for PWM modes and such. There are 2 compare values for some modes.
 
Hope this helps.
Howard
-----Original Message-----
From: praveen [mailto:p...@yahoo.co.in]
Sent: Tuesday, July 06, 2004 4:46 PM
To: m...@yahoogroups.com
Subject: [motoroladsp] Question on Quad Timer

Hi AllAnyone Know  how the calculation is done in the case of a quad timer.

I am using DSP56f801, the IP bus is configured at 40 Mhz.

const qt_sState quadParam0=
                            {
/* Mode = */                       qtCount,
    /* InputSource = */             qtPrescalerDiv128,
    /* InputPolarity = */           qtNormal,
    /* SecondaryInputSource = */    0,

    /* CountFrequency = */          qtOnce,
    /* CountLength = */             qtUntilCompare,
    /* CountDirection = */          qtDown,

    /* OutputMode = */              qtAssertWhileActive,
    /* OutputPolarity = */          qtNormal,
    /* OutputDisabled = */          1,

    /* Master = */                  0,
    /* OutputOnMaster = */          0,
    /* CoChannelInitialize = */     0,
    /* AssertWhenForced = */        0,

    /* CaptureMode = */             qtDisabled,

    /* CompareValue1 = */           0x8000,
    /* CompareValue2 = */           0,
    /* InitialLoadValue = */        0xFFFF,

    /* CallbackOnCompare = */       { CallBackOnCompare0, 0 },
    /* CallbackOnOverflow = */      { 0, 0 },
    /* CallbackOnInputEdge = */     { 0, 0 }}

I  like to know what will be the time interval with which the
callback functions will be called if i use the above configuration.

Please give the formula for calculation.

Thanks
Praveen 


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3



Thanks to both of you Then according to the formula the time should be 0.1 sec .But i used
in the following code to switch on /off a LED.

just a skeleton code
void main()

{

// LED drivers declared

// timer drivers declared

count =0
interrupt =TRUE

while(1)
{

if(interrupt = TRUE)
{
switch(count %2)
{

case 0 :off

case 1: true

}
}
}
}

// outside main

call back function declared
{
count = count+1;

}

But the time difference between the LED on /off is around 5 sec.Why
so much difference from 0.1 sec to 5 sec.

Please reply .

Thanks

Praveen --- In , "Ebersman, Howard"
<HEbersman@m...> wrote:
> You take the IPbus and divide by the prescaler to get the timer
period.
>
> Then, you look at the mode to find out how many ticks between
interrupts.
> Generally it this is equal to the compare value minus the load
value. This
> can be a little tricky for PWM modes and such. There are 2 compare
values
> for some modes.
>
> Hope this helps.
> Howard
>
> -----Original Message-----
> From: praveen [mailto:powerarm2001@y...]
> Sent: Tuesday, July 06, 2004 4:46 PM
> To:
> Subject: [motoroladsp] Question on Quad Timer > Hi All > Anyone Know how the calculation is done in the case of a quad
timer.
>
> I am using DSP56f801, the IP bus is configured at 40 Mhz.
>
> const qt_sState quadParam0=
> {
> /* Mode = */ qtCount,
> /* InputSource = */ qtPrescalerDiv128,
> /* InputPolarity = */ qtNormal,
> /* SecondaryInputSource = */ 0,
>
> /* CountFrequency = */ qtOnce,
> /* CountLength = */ qtUntilCompare,
> /* CountDirection = */ qtDown,
>
> /* OutputMode = */ qtAssertWhileActive,
> /* OutputPolarity = */ qtNormal,
> /* OutputDisabled = */ 1,
>
> /* Master = */ 0,
> /* OutputOnMaster = */ 0,
> /* CoChannelInitialize = */ 0,
> /* AssertWhenForced = */ 0,
>
> /* CaptureMode = */ qtDisabled,
>
> /* CompareValue1 = */ 0x8000,
> /* CompareValue2 = */ 0,
> /* InitialLoadValue = */ 0xFFFF,
>
> /* CallbackOnCompare = */ { CallBackOnCompare0, 0 },
> /* CallbackOnOverflow = */ { 0, 0 },
> /* CallbackOnInputEdge = */ { 0, 0 }}
>
> I like to know what will be the time interval with which the
> callback functions will be called if i use the above configuration.
>
> Please give the formula for calculation.
>
> Thanks
> Praveen >
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the
author of
> this message will receive your answer. You need to do a "reply
all" if you
> want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/motoroladsp
> <http://www.yahoogroups.com/group/motoroladsp>
>
> More Groups: http://www.dsprelated.com/groups.php3
> <http://www.dsprelated.com/groups.php3 >
>
<http://us.ard.yahoo.com/SIG97bujej/M)5196.4901138.6071305.300117
6/D=gr
>
oups/S05771855:HM/EXP89233380/A!28215/R=0/SIGse96mf6/*http:
//comp
> anion.yahoo.com> click here
>
> <http://us.adserver.yahoo.com/l?
M)5196.4901138.6071305.3001176/D=groups/S=
> :HM/A!28215/randT0290140 > _____
>
> > .