Tool/software: Code Composer Studio
Greetings! I have a problem with the moment I`m reading the ADC sygnals. I`m running my PWM at 4kHz and my half period cycles are 6250(12500 full). I have a pin which I turn off when the main interrupt occurs and I drive it high when the values are read. I am doing this because example 4 sygnal chain test doesn`t turn the motor(I have only sound from the motor but no movement). So I`m using CMPC of PWM1 as a trigger of the main interrupt. In the beginning I`ve set this value to 6000. This seems to trigger the interrupt just in middle of the pulse(if duty cycle 50% the moment of switching between channel A and B). I think this causes my problem, because these is a deadtime and there is no transistor open in this moment. So I am trying now to set this trigger moment in the middle of the channel A pulse. In a simple test this happens when I set the CMPC to 10000. The problem is when I add the program logic to the ISR this somehow blocks the interrupt from triggering. I think 10000 a very high value, because I have only 6250 into the counting register. When should my interrupt be triggered? In the middle of the pulse? In the pulse A duration?
Is this approch correct or I need to change something else?
THanks!