Other Parts Discussed in Thread: HALCOGEN, TMS570LS1224
Hi;
I'm setting up an N2HET pin on a TMS570LS1224 platform, using the ECNT feature. I'm just using the HalCoGen generated edgeResetCounter() and edgeGetCounter() APIs that access the pre-generated ECNT program. See the code snippet at the bottom of this post for the ECNT code from het.c.
The VCLK2 is set to 80MHz and with an HR prescalar of 0, the HR clock is also running at 80MHz. Using a function generator, I am able to measure input signals up to ~700kHz very accurately. But that seems to be the break point, for any input signal over 700kHz results in a lower count, with the ECNT routine clearly missing edges.
I can't find anything in the TRM or otherwise that would indicate what the upper bound on the ECNT measurement would be, or a way to increase this "resolution". I am not running anything else of note on the processor, all tasks are set to run idle loops while I was performing this experiment.
What is the upper limit on the ECNT measurement frequency? If it is higher than 700kHz, how can I increase the performance of the ECNT, or otherwise use the N2HET functionality to measure input frequencies higher than 700kHz?
Thanks in advance,
Joe Shidle
----- ECNT code from HalCoGen het.c below ----
/* ECNT: CCU Edge 0
* - Instruction = 17
* - Next instruction = 18
* - Conditional next instruction = 18
* - Interrupt = 17
* - Pin = 4
*/
{
/* Program */
0x00025440U,
/* Control */
(0x00024007U | (4U << 8U) | (2U << 4U)),
/* Data */
0x00000000U,
/* Reserved */
0x00000000U
},