HCS12 Modulus Register MCCNT won't load

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

HCS12 Modulus Register MCCNT won't load

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

I'm using a 9S12C32 running 48 MHz with PLL. My application is using the Modulus Module to generate an increasing frequency square wave to accelerate a stepper motor from rest to some operating speed. At each motor step, the MCCNT register is reloaded with a decreasing value and after count down to zero, the MCZF flag bit in MCFLG register is set so the motor output bit can be toggled. The MCZF flag bit fails to be set and I've traced the problem to register MCCNT which won't load.

 

In the application, TFFCA bit in TSCR1 is set, and MCCTL Control register is properly loaded to start the down-counter.

 

The attachment is a short program to test loading and reading the MCCNT register. A uBUG12 printout shows a memory dump (md c000 c010) to verify the program was correctly downloaded to Flash. A register dump (rd) to show registers after the breakpoint (br c012 3f) shows that all registers were correctly loaded except Y which should read FF but is 0000 instead.

 

Possibly there is a failure in register MCCNT, or perhaps there is another explanation.

 

Any help would be greatly appreciated.

ラベル(1)
0 件の賞賛
返信
1 解決策
520件の閲覧回数
kef
Specialist I

Modulus down counter is not available on C32, since S12C family is equipped with TIM timer, which doesn't have modulus down counter. You need ECT timer module (available on S12D, S12XD and others).

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
521件の閲覧回数
kef
Specialist I

Modulus down counter is not available on C32, since S12C family is equipped with TIM timer, which doesn't have modulus down counter. You need ECT timer module (available on S12D, S12XD and others).

0 件の賞賛
返信