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?
Thanks!
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!
-----------------------------------------------------------------------------------------------------------------------
Thanks Radek,
It works.
Best wish!
Hi Frank,
Thank you for your note.
I am glad that it works now.
Radek