AnsweredAssumed Answered

STM timer Interrupt on all channels on MPC5748G

Question asked by shweta Raut on Aug 13, 2019
Latest reply on Aug 18, 2019 by shweta Raut

I am implementing STM timers for creating an interrupts.

I am using STM2 timer and using all the 3 channels of STM2 timer .I am generating an interrupt at every 0.1us on STM2_0 and 0.3us on STM2_1 and so on. I am not clearing the count register as the interrupt is triggered.

In ISR definition of each channel I am adding the CMP value of each channel in the existing CMP value.

suppose for STM2_0 I am initializing the CMP register with 0x00000320 and for STM2_1 CMP register with 0x00000960. In ISR definition i am checking for the CMP register value whether its reached maximum value in the multiples of initialized value if its same or more than the threshold value I am again initializing the CMP register with the initial 0x00000320 value for example in case of STM2_0

I am getting an interrupt on both the channels but after time goes the interrupt on both the channels is stopped and once the the CNT register reaches maximum value of 0xFFFFFFFF and rolls back and when it reaches 0x00000320 it will generate an interrupt on STM2_0 channel.

I need a continuous interrupt on all the channels used how this problem can be solved?