Use an FTM IC device to set several channels as output compare

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

Use an FTM IC device to set several channels as output compare

跳至解决方案
1,340 次查看
fengjuntian
Contributor I

As described in the title, I created a project on the 144 chip, added an FTM_IC, and successfully configured several Input Capture channels. How to configure the remaining channels as Output Compare?

0 项奖励
1 解答
1,335 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @fengjuntian,

You can add the FTM_OC driver, but you would need to use it with another FTM module as the SDK does not allow using two or more FTM driver on the same FTM module.

The non-SDK FTM example (S32K144_project_FTM) that is available in the S32DS IDE configures OC, IC and PWM channels on FTM0.

 

Regards,

Daniel

在原帖中查看解决方案

0 项奖励
4 回复数
1,336 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @fengjuntian,

You can add the FTM_OC driver, but you would need to use it with another FTM module as the SDK does not allow using two or more FTM driver on the same FTM module.

The non-SDK FTM example (S32K144_project_FTM) that is available in the S32DS IDE configures OC, IC and PWM channels on FTM0.

 

Regards,

Daniel

0 项奖励
1,326 次查看
yfliu
Contributor IV

@danielmartynek 

So it seems that FTM_IC or FTM_OC software module design prevents multi-purpose usage of a FTM device, even though the hardware module allows that?

Do you see any possibility of refactoring the FTM driver software to remove that limitation? Especially can we refactor the ftmMode member as a bitmask type so that multi-purposes can be supported? do you see any hidden difficulties?

 

0 项奖励
1,306 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @yfliu,

Currently, FTM drivers in RTM 4.0.x in S32DS 3.4 accepts PWM and IC but not OC, this is due to concurrent access to the same timer which is hard to manage in this use case.

 

Regards,

Daniel

0 项奖励
1,329 次查看
fengjuntian
Contributor I

 

@danielmartynek ,Thanks!

Input Capture and Output Compare cannot be implemented in the same FTM driver??

I can only do this by configuring registers, is that what you mean?

 

0 项奖励