Reply by Corey, Rick December 30, 20022002-12-30
Hi

My problem is that I get an error ("macro NORMAL_ISR32 redefined config.h
line 1104") when I try to set up a timer IRQ under my control, despite
thinking that I have "turned off" SDK control of timers. (I am using SDK
stationary, and the final project will use SDK SCI drivers, PWM, ADC and
maybe others.)

I'm trying to set up two timers (TMRD2 and TMRD3) on a 56803, but I don't
want to use the SDK timer functions. (A co-worker tried using the SDK
functions and had problems when he tried to exceed some frequency. I think
he could use it for things lasting several milliseconds, but got huge jitter
if he tried faster.)

I don't want any 'time-of-day" timer features or POSIX compatibility or any
overhead.
For now, I'm trying to use the SDK "normal" IRQ dispatcher (as I am for
CANbus IRQs) but no SDK functions.

What would be the "cleanest" way to take back control of IRQ32? One other
developer is using SDK timer functions extensively for slow activities.
He could use some of my functions instead, if we need to disable all SDK
timer activity just to get one IRQ "away from" the SDK. Should I find the
file that contains QTimerSuperISRD2() and modify it? We could afford to
have non-SDK control over this IRQ in all our 803 projects.

If INCLUDE_BUTTON, INCLUDE_IO, or INCLUDE_LED are "dragging in" the
SDK timer functions, I could get them out of the project. We do plan to use
the SDK SCI driver; if that forces us to use SDK timer functions, then we
really do need to include them.

In appconfig.h, I un-defined INCLUDE_QUAD_TIMER and INCLUDE_QUAD_TIMER,
but even so the SDK seems to already have NORMAL_ISR32 defined. I added these lines to the bottom of appconfig.h:

#define GPR_INT_PRIORITY_32 1 // TimerD Channel 2 (IRQ on Compare,
cascaded from TMRD3 rollover)
void ISR_TimerD2( void );
#define NORMAL_ISR_32 ISR_TimerD2 // causes conflict with SDK
"NORMAL_ISR_32"
The only #defines I have explicitly in appconfig.h are:
INCLUDE_BUTTON
INCLUDE_IO
INCLUDE_LED and
INCLUDE_SCI
I assume that one of these must "drag in" the Quad Timers. Just by poking the control and SCR registers, I have two timers counting and
rolling over and cascading the way I want, but when I try to set up an ISR,
I get this error:

"macro NORMAL_ISR32 redefined
config.h line 1104"

which refers to this section of config.h:
#if defined(INCLUDE_USER_TIMER_D_2)
#ifndef INTERRUPT_VECTOR_ADDR_32
#if defined(QT_CALLBACK_D_2_USES_PRAGMA_INTERRUPT)
#define INTERRUPT_VECTOR_ADDR_32
QTimerSuperISRD2
#else
#if (GPR_INT_PRIORITY_32 != 0)
#define NORMAL_ISR_32 QTimerISRD2
#endif
#endif
#endif
#endif Rick Corey, Software Development
DPC Instrument Systems Division, Flanders NJ