HCS12 Modulus Register MCCNT won't load

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

HCS12 Modulus Register MCCNT won't load

跳至解决方案
1,249 次查看
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 解答
921 次查看
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 回复
922 次查看
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 项奖励
回复