Technical discussions about Freescale (Motorola) DSPs (including the DSP56000, DSP56300, DSP56600, 56800 DSPs).
|
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 |
|
|
|
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.
Jerry. > -----Original Message-----
________________________________________________________________________ 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
|
|
|
|
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 > > > _____________________________________ > /groups.php3 > <http://www.dsprelated.com/groups.php3 > > > Yahoo! Groups Sponsor > > ADVERTISEMENT <http://us.ard.yahoo.com/SIG=1297bujej/M=295196.4901138.6071305.300117 6/D=gr > oups/S=1705771855:HM/EXP=1089233380/A=2128215/R=0/SIG=10se96mf6/*http: //comp > anion.yahoo.com> click here > > <http://us.adserver.yahoo.com/l? M=295196.4901138.6071305.3001176/D=groups/S= > :HM/A=2128215/rand=540290140 > _____ > > > . |