S32K146 - not match in Output Compare Mode - FTM

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

S32K146 - not match in Output Compare Mode - FTM

ソリューションへジャンプ
848件の閲覧回数
demian91
Contributor III

Hi, I'm trying to start an Output Compare match on the channel 1 with a period of interrupt.

void FTM0_Ch0_Ch1_IRQHandler(void)
{
	if (1==((FTM0->CONTROLS[1].CnSC & FTM_CnSC_CHF_MASK)>>FTM_CnSC_CHF_SHIFT))
	{
		FTM0->CONTROLS[1].CnSC &= ~(FTM_CnSC_CHF_MASK);
		FTM0->CONTROLS[1].CnV = (uint16_t)FTM0->CNT + (uint16_t)1000;
	}
}

When i clear the flag and then write the CnV value, it doesn't works it seems that the value CnV is not loaded. But if invert the sentences setting the CnV value and then clear the flag it works fine.

i cant understand why is a problem to clear the flag before.

タグ(5)
0 件の賞賛
返信
1 解決策
799件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi 

Please refer to 47.4.3.6 Channel (n) Value (C0V - C7V) S32K1xx MCU Family - Reference Manual.
In output modes, writes to the CnV register are done on its write buffer. The CnV register is updated with its write buffer value according to Registers updated from write buffers.
If FTMEN = 0, a write to CnSC register resets manually this write coherency mechanism.

Check the value of FTMEN.
FTM0->CONTROLS[1].CnSC &= ~(FTM_CnSC_CHF_MASK); seems reset the mechanism.

If FTMEN = 0, a write to CnSC register resets manually this write coherency mechanism..jpg


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.
-------------------------------------------------------------------------------

元の投稿で解決策を見る

1 返信
800件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi 

Please refer to 47.4.3.6 Channel (n) Value (C0V - C7V) S32K1xx MCU Family - Reference Manual.
In output modes, writes to the CnV register are done on its write buffer. The CnV register is updated with its write buffer value according to Registers updated from write buffers.
If FTMEN = 0, a write to CnSC register resets manually this write coherency mechanism.

Check the value of FTMEN.
FTM0->CONTROLS[1].CnSC &= ~(FTM_CnSC_CHF_MASK); seems reset the mechanism.

If FTMEN = 0, a write to CnSC register resets manually this write coherency mechanism..jpg


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.
-------------------------------------------------------------------------------