Timer interrupt using FTM

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

Timer interrupt using FTM

4,322 次查看
KKumar
Contributor II

Hi,

i wanted to configure FTM0 Channel 0 to interrupt(FTM_ch0_ch1_IRQHandler) on every 1 sec whenever FTM_COUNTER VALUE matches with CnV. FTM0 is configured to Free Running counter.

FTM0_Ovf_Reload_IRQHandler is working well.

(FTM_ch0_ch1_IRQHandler) is not working.

But somehow interrupt is not working. I have attached the program file.

External clock : 12 Mhz

SOSC_DIV1 and SOSC_DIV2 : 6 Mhz

CHIE = 1

TOIE = 1

Please verify and tell me what wrong i am doing here.

0 项奖励
回复
3 回复数

4,286 次查看
KKumar
Contributor II

Thanks Robin for the Reply

But I wanted to disable the MCU pins for FTM means (ELSB:ELSA = 0:0).

And for Output compare ELSB:ELSA = 0:1/1:0/1:1

Is it possible for disable pins while FTM is in Output Compare mode AND  use mcu pins as GPIO??

0 项奖励
回复

4,263 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Have you try this: 47.5.33 External Control of Channels Output

47.5.33 External Control of Channels Output.png

0 项奖励
回复

4,291 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi KKumar,

According to the description in "47.4.3.6 Channel (n) Value (C0V - C7V)" of S32K1xx MCU Family - Reference Manual, CnV should be wrote when the channel in output mode. But according to your codes and "Table 47-5. Channel Modes Selection", seems that channel 0 is not configured as output mode. So during debug you may find that the FTM0_C0V is always 0.

47.4.3.6 Channel (n) Value (C0V - C7V).png

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复