Hello,
I want to use the FTM for 6 channel CPWM output for 3-phase motor control, and on the MK60DN512VLL10 datasheet and reference manual do not show it. Is there any document for me to know How to setting the FTM to generate 6 channel CPWM output?
Regards,
Kenta
已解决! 转到解答。
Hi Kenta,
Please find the application note in the attachments, maybe it is useful to you!
By the way, there has another post:K60 PWM phase? for your reference!
Wish it helps you!
Best regards!
Jing
Hi Kenta,
I create a project base on TWR-K60D100M, and use the PE, choose init_FTM component .
Now in my project, I configure 2 channels, and test OK, you can refer to it, and create the other 4channels.
My configuration is as follows, please find my project from the attachments.
The test result is :
Wish it helps you!
If you still have question, please contact me!
Thank you and best regards!
Jing
Hi Kenta,
About how update the PWM-duty for sine PWM algorithm, please find it in the AN3729 which I already give you!
chapter 3.2 sine wave generation.
By the way, this AN maybe help you too, the link is :
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4429.pdf?fromsite=zh-Hans
Best regards!
Jing
Hi Kenta,
I already try it, the PWM-duty can be changed in the interrupt function. Of course, this method is not work in PWM synchronization.
I don't know how you to update the FTM0_C0V. I use the following code. you can try it!
/* User includes (#include below this line is not maintained by Processor Expert) */
PE_ISR(FTM_OVER)
{
// NOTE: The routine should include actions to clear the appropriate
// interrupt flags.
//
FTM0_SC &= ~FTM_SC_TOF_MASK;
FTM0_C0SC &= ~FTM_CnSC_CHF_MASK ;
FTM0_C1SC &= ~FTM_CnSC_CHF_MASK ;
/* FTM0_C0V: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,VAL=0x05DC */
FTM0_C0V = FTM_CnV_VAL(0x05DC);
/* FTM0_C1V: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,VAL=0x05DC */
FTM0_C1V = FTM_CnV_VAL(0x07D0);
}
In this code, I just change the FTM0_C1V from 1500(0x05DC) to 2000(0x07D0), and the result is as follows, you will find the duty of C1 is changed.
If you still have question, please contact with me!
I wish my answer is useful to you!
Best regards!
Jingjing
hi Jingjing,
Yes, do not work in PWM sync.
I follow your code, and FTM0_C0V is updated.
thank you.
another Question is: I Do not know How to setting K60 after power on reset, immediately Run the code?
please let me know ...
Regards,
Kenta
hi Jingjing,
I found that after I download the code into K60, and power Off the K60 board, then re-power On the K60 board, the K60 do not Run the code.
is this the power On reset setting issue ?
Regards,
Kenta