Using FlexTimer Module with Kinetis K70...

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using FlexTimer Module with Kinetis K70...

跳至解决方案
2,441 次查看
juannava
Contributor II

I'm working with the TWR-K70F120M and Processor Expert, trying to generate a PWM signal in Complementary Mode with Dead-Time insertion but I don't see how to do it in PE, it just let me use two channels (n and n+1) independently but not in Combine Mode, so I modified (manually) the generated file (PWM.c) as indicated in the reference manual, but it doesn't work anyway. Does anyone know how to configure the FTM to operate in this mode?

Thanks in advance.

标签 (1)
标记 (4)
1 解答
897 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Juan Nava,

      You can use the init_FTM component, in this component, you can set up the combine mode and dead-time like following:

pastedImage_0.png

      you can try it now!

     I wish it helps you!

Best regards!

Jing

在原帖中查看解决方案

6 回复数
898 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Juan Nava,

      You can use the init_FTM component, in this component, you can set up the combine mode and dead-time like following:

pastedImage_0.png

      you can try it now!

     I wish it helps you!

Best regards!

Jing

897 次查看
juannava
Contributor II

Thank you very much Jing, that's exactly what I was looking for, but I had a problem using this component because it seems to get stuck in its "init" function (FTM_Init()), so I debugged this function and found that after writting or reading to/from FTMx_SC register, the code jumps to the "Unhandled int code" of the debugger (in Cpu.c) which is as follows:

PE_ISR(Cpu_Interrupt)

{

  /* This code can be changed using the CPU component property "Build Options / Unhandled int code" */

  PE_DEBUGHALT();

}

so I tried to disable it as indicated in comments but nothing changed.

Do you know what is going on? because is the first time I work with freescale and its environment.

Also, I don't know either if this component should replace the PWM_LDD because only has the "init" method, so how can I control the PWM in runtime?

Thanks in advance

Kind regards,

Juan

0 项奖励
897 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Juan,

   

       I create a project, and test it ok, it use the Init_FTM component, and configure the FTM0_CH0 and FTM0_CH1 in combine mode, make the deadtime to about 10us.

       Please find my project in the attachments, it is based on the TWR-K70F120M.

       The test result as follows:

  Picture1:with no deadtime

pastedImage_0.png

  Picture2:with about 10 us deadtime

pastedImage_1.png

Wish my answer helps you!

If you still have question, please contact with me!

Thank you and best regards!

Jing

897 次查看
juannava
Contributor II

Hi Jing, thank you very much for the example, it is very useful.

I greatly appreciate your help.

Best Regards,

Juan

0 项奖励
897 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Juan,

     No thanks, you are welcome!

Best regards!

Jing

0 项奖励
897 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Juan Nava,

      I will create a project on the basis of your expect as soon as possible, and give you for your reference.

      Please wait patiently! Thank you !

Best regards!

Jing

0 项奖励