K10 and PWM input

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K10 and PWM input

1,105 Views
mehrdad_ostovar
Contributor I

Hi,

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?

Thanks

Labels (1)
Tags (1)
0 Kudos
Reply
4 Replies

962 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hello Mehrdad,

 

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.

 

Regards,

Sebastian

0 Kudos
Reply

962 Views
mehrdad_ostovar
Contributor I

Hi,

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?

Thanks

0 Kudos
Reply

962 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hello Mehrdad,

 

For an example on how to measure PWM duty cycle, could you please Chapter 35, section 4 of the K10 Reference Manual here.

 

Regards,

Sebastian

0 Kudos
Reply

962 Views
mjbcswitzerland
Specialist V

Hi

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.

http://www.utasker.com/docs/uTasker/uTaskerHWTimers.PDF

Regards

Mark

Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.html
Kinetis 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

0 Kudos
Reply