I'm using K10 and want to encode PWM-Input. I need to measure the base frequency and the duty cycle. Is there any documentation about that or know anybody where to search for description?
If you want to measure frequency and duty cycle of an input signal you can use the Flex Timer Module (FTM) in Input Capture mode.
You can set an FTM's channel to capture on rising or falling edges and compare both time readings to measure period. As for measuring duty cycle, you can set another flex timer channel to capture on either edge, compare both time readings, and then with your previously calculated frequency you can get the Duty Cycle of the signal.
For further reading, as well as some examples, you can check the K10 Reference Manual Chapter 35.
See chapter 7 of this document for a second method based on port triggered DMA, which allows very accurate high frequency measurements to be made.
Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.htmlKinetis K60/K10:- http://www.utasker.com/kinetis/TWR-K60N512.html- http://www.utasker.com/kinetis/TWR-K60D100M.html- http://www.utasker.com/kinetis/TWR-K60F120M.html- http://www.utasker.com/kinetis/ELZET80_NET-KBED.html- http://www.utasker.com/kinetis/ELZET80_NET-K60.html
I looked at the documentation but I see nowhere PWM Input. I can only select inut capture in both edges and read the counter measure the relation.
Is there any examples?
For an example on how to measure PWM duty cycle, could you please Chapter 35, section 4 of the K10 Reference Manual here.
Retrieving data ...