AHA!! I got it!
For the sake of completeness, and anyone else that stumbles across this, here's how I did it.
I am using CWv4.5 w/ uBug12x for the Adapt9S12XDP512 MCU from TechArts (nice guys BTW).
Once a workspace is created in CW, open up the 'main.c' file. Add the following, before the 'main' routine:
/* Handlers */
#pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt void DTY_ISR() {
Counter--;
PWMDTY0 = duty[ Counter ];
if( Counter == 0 ) {
Counter = 5;
}
// PWMDTY0 = 0xD0;
PITTF = 0x01;
}
/*
* dummit: dummy interrupt routine
*/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt void dummit(void)
{
//_asm("BGND");
//_asm("RTI");
}
/* Vector Table for S12X */
typedef void (*near tIsrFunc)(void);
const tIsrFunc _vectab[] @0xCF00 = {
(void*)0xFFFF, /* 0xFF00 backdoor key */
(void*)0xFFFF, /* 0xFF02 */
(void*)0xFFFF, /* 0xFF04 */
(void*)0xFFFF, /* 0xFF06 */
(void*)0xFFFF, /* 0xFF08 */
(void*)0xFFFF, /* 0xFF0A */
(void*)0xFFFF, /* 0xFF0C */
(void*)0xFFFE, /* 0xFF0E security */
...
dummit,
DTY_ISR, /* PIT0 */
dummit,
...
// _Startup (don't need it)
};
OK, pause for explanation. It's important to add the first 8 interrupt vectors because the MCU finds the ISR based upon the base address of the vector and the interrupt that occured. In this case, I want to interrupt based on the Periodic Interrupt Timer Channel 0 (PIT0). So when an interrupt occurs, the MCU takes the base address and adds $7A to it (base + offset). So keep the first 8 elements to gaurantee the correct offset to the interrupt service routine.
Finally, add the following line within the 'main' routine, BEFORE calling 'EnableInterrupts':
IVBR = 0xCF;
This sets the base address of the interrupt vector to point to my new interrupt vector. Ah, the brilliance of relocatable vectors. Now Rock 'N' Roll!
As a special note, my real problem stemmed from setting the '_Startup' routine as part of my interrupt vector. This is bad for some reason. Anyone know why, cuz I don't?