PWM (FTM0_CHx) support in TWRK60 and MQX

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

PWM (FTM0_CHx) support in TWRK60 and MQX

ソリューションへジャンプ
2,924件の閲覧回数
MarkP_
Contributor V

Hi,

need to generate PWM-output signals (25kHz, 1024 steps) with FTM0_CH0..3.

Is there any example code or support in MQX's BSP or PSP-library.

Does CW's Processor Expert has any PWM component for K60?

Should the PE work in free (code size limited) CW, version is 10.1?

BR,

Mark

0 件の賞賛
返信
1 解決策
1,399件の閲覧回数
Clark
NXP Employee
NXP Employee

HI, 

 

 The FTM_init component will generate a PWM.  However, in user code you have to use: 

 

FTMx_CxV = (unit32_t)0xXXXXUL;

 

to set the pulse width.  PE initializes the FTMx_CxV registers incorrectly before the FTMx_SC register.  I believe that this will be fixed in 10.2

 

Clark

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,400件の閲覧回数
Clark
NXP Employee
NXP Employee

HI, 

 

 The FTM_init component will generate a PWM.  However, in user code you have to use: 

 

FTMx_CxV = (unit32_t)0xXXXXUL;

 

to set the pulse width.  PE initializes the FTMx_CxV registers incorrectly before the FTMx_SC register.  I believe that this will be fixed in 10.2

 

Clark

 

 

0 件の賞賛
返信
1,399件の閲覧回数
ProcessorExpert
Senior Contributor III

Than you for feedback, we have fixed this problem for upcoming CodeWarrior for MCUs V10.2 release.

 

best regards
Petr Hradsky
Processor Expert Support and Servicepacks Team

0 件の賞賛
返信
1,399件の閲覧回数
ProcessorExpert
Senior Contributor III

Hi,

 

You can  use the Processor Expert (PEx) to customize BSP (since MQX version 3.7) that you can use in your MQX aplication.  Into such BSP project, you can add PEx components you need, for examaple you can use TimerUnit_LDD component to provide PWM functionality.


There is already a example BSP project inside MQX 3.7 using Processor Expert for Kinetis TWR-K60 board insed MQX directory ...\Freescale MQX 3.7\mqx\build\cw10\bsp_twrk60n512_pe.
This project contains an example of PWM component.
 
Usage of this BSP in application code is demonstrated in pe_demo project in the demo directory: ...\Freescale MQX 3.7\demo\pe_demo.

 I recommend to use these projects as a start otherwise you would need to configure many settings if you like to start from an empty project.

Regarding second question - yes, PEx works also in the free limited CW version.

 

best regards
Petr Hradsky
Processor Expert Support Team

0 件の賞賛
返信