Hi everyone. Here's my problem. I have zero crossing detector circuit that sends a 50Hz PWM to my timer D capture module (DSP56f807). I am using the timer1 pin as the input pin. I want to detect this PWM on the rising edge and this will start a timer. On the second rising edge the timer must stop. I want to retrieve this value and use it to determine the period of the signal. I used the following code in my interrupt service routine to do this:
/* Write your code here ... */
printf("ms - %u\n" , SAMPLES_Current[p]);
I just used the printf to test if it was capturing the time. My problem is the value it reads isn't constant even though the input PWM is constant. Please help!!!! I have included my code.