FTM input clock source limitation

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

FTM input clock source limitation

1,966 次查看
aroste
Contributor IV

Hi,

I have a K60 and I used until now the internal bus clock for my timing.

I changed to use the FTM_CLKIN1 input as clock source and it works for my timer FTM1.  I have a 10Mhz 0.1ppm clock to generates a 10khz. => OK

Now I want to enable the FTM0 also with the same input clock source but PE doesn't allow me to do that. It says the clock source is already in use.  But I need it as it is the accurate clock source.

I supposed that this clock source can be use by any FTM flex timer

Could someone help with that? 

I wasn't able to find any limitation about that.

BR

-stéphan-

标记 (3)
0 项奖励
回复
4 回复数

1,530 次查看
aroste
Contributor IV

HI Pavel,

Thanks for your answer.  So it means it is an error in PE that causes this error? 

This is annoying since for those timers I use PE to generate my code.

I can maybe set another input, generates the files and correct them manually after that.  It's tricky since I will need to restore my update in case I modify a setting with PE.

BR

stéphan-

0 项奖励
回复

1,530 次查看
pavel_krenek
NXP Employee
NXP Employee

Actually I did not tested in PE but I think you have to set the SIM module via PE and after that should be available the external clock for any of flex timer module.

Regards,

Pavel

0 项奖励
回复

1,530 次查看
aroste
Contributor IV

Hi,

I come late with an answer.

So I finally found the workaround.  I created the timer with PE, and just after the init call I have to set manually the SIM_SOPT4 because PE doesn't handle it properly.

if (EventStruct.Out10Khz_UserDatas.DeviceDatas == NULL) 
{

        printf("FAILED to setup 10khz output!");

_task_block();
}
else 
{
// Missing from PE code generation !!!
/* SIM_SOPT4: FTM1CLKSEL=1 */
SIM_SOPT4 |= SIM_SOPT4_FTM1CLKSEL_MASK;
}
0 项奖励
回复

1,530 次查看
pavel_krenek
NXP Employee
NXP Employee

Hi Stephan,

One external clock source can be used as input clock source for all flextimer modules. It depends only on setting on the register SOPT4. There are two external FTM_CLKINx pins that can be selected by any FTM module via the SOPT4 register in the SIM module.


I hope that help.

Pavel

0 项奖励
回复