I'm working on a project that requires frequency measurement of a square-wave signal. I've set up two timers using Processor Expert Software, the LPTMR running at 32.768 kHz and interrupting every 100 ms.
In the ISR I'm reading the counter register of the second Timer (TPM0_CNT), counting the rising edges of the external square-wave signal.
The counter value multiplied by 10 gives the frequency of the input signal.
With the help von Erichs LCDHTA component I'm "printing" the frequency on an LCD screen. At frequencies up to 300 kHz everything is working as expected, but at higher frequencies the system stop's working:
(working as expected)
(stops working at higher frequencies)
I've no idea why this is happening. Am I doing something wrong? Or is there a better way to count higher frequencies?
I've attached my source files, so you may have a look. Thank you for your help!
Original Attachment has been moved to: FRDM-KL25Z_LCD_Test.zip