Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hello all,
i want to capture the frequency of an input sine to synchronize an output frequency.
Therefore i use the CMPSS Module to catch the frequency. I used the follwing Moduls like described:
At CMPIN1P i insert the input Sinewave. DACHVALS is set to the half of the Vpp of the input sinewave. The result of the comparator sets the output CTRIPH asynchronus.
The signal CTRIPH goes through ePWM X-Bar to the PWM-Module.
The signal goes through TRIPIN4 to EVENT A QUAL to the Event Filtering.
There i want to capture the time between 2 Edges with the CNTVAL. This value shall be copied to TBPRD register. I tried to show the issue in an Timing Diagramm:
Until DCAEVT1 everything works like i expected. The DCAEVT1 lasts for 10ms (half sine period of input sine 20ms). I want to count the time when DCAEVT1 is one to synchronize the output PWM with the input frequency. The PWM module uses upcount_downcount_mode.
I tried to catch this time with the Edge Capture Logic. With the SW Trigger i should be able to start the measurement with the next Edge of DCAEVT. Then the counter starts to count until the next Edge. When i read the Register VCNTVAL it is zero. So it was not successfull.
My TBCLK is configured to 200 MHz. That means the counter increases the value every 5 ns. With an increasing time of 10ms (DCAEVT1) the countervalue will be 2000000. But the Timer is only 16-bit (65535 is maximum). When i change the TBCLK to a lower frequency i lose precision in generating the output PWM.
Sorry for the bad description i hope there is any solution for this problem?
Best regards,
Martin



