DSPRelated.com
Forums

Quad timer initialization to generate interrupt on/off time (CMP1/CMP2)

Started by Nitin Madhukar Yewale September 26, 2002
Hi,
I am using 56F827 for my project. I want to generate pulse of
160Hz and width i.e. on time is 0.0015 seconds. To generate the required
pulse I have initialized "qt_sState" structure In the following manner.
827 Freq is 80Mhz so peripheral freq is 40Mhz.
// 160 Hz Pw = 0.0015
qt_sState quadParam3 = {
/* Mode = */ qtVariableFreqPWM,
/* InputSource = */ qtPrescalerDiv64,
/* InputPolarity = */ qtNormal,
/* SecondaryInputSource = */ 0,

/* CountFrequency = */ qtRepeatedly,
/* CountLength = */ qtUntilCompare,
/* CountDirection = */ qtUp,

/* OutputMode = */ qtToggleUsingAlternateCompare,
/* OutputPolarity = */ qtNormal,
/* OutputDisabled = */ 0,

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

/* CaptureMode = */ qtDisabled,

/* CompareValue1 = Freq*/ 0x0b98,
/* CompareValue2 = PW */ 0x03a9,
/* InitialLoadValue = */ 0x0000,

/* CallbackOnCompare = */ { CallbackOnCompare3, 0 },
/* CallbackOnOverflow = */ { 0, 0 },
/* CallbackOnInputEdge = */ { 0, 0 },
0, //ComparatorValue2;
0, // ComparatorValue1;
qtEnableCompareInterrupt, //InterruptEnable2 : 1;
qtDisableCompareInterrupt, //InterruptEnable1 : 1;
qtNeverPreLoad, //LoadControl2 : 2;
qtNeverPreLoad // LoadControl1 : 2;
};

I want to have interrupt after CMP2 comparison i.e. after on time
completion for that I have initialized qtEnableCompareInterrupt. Corret
me if I am wrong. But just sake of testing I have exchanged the enable
flag but still it is generating the required interrupt after specific
interval neither on nor off interval.
How to configure quadtimer to get the interrupt after on / off
time?Is there any other setting for the same?

Thanks and Regards,
Nitin


**************************Disclaimer********************************************\
******

Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged'
and 'confidential' and intended for use only by the individual or entity to
which it is
addressed. You are notified that any use, copying or dissemination of the
information
contained in the E-MAIL in any manner whatsoever is strictly prohibited.

********************************************************************************\
********



The Quad Timer "Compare" interrupt occurs for either CMP1 or CMP2 in this case.
To get only the CMP2 interrupt, you could connect the Timer output pin to an
edge-sensitive interrupt input (/IRQA, /IRQB, or one of the GPIO pins), and set
it up for a Falling-edge sensitive interrupt.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com
-----Original Message-----
From: Nitin Madhukar Yewale [mailto:]
Sent: Thursday, September 26, 2002 3:38 AM
To: Motoroladsp
Subject: [motoroladsp] Quad timer initialization to generate interrupt
on/off time (CMP1/CMP2) Hi,
I am using 56F827 for my project. I want to generate pulse of
160Hz and width i.e. on time is 0.0015 seconds. To generate the required
pulse I have initialized "qt_sState" structure In the following manner.
827 Freq is 80Mhz so peripheral freq is 40Mhz.
// 160 Hz Pw = 0.0015
qt_sState quadParam3 = {
/* Mode = */ qtVariableFreqPWM,
/* InputSource = */ qtPrescalerDiv64,
/* InputPolarity = */ qtNormal,
/* SecondaryInputSource = */ 0,

/* CountFrequency = */ qtRepeatedly,
/* CountLength = */ qtUntilCompare,
/* CountDirection = */ qtUp,

/* OutputMode = */ qtToggleUsingAlternateCompare,
/* OutputPolarity = */ qtNormal,
/* OutputDisabled = */ 0,

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

/* CaptureMode = */ qtDisabled,

/* CompareValue1 = Freq*/ 0x0b98,
/* CompareValue2 = PW */ 0x03a9,
/* InitialLoadValue = */ 0x0000,

/* CallbackOnCompare = */ { CallbackOnCompare3, 0 },
/* CallbackOnOverflow = */ { 0, 0 },
/* CallbackOnInputEdge = */ { 0, 0 },
0, //ComparatorValue2;
0, // ComparatorValue1;
qtEnableCompareInterrupt, //InterruptEnable2 : 1;
qtDisableCompareInterrupt, //InterruptEnable1 : 1;
qtNeverPreLoad, //LoadControl2 : 2;
qtNeverPreLoad // LoadControl1 : 2;
};

I want to have interrupt after CMP2 comparison i.e. after on time
completion for that I have initialized qtEnableCompareInterrupt. Corret
me if I am wrong. But just sake of testing I have exchanged the enable
flag but still it is generating the required interrupt after specific
interval neither on nor off interval.
How to configure quadtimer to get the interrupt after on / off
time?Is there any other setting for the same?

Thanks and Regards,
Nitin _____________________________________
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

More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/