Tool/software: Code Composer Studio
Hi
My experiment platform is TMS320C200 Experiment Kit(Piccolo F28035).
I was using ECAP module to implement a frequency counter.
The way I used to implement it is to capture 4 raising edge,
and used timestamp of cap4 to minus timestamp of cap1, than divided it by 3(as 1 cycle ticks).
Finially, divided 60M(system clock) by one cycle ticks to get frequency.
I used a wave generator to get a 20KHz square wave source and also used
oscilloscope to make sure the frequency of source is correct.
But my frequency measure result always lower than real frequency (about 400Hz ).
When I use CPU timer interrupt to make my own 20KHz square wave (toggle GPIO per 25 us), the measure seems to work better. (20013Hz).
But I am hoping to minimize the difference within 5Hz.
Is that ECAP setting wrong or system clock is not accurately enough?



