RSIs1() in Processor Expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RSIs1() in Processor Expert

516 Views
aaronlee
Contributor V

Hi,

We are using S12ZVCA & Processor Expert(CodeWarrior 11.0.1). And we are setting RSIs1 to trigger a ISR per 1ms.

How to increase variable "i" per 1ms in main()?

main()

{

   uint16_t   i;

   i++;         // when ISR(RTIs1_Interrupt) is trigger

}

RSIs1.c (Manage by Processor Expert)

/*
** ===================================================================
** Method : RTIs1_Interrupt (component RTIshared)
**
** Description :
** The method services the interrupt of the selected peripheral(s)
** and eventually invokes the components event(s).
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
ISR(RTIs1_Interrupt)
{
TIM1TFLG1 = 0x01U; /* Reset interrupt request flag */
TIM1TC0 += 0xFA00U; /* Add value corresponding with period */

/* Warning: This component is not used by any other component! */

}

#pragma CODE_SEG RTIs1_CODE

/* END RTIs1. */

I have been add code "i++;" to ISR(RTIs1_Interrupt). But "i++;" disappear when i regenerate the PROCESSOR EXPERT CODE.

Do you have any recommend?

Best Regards,

Aaron

Tags (1)
0 Kudos
3 Replies

406 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Aaron,

I would like to apologize for the delay.

I assume you are using RTIshared component.

Can you share your settings of this component?

When I generate code with default settings I can see that there is a counter

RTIs1_Cnt++; in the interrupt routine. I assume you can use it instead of your own variable "i".

#pragma CODE_SEG __NEAR_SEG NON_BANKED
ISR(RTIs1_Interrupt)
{
TIM0TFLG1 = 0x02U; /* Reset interrupt request flag */
RTIs1_Cnt++; /* Increment SW counter RTIs1_Cnt */
if (RTIs1_Cnt == 0xFAU) { /* Is it now the period time? */
RTIs1_Cnt = 0x00U; /* Reset SW counter RTIs1_Cnt */
/* * */
/* Warning: This component is not used by any other component! */
/* * */
}
}

#pragma CODE_SEG RTIs1_CODE

I hope it helps.

Best Regards,

Diana

0 Kudos

406 Views
aaronlee
Contributor V

Hi Diana,

We are using RTIshared component. But I don't know why our ISR(RTIs1_Interrupt) is different from yours.

pastedImage_1.png

Best Regards,

Aaron

0 Kudos

406 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello Aaron,

I attached my project with the same settings as yours in CW 11.1. Could you please check it?

I hope it helps.

Best Regards,

Diana

0 Kudos