measure frequency using counter and timer | Cypress Semiconductor
measure frequency using counter and timer
Hello, in new to psoc 5 developing.
I am having some accuracy problems that I would like some input on.
Basically the project im working on, Im using a PWM with a clock of 24MHz and I specify the period using the pot on the device, and an ADC with res 16 bit.
The period I give is between 1 and 24000 so that it generates frequcies between 1kHz and 12MHz
and i convert my adc reading into this range.
I want to calculate this frequency that i speicify using a timer and counter and compare them with some accuracy.
I have 2 isr's, the first one reads the value off the counter and resets it.
the second lets the counter keep running, saving the old value, and subtracts the new value to get the offset.
basically it will make way more sense if you check out the design
Ill upload my design so u can check it out.
the main problem is that the accuacy of the timer counter calculated frequcny is off and Im not sure why.
espically isr#2 is horrible inaccurate