Reply by Bruno Tremblay August 7, 20032003-08-07


Hi,

I want to speed up the response of my interrupt on the input 1 of timerA
and after reading the Embedded SDK Programmer's Guide I'm still confuse on
how can I specify this interrupt as Fast or Super Fast. I know with a Super
Fast ISR I must manage the context saving.

I found that the interrupt numbers for the quad timer are from 30 to 45 but
which one is for the Input Edge? And what is the right syntax?

Regards,
Bruno
const qt_sState quadParam0 =
{
/* Mode = */ qtCount,
/* InputSource = */ qtPrescalerDiv1,
/* InputPolarity = */ qtNormal,
/* SecondaryInputSource = */ qtSISCounter1Input,
/* CountFrequency = */ qtRepeatedly,
/* CountLength = */ qtPastCompare,
/* CountDirection = */ qtUp,
/* OutputMode = */ qtAssertWhileActive,
/* OutputPolarity = */ qtNormal,
/* OutputDisabled = */ 1,
/* Master = */ 0,
/* OutputOnMaster = */ 0,
/* CoChannelInitialize = */ 0,
/* AssertWjenFored = */ 0,
/* CaptureMode = */ qtRisingEdge,
/* CompareValue1 = */ 0x0000,
/* CompareValue2 = */ 0x0000,
/* InitialLoadValue = */ 0x0000,
/* CallbackOnCompare = */ {0, 0},
/* CallbackOnOverflow = */ {0, 0},
/* CallbackOnInputEdge = */ {QTimerISR_A1, 0},
};

static void QTimerISR_A1(qt_eCallbackType, void*)
{
MonitReg =
decIoctl(decFD,DEC_READ_MONITOR_REG,NULL,BSP_DEVICE_NAME_DECODER_0);
MonitReg &= 0x0008;
CaptureVal = ioctl(TimerCompare0, QT_READ_CAPTURE_REG, NULL);
DeltaCapture = __sub(CaptureVal, OldCapture);
if (DeltaCapture < 0x0400)
{
if (MonitReg)
{
DCAC_Modulo = DeltaCapture;
}
else
{
DCAC_Modulo = __add(DeltaCapture, 0x0001);
}
}
OldCapture = CaptureVal;
pwmIoctl(pwmBFD, PWM_SET_MODULO, DCAC_Modulo, BSP_DEVICE_NAME_PWM_B);
asm(bfset #$0002,X:$0E20);
} void main (void)
{

***snip
TimerCompare0 = open (BSP_DEVICE_NAME_QUAD_TIMER_A_1, 0,quadParam0);
ioctl (TimerCompare0, QT_ENABLE, (void*)&quadParam0);
ioctl (TimerCompare0, QT_ENABLE_CAPTURE_REG, NULL);
***snip

}