English
Language : 

MC9S12HZ256 Datasheet, PDF (307/692 Pages) Freescale Semiconductor, Inc – HCS12 Microcontrollers
Chapter 10 Stepper Stall Detector (SSDV1)
Advance Pointer
Initialize SSD
Start Blanking
Using Motor Control module, drive pointer to within 3 full steps of
calibrated zero position.
1. Clear (or set) RCIR; clear (or set) POL; clear (or set) SMS;
2. Set MCZIE; clear MODMC; clear (or set) PRE; set MCEN.
3. Set RTZE; set SDCPU; write ACLKS (select sample frequency).
4. Store threshold value in RAM.
1. Clear MCZIF.
2. Write MDCCNT with blanking time value.
3. Clear ITG; clear (or set) DCOIL; increment (or decrement) STEP for
CCW (or CW) motion.
End of
Blanking? No
Yes
Start Integration
MDCCNT = 0x0000? or MCZIF = 1?
1. Clear MCZIF.
2. Write MDCCNT with integration time value.
3. Set ITG; set DCOIL.
End of
Integration? No
Yes
MDCCNT = 0x0000? or MCZIF = 1?
No
Stall
Detection?
Yes
Disable SSD
ITGACC < Threshold (RAM value)?
1. Clear MCZIF.
2. Clear MCEN.
3. Clear ITG.
4. Clear RTZE; clear SDCPU.
Figure 10-15. Return-to-Zero Flowchart
MC9S12HZ256 Data Sheet, Rev. 2.04
Freescale Semiconductor
307