K10 FTM2 Set/GetOffsetTicks problems

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

K10 FTM2 Set/GetOffsetTicks problems

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

Hi,

the problem is that SetOffsetTicks doesn't work always. Function is called about once a second.

Quite often the new value doesn't go to HW, and readback by GetOffsetTicks returns the previous CnV value.

is there any knwon issue ni HW or PE-generated code?

Does FTM2 write erroneously the earlier value from cache register?

 

Checked the generated C code and disassemble-file, seems to be OK.

CPU revision is 0N96B, errata doesn't mention this kind of problem.

 

Added test counters:

TMR_SetCount[ChannelIdx]++;

TMR_GetCount[ChannelIdx]++;

They show that Set/Get functions are called correctly.

 

~Mark

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,404件の閲覧回数
ProcessorExpert
Senior Contributor III

Hi,

 

The problem is  probably that the register is buffered - that's why you  don't immediatelly read the written value, because you read the current value of the counter not what you wrote. When the register is written, the value is applied after te buffer is synchronized to the counter. It depends on the settings but the register should be synchronized after the end of the period. To force synchronization, it's necessary to disable and enable the timer again.

 

best regards
Petr Hradsky
Processor Expert Support Team

 

 

元の投稿で解決策を見る

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

Hi,

 

The problem is  probably that the register is buffered - that's why you  don't immediatelly read the written value, because you read the current value of the counter not what you wrote. When the register is written, the value is applied after te buffer is synchronized to the counter. It depends on the settings but the register should be synchronized after the end of the period. To force synchronization, it's necessary to disable and enable the timer again.

 

best regards
Petr Hradsky
Processor Expert Support Team

 

 

0 件の賞賛
返信