Problem writing to the channel counters in TPM

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

Problem writing to the channel counters in TPM

ソリューションへジャンプ
1,592件の閲覧回数
karthick1987
Contributor II

Hi guys,

 

I was using a GT16A today and I found that when I wrote to the TPM1C0VL and H registers, the values didnt seem to get written the result was rather strange. I monitored the values of the register on the debugger and got '"' 34 . I am not sure why this happens and every time I over write it it still remains the same (the initialised value),

 

What has to be done to change the value every duty cycle?

ラベル(1)
0 件の賞賛
返信
1 解決策
1,068件の閲覧回数
peg
Senior Contributor IV

Hello Karthick,

 

The only limitation here should be the coherency latch mechanism. You need to read and write BOTH bytes every time.

It is also possible to get this "out of step" if you are not writing to TPMxCnSC in between update pairs i.e. you are writing the second byte then the first each update rather than first/second.

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,068件の閲覧回数
karthick1987
Contributor II

in other words

 

how do we over write the counter in PWM mode after every duty cycle?

 

Cheers

Karthick

0 件の賞賛
返信
1,069件の閲覧回数
peg
Senior Contributor IV

Hello Karthick,

 

The only limitation here should be the coherency latch mechanism. You need to read and write BOTH bytes every time.

It is also possible to get this "out of step" if you are not writing to TPMxCnSC in between update pairs i.e. you are writing the second byte then the first each update rather than first/second.

0 件の賞賛
返信
1,068件の閲覧回数
karthick1987
Contributor II

Hi Peg,

 

Thanks but the debugger is bizarre!!! 

 

When you restart code-warrior and try it it works fine! I cannot believe it.

 

So moral of the story, restart the program and try again if you think you have done everything you can and it still dosent work!

 

Cheers

Karthick

0 件の賞賛
返信