Device Initialization generate incorrect code for FlexTimer of Kinetis?

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

Device Initialization generate incorrect code for FlexTimer of Kinetis?

跳至解决方案
1,854 次查看
jilingshu
Contributor I

hi all,

I create a new project with MCU is K60 in CodeWarrior and I choose Device Initialization at final step of that wizard. Then I configure FTM0 to generate PWM in Processor Expert and generated MCUInit.c and MCUInit.h. However, there are no PWM generated, and I read this code snip in MCUInit.c:

SIM_SCGC6 |= 0x01000000UL;                                 /* FTM0_C0SC: ELSB=1 */FTM0_C0SC |= 0x08UL;                                 /* FTM0_C0V: VAL=0x07D0 */FTM0_C0V = 0x07D0UL;                            /* FTM0_FILTER: CH0FVAL=0 */FTM0_FILTER &= (unsigned long int)~0x0FUL;             /* FTM0_MOD: MOD|=0x0FA0 */FTM0_MOD |= 0x0FA0UL;                /* FTM0_SC: CPWMS=1,CLKS|=1 */FTM0_SC |= 0x28UL;

 In fact, FTM0_SC have to be setted BEFORE FTM0_C0SC, or PWM will not be generated.

Is this a bug? Thanks.

标签 (1)
标记 (1)
0 项奖励
1 解答
1,448 次查看
ProcessorExpert
Senior Contributor III

Hello,

CW V10.x has been published on FSL web. You can use the link below to download it:

http://cache.freescale.com/lgfiles/devsuites/MCU/CW_MCU_v10.6_SE_Offline.exe?fpsp=1&WT_TYPE=IDE%20-%...

best regards
Vojtech Filip
Processor Expert Support Team

在原帖中查看解决方案

0 项奖励
3 回复数
1,448 次查看
ProcessorExpert
Senior Contributor III

Hello,

 

yes, you are right, this is know issue in CW V10.1. It has been already fix for CW V10.2. Would be sufficient for you to use the FINAL version of CW V10.2 that should be published within the next week?

 

best regards
Vojtech Filip
Processor Expert Support Team


1,448 次查看
jilingshu
Contributor I

Thx for ur help :smileyhappy:

0 项奖励
1,449 次查看
ProcessorExpert
Senior Contributor III

Hello,

CW V10.x has been published on FSL web. You can use the link below to download it:

http://cache.freescale.com/lgfiles/devsuites/MCU/CW_MCU_v10.6_SE_Offline.exe?fpsp=1&WT_TYPE=IDE%20-%...

best regards
Vojtech Filip
Processor Expert Support Team

0 项奖励