S12ZVML Timer0 Interrupt priority

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

S12ZVML Timer0 Interrupt priority

567 Views
frankkong
Contributor III

Now ,I have a problem. 

I use the interrupt of Timer0 IOC0 (vector address 0x1CC)and IOC3(vector address 0x1C0). IOC3 is for input capture and IOC0 for output compare. The timer base frequency is 200K.  The problem is when I set the different priority it will meet some problem. If I set the same priority it works well. You can see the problem below:

 TIM0TC3 += 500 , cause the problem. What can I do?

   

timer init.pngIOC0 interrupt.pngIOC3 interrupt.png中断优先级.pngTIME0TC3.png

Thanks!

Tags (1)
0 Kudos
3 Replies

383 Views
RadekS
NXP Employee
NXP Employee

Hi Frank,

Just fast hint:

Please do not use commands like TIM0TFLG1_C0F = 1; for flag clearing. This command is translated as read-modify-write command and therefore it will clear all pending interrupt flags instead of only one of them.

Please use commands like TIM0TFLG1 = TIM0TFLG1_C0F_MAP; or TIM0TFLG1 = 0x01; for clearing one flag in your ISR. 

For more details please check our application note AN2554 Clearing and Disabling Interrupt Flags

http://www.nxp.com/files/microcontrollers/doc/app_note/AN2554.pdf


I hope it helps you

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

383 Views
frankkong
Contributor III

Thanks Radek,

  It works.

Best wish!

0 Kudos

383 Views
RadekS
NXP Employee
NXP Employee

Hi Frank,

Thank you for your note.

I am glad that it works now.

Radek

0 Kudos