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.
Solved! Go to Solution.
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:
you can try it now!
I wish it helps you!
Best regards!
Jing
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:
you can try it now!
I wish it helps you!
Best regards!
Jing
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
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
Picture2:with about 10 us deadtime
Wish my answer helps you!
If you still have question, please contact with me!
Thank you and best regards!
Jing
Hi Jing, thank you very much for the example, it is very useful.
I greatly appreciate your help.
Best Regards,
Juan
Hi Juan,
No thanks, you are welcome!
Best regards!
Jing
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