MTS2916A DUAL FULL-BRIDGE
STEPPER MOTOR DRIVER
EVALUATION BOARD USER’S GUIDE
Appendix C. Mode Sequence Diagrams
C.1
MTS2916A DUAL FULL-BRIDGE STEPPER MOTOR DRIVER EVALUATION
BOARD FUNCTIONAL FLOWCHART
POWER-UP
Press Mode Switch
Once
Speed Adjust
Twice
Mode 1:
Full-Step
Armed
Press Run Switch
Once
Twice
Three times
Four times
Five times
Mode 1:
Full-Step
Output
V
REF
= 1V
Mode 1:
Full-Step
Output
V
REF
= 2V
Mode 1:
Full-Step
Output
V
REF
= 3V
Mode 1:
Full-Step
Output
V
REF
= 4V
Mode 1:
Full-Step
Output
V
REF
= 5V
Mode 2:
Half-Step
Armed
Press Run Switch
Once
Twice
Three times
Four times
Five times
Mode 2:
Half-Step
Output
V
REF
= 1V
Mode 2:
Half-Step
Output
V
REF
= 2V
Mode 2:
Half-Step
Output
V
REF
= 3V
Mode 2:
Half-Step
Output
V
REF
= 4V
Mode 2:
Half-Step
Output
V
REF
= 5V
Three times
Mode 3:
Modified Half-Step
Armed
Press Run Switch
Once
Twice
Three times
Four times
Five times
Mode 3:
Modified Half-Step
V
Output
REF
= 1V
Mode 3:
Modified Half-Step
V
Output
REF
= 2V
Mode 3:
Modified Half-Step
Output
V
REF
= 3V
Mode 3:
Modified Half-Step
V
Output
REF
= 4V
Mode 3:
Modified Half-Step
V
Output
REF
= 5V
Four times
Mode 4:
Microstep
Armed
Press Run Switch
Once
Five times
Six times
Four times
OFF
Wraps to Mode 1
Twice
Three times
Five times
Mode 4:
Microstep
Output
V
REF
= 1V
Mode 4:
Microstep
Output
V
REF
= 2V
Mode 4:
Microstep
Output
V
REF
= 3V
Mode 4:
Microstep
Output
V
REF
= 4V
Mode 4:
Microstep
Output
V
REF
= 5V
2012-2013 Microchip Technology Inc.
DS50002058B-page 25
MTS2916A Dual Full-Bridge Stepper Motor Driver Evaluation Board User’s Guide
C.2
SINGLE STEPPING EXAMPLE
POWER-UP Speed Adjust
Press Mode Switch
Once
Mode 1:
Full-Step
Armed
Press
Run Switch
Once
Single Stepping example shown for Mode 1.
Single Stepping is available in all four modes.
Mode 1:
Full-Step
Output
Press
Hold Switch
Once
Hold Mode
Press
Run Switch
Single-Step
Mode
Every press of the Run switch in Hold mode produces one step
DS50002058B-page 26
2012-2013 Microchip Technology Inc.
Mode Sequence Diagrams
C.3
MTS2916A DUAL FULL-BRIDGE STEPPER MOTOR DRIVER EVALUATION
BOARD SOFTWARE FLOWCHARTS
C.3.1
Main() Mode
ENTRY
Initialization
ReadAD= 1
?
Y
N
SampleADC() SpeedUpdate()
Second = 1
?
Y
N
DoOneSecondTasks()
1/8 Second = 1
?
Y
N
ScanSwitches()
ReadADC = 0
Second = 0
EigthSecond = 0
2012-2013 Microchip Technology Inc.
DS50002058B-page 27
MTS2916A Dual Full-Bridge Stepper Motor Driver Evaluation Board User’s Guide
C.3.2
Interrupt() Mode
ENTRY
Timer 0?
Y
N
8HZ?
N
Y EighthSecond=1
ReadADC = 1
1HZ?
N
Y
Second = 1
Timer 1?
Y
N
Stop?
N
Y
Update Stepper
Driver Port B
Hold?
Y
N
StepMode?
Y
N
DirectionBit?
Y
N
Decrement
Rotation State
Increment Rotation
State
A
FIGURE C-1: Interrupt() Mode.
B
DS50002058B-page 28
C
2012-2013 Microchip Technology Inc.
A
Mode Sequence Diagrams
C B
RunMode?
DirectionBit?
Y
N
Decrement
Rotation State
Increment Rotation
State
OFF
RotationData = STOP
FULL
Switch (Stepmode)
HALF
RotationData = FullStepRotationTable(RotationState)
RotationData = HalfStepRotationTable(RotationState)
F D
FIGURE C-2: Interrupt Mode (Continuation).
2012-2013 Microchip Technology Inc.
DS50002058B-page 29
MTS2916A Dual Full-Bridge Stepper Motor Driver Evaluation Board User’s Guide
F D
MOD HALF
RotationData = ModHalfStepRotationTable(RotationState)
12 STEP
RotationData = TwelveStepRotationTable(RotationState)
WAVE
RotationData = WaveStepRotationTable(RotationState)
Phase1 =
Phase2?
Phase1 Decreasing
Phase2 Increasing
Phase1 Increasing
Phase2 Decreasing
DEFAULT
CurrentReferencePWM1 = WaveStepCurrentRefTable(Phase1)
CurrentReferencePWM2 = WaveStepCurrentRefTable(Phase2)
RotationData = STOP
StepMode = OFF
G E
FIGURE C-3:
DS50002058B-page 30
Interrupt Mode (Continuation).
2012-2013 Microchip Technology Inc.
G
Mode Sequence Diagrams
E
Update Current Reference PWM1 and PWM2 for next interrupt
End ISR
FIGURE C-4: Interrupt Mode (Last).
2012-2013 Microchip Technology Inc.
DS50002058B-page 31
MTS2916A Dual Full-Bridge Stepper Motor Driver Evaluation Board User’s Guide
C.3.3
SampleADC() Mode
ENTRY
Read Selected
A/D Channel
Averaging
Complete?
Y
N
Compute Average.
Reload Average Counter.
Save average into A/D
Channel location.
Select next channel.
DS50002058B-page 32
Return
2012-2013 Microchip Technology Inc.
C.3.4
ReadADCChannel (Channel) Mode
Mode Sequence Diagrams
ENTRY
Set A/D MUX
Channel
Delay for A/D MUX
Select
Start Conversion
Conversion
Complete?
N
Y
Return Result
2012-2013 Microchip Technology Inc.
DS50002058B-page 33
MTS2916A Dual Full-Bridge Stepper Motor Driver Evaluation Board User’s Guide
C.3.5
SpeedUpdate() Mode
ENTRY
SpeedInput
< 65?
Speed = 0
Fault = Speed Low
SpeedInput
< 100?
Speed = 0
Fault = No Fault
SpeedInput
> 950?
Speed = 0
Fault = Speed High
SpeedInput
> 900?
Speed = Max
Fault = No Fault
Calculate Speed
Fault = No Fault
Calculate Rollover
Count
Store new timer reload value
Return (Fault)
DS50002058B-page 34
2012-2013 Microchip Technology Inc.
C.3.6
DoOneSecondTasks() Mode
ENTRY
Mode Sequence Diagrams
Mode Switch
Pressed?
N
Y
Status LED = Fault
Return
2012-2013 Microchip Technology Inc.
DS50002058B-page 35
MTS2916A Dual Full-Bridge Stepper Motor Driver Evaluation Board User’s Guide
C.3.7
ScanSwitches() Mode
ENTRY
Direction Sw
Pressed?
Y
Toggle Direction Bit
Stop = 0
N
Direction Sw
Pressed?
Y
N
DoOneSecondTasks()
Hold Sw
Pressed?
Y
Toggle Hold Bit
StepMode = Hold Bit
Hold Bit Set?
N
Y
StepMode = 0
N
Hold Sw
Pressed?
Y
N
DoOneSecondTasks()
Mode Sw
Pressed
Y
Stop.
Turn Off PWMs.
Increment StepMode.
N
Switch(StepMode)
OFF
RotationData = Stop
H I
FIGURE C-5:
DS50002058B-page 36
ScanSwitches() Mode.
2012-2013 Microchip Technology Inc.
Mode Sequence Diagrams
H I
FULL
RotationData = FullStepRotationTable(0)
HALF
RotationData = HalfStepRotationTable(0)
MOD HALF
RotationData = ModHalfStepRotationTable(0)
Switch (StepMode)
12 STEP
RotationData = TwelveStepRotationTable(0)
WAVE
RotationData = WaveStepRotationTable(0)
DEFAULT
RotationData = STOP
StepMode = OFF
FIGURE C-6:
J K
ScanSwitches() Mode (Continuation).
2012-2013 Microchip Technology Inc.
DS50002058B-page 37
MTS2916A Dual Full-Bridge Stepper Motor Driver Evaluation Board User’s Guide
J K
Display StepMode on LEDs
Mode Sw
Pressed?
Y
N
DoOneSecondTasks()
Update LEDs
FIGURE C-7:
Return
ScanSwitches() Mode (Continuation).
DS50002058B-page 38
2012-2013 Microchip Technology Inc.
NOTES:
Mode Sequence Diagrams
2012-2013 Microchip Technology Inc.
DS50002058B-page 39