K60 - How to init FTM and link it to PTA6 | PWN

cancel
Showing results for 
Search instead for 
Did you mean: 

K60 - How to init FTM and link it to PTA6 | PWN

213 Views
Contributor I

Hello,

I have a problem with the whole FTM module and getting it running.

After searching I could not find any working code example on how to activate the FTM0 module and link PTA6 to the module.

Could anyone link me / show me a piece of code, where you initialize the FTM0 module and link it to the PTA6 pin?

All I am trying to do is make an LED "blink" using the PWN signal provided by the K60.

I do not care right now what frequency it would blink at, I just want to get it running.

Thanks in advance!

Dennis

#kinetis-k60#pwm#ftm

Tags (3)
0 Kudos
3 Replies

63 Views
Contributor I

Hi Ricardo,

Thanks a lot for your time and help. I downlaoded the SDK and also tried to run it, it compiled all fine with no errors.

After that I connected an LED to the PTA10 pin, but it did not do anything at all after starting the program in debug mode.

Is there something I am not quiet getting/understanding?

Thanks a log again for your help!

Best Regards,

Dennis

0 Kudos

63 Views
NXP Employee
NXP Employee

Hi Dennis,

 

The SDK examples are tested and ready to use without adding anything. The frequency of the PWM SDK example is 24kHz, which is too high to see the LED response. Please change the frequency to something close to 3kHz. With this frequency you should be able to see the blink of the LED.

 

Do you have an oscilloscope? It could help to see the PWM output.

 

Best Regards,

Ricardo

0 Kudos

63 Views
NXP Employee
NXP Employee

Hello Dennis,

 

Hope you are going well. There are some examples in the SDK. You can download it in this link: SDK Builder. To see a driver example, you need to download it for a kinetis module, in this case the TWR-K60D100M.

 

There is the ftm_simple_pwm driver example, where FTM2_CH0 is configured. In this example the pin is PTA10. You can take this example and change it to your desired pin. In the chapter 10 of the Reference Manual you can see the alt functionality on each pin. If you want to use the FTM in your proposed pin, choose the ALT3 so you can configured the FTM0_CH3.

 

Let me know if you have further questions.

 

Best Regards,

Ricardo

0 Kudos