FlexTimer(FTM) using MQX

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

FlexTimer(FTM) using MQX

Jump to solution
2,028 Views
freescale_sid
Contributor I

Hi,

 

         I am using K60N512 and MQX 3.8. want to use the FlexTimer(FTM) module in Quadrature Decoder Mode. I am suprised to find that there MQX code  twrk60n512 does not even contain the register definition for the Flextimer let alone any example code.

 

Can anyone please let me know how to use the Flextimer module and if someone could provide an example ?

 

As I am looking more into the MQX I am finding it difficult to use with very poor documentation and example codes. I also notice that it takes days for them to reply to your questions and even the activity by freescale on the forums is very slow. I think they should learn from the TI's Stellaris forums.

 

Regards,

Syed

 

0 Kudos
Reply
1 Solution
554 Views
petr_uhlir
NXP Employee
NXP Employee

Hallo Robert,

The FTM is quite complex device which can be used in many different ways. That is the reason why the MQX does not contain driver for it. But the Processor Expert contains FTM driver. It embedded in TimerUnit_LDD component where you have to select FTMx_CNT as Counter. See attached screenshots from PE where FTM is used to generate PWM signal.

 

The other option is to take inspiration and reuse code from some motor control reference design

 

The 3-phase PMSM Vector Control using Quadrature Encoder on Kinetis K40

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=RD3PHASEPMSMVCQE

uses FTM for 3phase PWM generation as well as decoding quadrature signals from encoder.

 

Regards Petr

View solution in original post

0 Kudos
Reply
3 Replies
554 Views
Symbolic
Contributor III

The latest CW 10.2 and MQX 3.8.1 (I don't know when it actually happened, or if it has always been there) incorporates the correct header files (for the K60, anyway) to have all the register defines and the accessors "just be there".

They actually live in MK60F15.h (in my system - which uses the K60F120M tower board).

I just generated an MQX project, and started using the structures and accessors.

My project will be using the FTM module and the eDMA module in conjunction with each other.

0 Kudos
Reply
554 Views
unmannedrussery
Contributor II

I recently came to this same realization - I don't believe there are any off-the-shelf MQX drivers for the Kinetis FTM. I figured I could use Processor Expert to generate some drivers that would work, but it looks like Processor Expert doesn't support the FTM module on my processor either.

 

I've decided just to buckle down and start writing my own MQX FTM drivers from scratch... in theory it shouldn't be that difficult. I'll let you know how it works out and if I have any other insights along the way.

 

Regards,

Robert

0 Kudos
Reply
555 Views
petr_uhlir
NXP Employee
NXP Employee

Hallo Robert,

The FTM is quite complex device which can be used in many different ways. That is the reason why the MQX does not contain driver for it. But the Processor Expert contains FTM driver. It embedded in TimerUnit_LDD component where you have to select FTMx_CNT as Counter. See attached screenshots from PE where FTM is used to generate PWM signal.

 

The other option is to take inspiration and reuse code from some motor control reference design

 

The 3-phase PMSM Vector Control using Quadrature Encoder on Kinetis K40

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=RD3PHASEPMSMVCQE

uses FTM for 3phase PWM generation as well as decoding quadrature signals from encoder.

 

Regards Petr

0 Kudos
Reply