HCS12 Modulus Register MCCNT won't load

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HCS12 Modulus Register MCCNT won't load

Jump to solution
688 Views
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.

Labels (1)
0 Kudos
1 Solution
360 Views
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).

View solution in original post

0 Kudos
1 Reply
361 Views
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 Kudos