AnsweredAssumed Answered

S12XEP100 RTI ISR Problems

Question asked by Alfred Kronwinkler on Apr 11, 2018
Latest reply on Apr 16, 2018 by lama

Hello community,

 

i am trying to get the RTI to work on my S12XEP100. I am getting the clock from a 8 MHz crystal and i want to run the INT every 1ms. I am Using CodeWarrior IDE 5.9.0.

I read Datasheet and configured the RTI as followed:

 

void RTI_init(void)

{
RTICTL_RTDEC = 1;                     // Decimal or Binary Divider Select Bit (decimal based divider value)

 

//Divider = 8000 (RTI Time = 1ms)
RTICTL_RTR0 = 1;                      // Real Time Interrupt Modulus Counter Select Bit 0
RTICTL_RTR1 = 1;                      // Real Time Interrupt Modulus Counter Select Bit 1
RTICTL_RTR2 = 0;                      // Real Time Interrupt Modulus Counter Select Bit 2
RTICTL_RTR3 = 0;                      // Real Time Interrupt Modulus Counter Select Bit 3
RTICTL_RTR4 = 1;                      // Real Time Interrupt Prescale Rate Select Bit 4
RTICTL_RTR5 = 0;                      // Real Time Interrupt Prescale Rate Select Bit 5
RTICTL_RTR6 = 0;                      // Real Time Interrupt Prescale Rate Select Bit 6

 

CRGINT_RTIE = 1;                      // Real Time Interrupt Enable Bit

EnableInterrupts;

}

 

so far so good... now i am trying to create an ISR for the RTI but this where problems begin....

 

I have searched in S12x examples pack on NXP page how to create an ISR and found an example for creating an ISR for ADT0. Here is what i found:

 

//==============================================================================
// ATD0_ISR
//==============================================================================
#pragma CODE_SEG NON_BANKED
interrupt 22 void ATD0_ISR(void)
{
         //code
}
#pragma CODE_SEG DEFAULT

 

Now the question:

Where can i find the information how i have to change the ATD0_ISR code to get an RTI ISR?

Where can i find the information whitch Nuber i need? (for ADT0 this is 22 but what for RTI?)

Where can i find the information for the ISR Name i need? (for ADT0 this is ATD0_ISR but what for RTI?)

 

Thanx!

Outcomes