Sunteți pe pagina 1din 11

6/21/13

Follow us:

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source
ITALIANO SEARCH

Your Electronics Open Source


Share for life!
Home
May 26 2009

Login / Signup di Ionela

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9

This article explains how to design a stepper motor system using an 8-bit Freescale microcontroller - MC68HC11E9.
Categories
ANALOG APPLICATION-NOTE DATABOOK DATASHEET DIY EMBEDDED Electronics Parts FIRMWARE HACK HARDWARE HOMEMADE HowTo LINUX MICROCONTROLLERS NEWS PCB PROGRAMMING PROJECTS REFERENCE DESIGN ROBOTICS STANDARDS TECHNOLOGY TOOLS TUTORIALS V INTAGE

Figure 1 shows basic system operation. R1 provides an analog input to the MCU which is converted to a digital value and used to determine the speed at which the motor turns. In this example, the resistance is being varied manually for the A/D input to the MCU. A feedback scheme from the motor back to the A/D input could be implemented to facilitate a closed loop system.

Basic Stepper Motor Operation To support motor turn direction, one I/O port pin is used to determine clockwise or counter clockwise rotation. The voltage applied to the pin is sampled each time the program cycles through the software routines. A manual switch controls the state of the I/O pin. Green and yellow LEDs illuminate to indicate the turn direction. Hardware Development Motor Description The motor coil assemblies operate at voltage levels ranging from +5 to +24 volts. The
dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9 1/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

motor has a single rotor which is connected to a shaft at the center of the assembly. There are multiple coils surrounding the rotor. A total of 100 steps are required for one complete revolution of the shaft. Each step increments by 3.6. For this application, a wheel is attached to the shaft, but for other applications, the wheel could be replaced by a gear, a pulley, a belt or a timing mechanism. Components The hardware required to control the stepper motor varies significantly from one application to the next. Below is a list of components used to implement the system interfaced to an EVM: 1. One EVM; 2. One stepper motor; 3. One ULN-2075B motor driver IC (optional for enhanced drive); 4. One 25 KW potentiometer (A/D input control); 5. Two SPDT switches (power and CW or CCW turn control); 6. One SPDT switch MOM (position control and single-step); 7. One seven-segment display (display stepper motor delay $0F); 8. One infrared detector and emitter (position control); 9. Seven LEDs (sequence, power and CW or CCW indicators); 10. Two 1-inch square mounting boards for the IR pair; 11. One project assembly board (4-inch x 6-inch); 12. One power terminal strip; 13. Two wirewrap sockets; 14. Four NPN and four PNP transistors (optional for increased motor drive). Assembly Procedures Use the following sequence to assemble the project. 1. Lay out the positions of the various components that are located on the 4-inch x 6inch project assembly board. A board of this size provides ample room for all hardware required to assemble this project. 2. Place the power terminal strip at one end of the project board. Connect +5 volts and ground connections from the EVM to the appropriate power terminal strip connection. An optional power supply can be used to provide increased power for driving the motor. 3. Connect the +5 volts from the power terminal strip to one side of the slide switch. Connect the other side of the slide switch to the main +5 volt power bus for distribution to components on the project board. The main ground bus on the project board also needs to be made available for distribution to the components on the project board. 4. Place the two wirewrap sockets at the opposite end of the project board from the power terminal strip. One socket is for the seven-segment display and the other is for the optional motor driver. 5. A 25 KW potentiometer is used for the analog input to the A/D converter. Connect one side of the potentiometer to +5 volts and the other side to ground. The center tap of the potentiometer is connected to PORTE bit 0 on the MCU. +5 volts is connected to the high reference voltage (VRH) and ground is used to supply the low reference voltage (VRL) MCU inputs. 6. The base portion of the stepper motor being used is a 1.5-inch cube. Place it securely in the center of the project board with the shaft and turning wheel at the top. Align the infrared (IR) emitter and detector to provide the best transmission and detection of the IR signal. Each IR component is mounted on a 1-inch square
dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9 2/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

mounting board to aid with alignment. 7. Connect the emitter to +5 volts so that it continually emits a signal. Connect the detector to the MCU PORTA0 for sampling. The stepper motor has a narrow position bar located on the wheel. As the wheel turns, the position bar passes through the signal being sent and received by the IR pair. 8. The stepper motor has four coil wires that must be connected to MCU PORTC to promote the desired turning motion. PORTC[3:0] are used for this connection. The order of connecting these wires depends on the motor being used. A wiring diagram of the motor simplifies the connection process. The diagram is usually supplied with the motor. 9. Adding the optional ULN-2075B driver significantly enhances the performance of the system by providing increased drive capability. The ULN-2075B IC contains four individual driver circuits. These must be connected from the MCU to the input of the driver and from the output of the driver to the stepper motor coil connections. Another method of increasing the drive current to the stepper motor is to use a pushpull amplifier between each motor coil and PORTC. The amplifier consists of one NPN and one PNP transistor. One side of the amplifier is connected to the optional +12 volts and the other side goes to ground. 10. The PORTC pins are also connected to four LEDs. As the motor turns, the LEDs indicate the sequence of motor coil activations, turn direction and speed of motor turn. 11. Wire the clockwise/counter clockwise slide switch and the respective LED indicators to the MCU. For this application, the switch is connected to PORTD0. One side of the switch is pulled high and the other side is pulled low. One LED is wired to illuminate when PORTD0 is high and the other LED illuminates when PORTD0 is low. 12. Wire MCU PORTB to the seven-segment display. 13. Connect the IRQ line to one side of a momentary switch. Connect the other side to ground. Activation of this switch causes instruction execution to resume after a WAI instruction has been executed. The switch is also used for motor single-stepping. Software Development All software routines for this application are implemented in assembly language. The EVM supports the software routine implementation. P&E Microsystems IASM11 software was used for code development, assembly, debug, and for programming the EEPROM memory. Four PORT C pins are used to drive the inputs to the stepper motor coils. Direct connection from the MCU to the motor is fine for applications that require minimal drive. But for applications that require increased current drive capabilities, enhanced circuits are necessary. One way to increase drive current is to use a motor controller IC designed specifically for that purpose. An example of this device is the ULN2075B driver IC. Each IC contains four individual high-current Darlington switch and driver circuits. One IC satisfies the MCU to the stepper motor interfacing requirements.

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

3/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

Stepper Motor Controller Program Flowchart An infrared (IR) emitter and detector are used to establish proper alignment of the wheel. The motor wheel has an extension connected to its topside. As the wheel turns, the extension breaks the invisible IR beam between the emitter and detector. When this occurs during the very first revolution, the interrupt flag (I) is set, the wheel stops turning and the letter S for STOP is displayed on the seven-segment display. The wheel is now aligned to a known starting point, and the program is waiting for the interrupt to be serviced by the appropriate routine. When the program continues to cycle through the main subroutines, the ALIGN routine is bypassed.

IR Emitter and Detector Stepper Motor Wheel Alignment Listing


0 0 0 01A D C T LE Q U$ 3 0 0 0 0 02P O R T AE Q U$ 0 0 0 0 03P O R T BE Q U$ 4 0 0 0 04P O R T C D RE Q U$ 7 0 0 0 05P O R T CE Q U$ 3 0 0 0 06P O R T D D RE Q U$ 9 0 0 0 07P O R T DE Q U$ 8 0 0 0 08R E S R E GE Q U$ 3 1 0 0 0 09A D O NE Q U$ 3 9 0 0 0 01 0A T E M PR M B1 0 0 0 11 1A T E M P 2R M B1 0 0 0 21 2A T E M P 3R M B1 0 0 0 31 3A T E M P 4R M B1 0 0 0 41 4A T E M P 5R M B1

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

4/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

0 0 0 51 5T I M E RR M B1 0 0 0 61 6C O U N T E RR M B1 0 0 0 71 7F L G I R QR M B1 1 8 C 0 0 01 9O R G$ C 0 0 0 2 0 C 0 0 0B D C 0 1 72 1S T A R TJ S RI N I T; I N I T A L I Z ER O U T I N E C 0 0 3B D C 0 3 42 2N E X TJ S RD I R E C T I O N; D I R E C T I O NR O U T I N E C 0 0 6B D C 0 3 D2 3J S RR E A D A D; R E A DA / DR O U T I N E C 0 0 9B D C 0 4 E2 4J S RC O M S P D; C O M P U T ES P E E DR O U T I N E C 0 0 CB D C 0 5 82 5J S RD I S P L A Y; 7 S E G M E N TD I S P L A YR O U T I N E C 0 0 FB D C 0 D 22 6J S RA L I G N; P O S I T I O NC O N T R O LR O U T I N E C 0 1 2B D C 0 E F2 7J S RT U R N; S T E P P E RM O T O RT U R NR O U T I N E C 0 1 52 0 E C2 8B R AN E X T 2 9 3 0; I N I T A L I Z ER O U T I N E C 0 1 7C E 1 0 0 03 1I N I TL D X# $ 1 0 0 0 C 0 1 A8 6 F F3 2L D A A# $ F F; S E TP O R T CF O RO U T P U T C 0 1 CA 7 0 73 3S T A AP O R T C D R , X; T OT U R NM O T O R C 0 1 E8 6 0 03 4L D A A# $ 0 0; S E TP O R T DF O RI N P U T C 0 2 0A 7 0 93 5S T A AP O R T D D R , X; T OC O N T R O LM O T O RT U R N ; D I R E C T I O N C 0 2 2C 6 0 53 6L D A B# 5; S E TT I M E RF O R#O FT I M E ST O C 0 2 4D 7 0 53 7S T A BT I M E R; A C T I V A T EE A C HC O I L C 0 2 68 6 1 03 8L D A A# 1 0; S E TC O U N T E RF O R#O FS T E P S C 0 2 89 7 0 63 9S T A AC O U N T E R; 2 0=1R E V O L U T I O N C 0 2 A8 6 0 04 0L D A A# $ 0 0; S E TP O R T AF O R C 0 2 CA 7 0 04 1S T A AP O R T A , X; I RE M I T T E RD E T E C T O R C 0 2 E9 7 0 44 2S T A AA T E M P 5 C 0 3 09 7 0 74 3S T A AF L G I R Q C 0 3 20 E4 4C L I C 0 3 33 94 5R T S 4 6 4 7; D I R E C T I O NR O U T I N E-C L O C K W I S EO RC O U N T E RC L O C K W I S E C 0 3 4A 6 0 84 8D I R E C T I O NL D A AP O R T D , X; R E A DB I T0O FP O R T D C 0 3 68 4 0 14 9A N D A# $ 0 1; M A S KP O R T DB I T S1 7 C 0 3 8A 7 0 85 0S T A AP O R T D , X; W R I T ET OP O R T DB I T0F O RC WO RC C W C 0 3 A9 7 0 05 1S T A AA T E M P; S T O R ED I R E C T I O NA TA T E M P C 0 3 C3 95 2R T S 5 3 5 4; S E TU PA / D C T LR E G I S T E R( R E A DV A R I A B L ER E S I S T O R ; T H R O U G HP O R TE ) 5 5 C 0 3 D8 6 9 05 6R E A D A DL D A A# $ 9 0; O P T I O NR E GS E TA / DP W RO N&D E L Y C 0 3 FA 7 3 95 7S T A AA D O N , X; E N A B L E DF O RX T A LS T A B L I Z A T I O N( $ 1 0 3 9 ) C 0 4 18 6 A 05 8L D A A# $ A 0; S E TA / DC O N T R O LW O R DF O RS C A NM O D E C 0 4 3A 7 3 05 9S T A AA D C T L , X; &C O N V E R S I O NC O M P L E T EF L A GS E T( $ 1 0 3 0 ) C 0 4 51 8 C E 0 0 2 66 0L D Y# $ 2 6 C 0 4 91 8 0 96 1D E L A YD E Y C 0 4 B2 6 F C6 2B N ED E L A Y C 0 4 D3 96 3R T S 6 4 6 5; R E A DC O N T E N T SO FT H ER E S U L T

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

5/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

; R E G I S T E RT OC O M P U T ET U R NS P E E D 6 6 C 0 4 EA 6 3 16 7C O M S P DL D A AR E S R E G , X; R E A DR E S U L TR E G I S T E R( $ 1 0 3 1 ) C 0 5 04 36 8C O M A; C O M PS OH I G H#=L O N G E S TD E L A Y C 0 5 14 46 9L S R A; S H I F T' A '4T I M E SF O R0-FC O U N T C 0 5 24 47 0L S R A; S H I F T C 0 5 34 47 1L S R A; S H I F T C 0 5 44 47 2L S R A; S H I F T C 0 5 59 7 0 17 3S T A AA T E M P 2; S T O R ES H I F T E D#A SF I N A LS P E E DC O N T R O L 7 4 C 0 5 73 97 5R T S 7 6 7 7; D I S P L A YS P E E DO N7 S E G M E N TR E A D O U T C 0 5 89 6 0 17 8D I S P L A YL D A AA T E M P 2; R E A DA T E M P 2#T OB ED I S P L A Y E D C 0 5 AB D C 0 6 07 9J S RC O M P D I S; J U M PT OR O U T I N ET OC O M P U T ED I S P L A Y C 0 5 DA 7 0 48 0S T A AP O R T B , X; D I S P L A Y0 FT H R O U G HP O R T B( 7 S E G ) C 0 5 F3 98 1R T S 8 2 C 0 6 08 1 0 08 3C O M P D I SC M P A# $ 0 0; C O M P A R EA=0 C 0 6 22 7 3 E8 4B E QD O W N 0 C 0 6 48 1 0 18 5C M P A# $ 0 1; C O M P A R EA=0 1 C 0 6 62 7 3 D8 6B E QD O W N 1 C 0 6 88 1 0 28 7C M P A# $ 0 2; C O M P A R EA=0 2 C 0 6 A2 7 3 C8 8B E QD O W N 2 C 0 6 C8 1 0 38 9C M P A# $ 0 3; C O M P A R EA=0 3 C 0 6 E2 7 3 B9 0B E QD O W N 3 C 0 7 08 1 0 49 1C M P A# $ 0 4; C O M P A R EA=0 4 C 0 7 22 7 3 A9 2B E QD O W N 4 C 0 7 48 1 0 59 3C M P A# $ 0 5; C O M P A R EA=0 5 C 0 7 62 7 3 99 4B E QD O W N 5 C 0 7 88 1 0 69 5C M P A# $ 0 6; C O M P A R EA=0 6 C 0 7 A2 7 3 89 6B E QD O W N 6 C 0 7 C8 1 0 79 7C M P A# $ 0 7; C O M P A R EA=0 7 C 0 7 E2 7 3 79 8B E QD O W N 7 C 0 8 08 1 0 89 9C M P A# $ 0 8; C O M P A R EA=0 8 C 0 8 22 7 3 61 0 0B E QD O W N 8 C 0 8 48 1 0 91 0 1C M P A# $ 0 9; C O M P A R EA=0 9 C 0 8 62 7 3 51 0 2B E QD O W N 9 C 0 8 88 1 0 A1 0 3C M P A# $ 0 A; C O M P A R EA=0 A C 0 8 A2 7 3 41 0 4B E QD O W N A C 0 8 C8 1 0 B1 0 5C M P A# $ 0 B; C O M P A R EA=0 B C 0 8 E2 7 3 31 0 6B E QD O W N B C 0 9 08 1 0 C1 0 7C M P A# $ 0 C; C O M P A R EA=0 C C 0 9 22 7 3 21 0 8B E QD O W N C C 0 9 48 1 0 D1 0 9C M P A# $ 0 D; C O M P A R EA=0 D C 0 9 62 7 3 11 1 0B E QD O W N D C 0 9 88 1 0 E1 1 1C M P A# $ 0 E; C O M P A R EA=0 E C 0 9 A2 7 3 01 1 2B E QD O W N E C 0 9 C8 1 0 F1 1 3C M P A# $ 0 F; C O M P A R EA=0 F C 0 9 E2 7 2 F1 1 4B E QD O W N F C 0 A 02 0 B E1 1 5B R AC O M P D I S; E N DO FP O L LR O U T I N E 1 1 6 C 0 A 28 6 C 01 1 7D O W N 0L D A A# $ C 0; D I S P L A YV A L U EO N7 S E GD I S P L A YI F

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

6/11

6/21/13
M A T C H ; V A L U E=0

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

C 0 A 43 91 1 8R T S C 0 A 58 6 C F1 1 9D O W N 1L D A A# $ C F; V A L U E=1 C 0 A 73 91 2 0R T S C 0 A 88 6 9 21 2 1D O W N 2L D A A# $ 9 2; V A L U E=2 C 0 A A3 91 2 2R T S C 0 A B8 6 8 61 2 3D O W N 3L D A A# $ 8 6; V A L U E=3 C 0 A D3 91 2 4R T S C 0 A E8 6 8 D1 2 5D O W N 4L D A A# $ 8 D; V A L U E=4 C 0 B 18 6 A 41 2 7D O W N 5L D A A# $ A 4; V A L U E=5 C 0 B 33 91 2 8R T S C 0 B 48 6 A 11 2 9D O W N 6L D A A# $ A 1; V A L U E=6 C 0 B 63 91 3 0R T S C 0 B 78 6 C E1 3 1D O W N 7L D A A# $ C E; V A L U E=7 C 0 B 93 91 3 2R T S C 0 B A8 6 8 01 3 3D O W N 8L D A A# $ 8 0; V A L U E=8 C 0 B C3 91 3 4R T S C 0 B D8 6 8 C1 3 5D O W N 9L D A A# $ 8 C; V A L U E=9 C 0 B F3 91 3 6R T S C 0 C 08 6 8 81 3 7D O W N AL D A A# $ 8 8; V A L U E=A C 0 C 23 91 3 8R T S C 0 C 38 6 8 01 3 9D O W N BL D A A# $ 8 0; V A L U E=B C 0 C 53 91 4 0R T S C 0 C 68 6 F 01 4 1D O W N CL D A A# $ F 0; V A L U E=C C 0 C 83 91 4 2R T S C 0 C 98 6 8 31 4 3D O W N DL D A A# $ 8 3; V A L U E=D C 0 C B3 91 4 4R T S C 0 C C8 6 B 01 4 5D O W N EL D A A# $ B 0; V A L U E=E C 0 C E3 91 4 6R T S C 0 C F8 6 B 81 4 7D O W N FL D A A# $ B 8; V A L U E=F C 0 D 13 91 4 8R T S 1 4 9 1 5 0; A L I G NW H E E LF O RP O S I T I O NC O N T R O LB E T W E E NT H E ; RE M I T T E RA N DD E T E C T O R 1 5 1 C 0 D 2A 6 0 01 5 2A L I G NL D A AP O R T A , X C 0 D 48 4 0 11 5 3A N D A# $ 0 1 C 0 D 68 1 0 01 5 4C M P A# $ 0 0 C 0 D 82 7 0 21 5 5B E QN E X 1 C 0 D A2 6 1 31 5 6B N ET U R N C 0 D C9 6 0 71 5 7N E X 1L D A AF L G I R Q; C H E C KI R QF L A G C 0 D E8 1 0 01 5 8C M P A# $ 0 0 C 0 E 02 7 0 21 5 9B E QW A I T; I F=0G O T OW A I T C 0 E 22 6 0 B1 6 0B N ET U R N; I FN O T=0B R A N C HT OT U R N C 0 E 48 6 A 41 6 1W A I TL D A A# $ A 4; D I S P L A Y' S 'F O RS T O P C 0 E 6A 7 0 41 6 2S T A AP O R T B , X; A TP O R T BA N DW A I TF O R C 0 E 88 6 1 01 6 3L D A A# 1 0 C 0 E A9 7 0 61 6 4S T A AC O U N T E R C 0 E C0 E1 6 5C L I C 0 E D3 E1 6 6W A I; I N T E R R U P TT OB ES E R V I C E D C 0 E E3 91 6 7R T S 1 6 8

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

7/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

1 6 9; S T E P P E RM O T O RT U R NR O U T I N E C 0 E F7 A 0 0 0 61 7 0T U R ND E CC O U N T E R C 0 F 29 6 0 61 7 1L D A AC O U N T E R C 0 F 48 1 0 01 7 2C M P A# 0 0 C 0 F 62 7 0 21 7 3B E QB B C 0 F 82 6 0 71 7 4B N EB B B C 0 F A8 6 1 01 7 5B BL D A A# 1 0 C 0 F C9 7 0 61 7 6S T A AC O U N T E R C 0 F E2 0 0 11 7 7B R AB B B C 1 0 03 91 7 8R T S 1 7 9 C 1 0 19 6 0 01 8 0B B BL D A AA T E M P; G E TS T O R E DD I R E C T I O N C 1 0 32 6 5 31 8 1B N EC C W; I FN O T= ,T U R NC C W C 1 0 52 7 0 01 8 2B E QC W; E L S ET U R NC W 1 8 3 1 8 4; C L O C K W I S ET U R NR O U T I N E C 1 0 7D 6 0 51 8 5C WL D A BT I M E R C 1 0 98 6 0 11 8 6C W 1L D A A# $ 0 1; C O I LV A L U EF O RP O S I T I O N1 C 1 0 BB D C 1 A 91 8 7J S RD E L A Y 1 C 1 0 E5 A1 8 8D E C B C 1 0 F2 6 F 81 8 9B N EC W 1 C 1 1 1D 6 0 51 9 0L D A BT I M E R C 1 1 38 6 0 31 9 1C W 3L D A A# $ 0 3; C O I LV A L U EF O RP O S I T I O N2 C 1 1 5B D C 1 A 91 9 2J S RD E L A Y 1 C 1 1 85 A1 9 3D E C B C 1 1 92 6 F 81 9 4B N EC W 3 C 1 1 BD 6 0 51 9 5L D A BT I M E R C 1 1 D8 6 0 21 9 6C W 2L D A A# $ 0 2; C O I LV A L U EF O RP O S I T I O N3 C 1 1 FB D C 1 A 91 9 7J S RD E L A Y 1 C 1 2 25 A1 9 8D E C B C 1 2 32 6 F 81 9 9B N EC W 2 C 1 2 5D 6 0 52 0 0L D A BT I M E R C 1 2 78 6 0 62 0 1C W 6L D A A# $ 0 6; C O I LV A L U EF O RP O S I T I O N4 C 1 2 9B D C 1 A 92 0 2J S RD E L A Y 1 C 1 2 C5 A2 0 3D E C B C 1 2 D2 6 F 82 0 4B N EC W 6 C 1 2 FD 6 0 52 0 5L D A BT I M E R C 1 3 18 6 0 42 0 6C W 4L D A A# $ 0 4; C O I LV A L U EF O RP O S I T I O N5 C 1 3 3B D C 1 A 92 0 7J S RD E L A Y 1 C 1 3 65 A2 0 8D E C B C 1 3 72 6 F 82 0 9B N EC W 4 C 1 3 9D 6 0 52 1 0L D A BT I M E R C 1 3 B8 6 0 C2 1 1C W CL D A A# $ 0 C; C O I LV A L U EF O RP O S I T I O N6 C 1 3 DB D C 1 A 92 1 2J S RD E L A Y 1 C 1 4 05 A2 1 3D E C B C 1 4 12 6 F 82 1 4B N EC W C C 1 4 3D 6 0 52 1 5L D A BT I M E R C 1 4 58 6 0 82 1 6C W 8L D A A# $ 0 8; C O I LV A L U EF O RP O S I T I O N7 C 1 4 7B D C 1 A 92 1 7J S RD E L A Y 1 C 1 4 A5 A2 1 8D E C B C 1 4 B2 6 F 82 1 9B N EC W 8 C 1 4 DD 6 0 52 2 0L D A BT I M E R C 1 4 F8 6 0 92 2 1C W 9L D A A# $ 0 9; C O I LV A L U EF O RP O S I T I O N8

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

8/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

C 1 5 1B D C 1 A 92 2 2J S RD E L A Y 1 C 1 5 45 A2 2 3D E C B C 1 5 52 6 F 82 2 4B N EC W 9 C 1 5 73 92 2 5R T S 2 2 6 2 2 7; C O U N T E RC L O C K W I S ER O U T I N E C 1 5 8D 6 0 52 2 8C C WL D A BT I M E R C 1 5 A8 6 0 12 2 9C C W 1L D A A# $ 0 1; C O I LV A L U EF O RP O S I T I O N9 C 1 5 CB D C 1 A 92 3 0J S RD E L A Y 1 C 1 5 F5 A2 3 1D E C B C 1 6 02 6 F 82 3 2B N EC C W 1 C 1 6 2D 6 0 52 3 3L D A BT I M E R C 1 6 48 6 0 92 3 4C C W 9L D A A# $ 0 9; C O I LV A L U EF O RP O S I T I O N8 C 1 6 6B D C 1 A 92 3 5J S RD E L A Y 1 C 1 6 95 A2 3 6D E C B C 1 6 A2 6 F 82 3 7B N EC C W 9 C 1 6 CD 6 0 52 3 8L D A BT I M E R C 1 6 E8 6 0 82 3 9C C W 8L D A A# $ 0 8; C O I LV A L U EF O RP O S I T I O N7 C 1 7 0B D C 1 A 92 4 0J S RD E L A Y 1 C 1 7 35 A2 4 1D E C B C 1 7 42 6 F 82 4 2B N EC C W 8 C 1 7 6D 6 0 52 4 3L D A BT I M E R C 1 7 88 6 0 C2 4 4C C W CL D A A# $ 0 C; C O I LV A L U EF O RP O S I T I O N6 C 1 7 AB D C 1 A 92 4 5J S RD E L A Y 1 C 1 7 D5 A2 4 6D E C B C 1 7 E2 6 F 82 4 7B N EC C W C C 1 8 0D 6 0 52 4 8L D A BT I M E R C 1 8 28 6 0 42 4 9C C W 4L D A A# $ 0 4; C O I LV A L U EF O RP O S I T I O N5 C 1 8 4B D C 1 A 92 5 0J S RD E L A Y 1 C 1 8 75 A2 5 1D E C B C 1 8 82 6 F 82 5 2B N EC C W 4 C 1 8 AD 6 0 52 5 3L D A BT I M E R C 1 8 C8 6 0 62 5 4C C W 6L D A A# $ 0 6; C O I LV A L U EF O RP O S I T I O N4 C 1 8 EB D C 1 A 92 5 5J S RD E L A Y 1 C 1 9 15 A2 5 6D E C B C 1 9 22 6 F 82 5 7B N EC C W 6 C 1 9 4D 6 0 52 5 8L D A BT I M E R C 1 9 68 6 0 22 5 9C C W 2L D A A# $ 0 2; C O I LV A L U EF O RP O S I T I O N3 C 1 9 8B D C 1 A 92 6 0J S RD E L A Y 1 C 1 9 B5 A2 6 1D E C B C 1 9 C2 6 F 82 6 2B N EC C W 2 C 1 9 ED 6 0 52 6 3L D A BT I M E R C 1 A 08 6 0 32 6 4C C W 3L D A A# $ 0 3; C O I LV A L U EF O RP O S I T I O N2 C 1 A 2B D C 1 A 92 6 5J S RD E L A Y 1 C 1 A 55 A2 6 6D E C B C 1 A 62 6 F 82 6 7B N EC C W 3 C 1 A 83 92 6 8R T S 2 6 9 2 7 0; D E L A YR O U T I N E C 1 A 9A 7 0 32 7 1D E L A Y 1S T A AP O R T C , X C 1 A B9 6 0 12 7 2L D A AA T E M P 2 C 1 A D9 7 0 22 7 3S T A AA T E M P 3 C 1 A F1 8 D E 0 22 7 4L D YA T E M P 3

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

9/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

C 1 B 21 8 0 92 7 5C O U N TD E Y; D E L A YP E RL O A D E DV A L U E S C 1 B 42 6 F C2 7 6B N EC O U N T C 1 B 6A 6 0 02 7 7L D A AP O R T A , X C 1 B 88 4 0 12 7 8A N D A# $ 0 1 C 1 B A8 1 0 12 7 9C M P A# $ 0 1; C O M P A R EV A L U ET OO U T P U TT OD I S P L A Y C 1 B C2 7 0 E2 8 0B E QN O S E G C 1 B E2 6 0 02 8 1B N ES E G C 1 C 08 6 9 82 8 2S E GL D A A# $ 9 8; D I S P L A Y' P 'F O RP O S I T I O N C 1 C 2A 7 0 42 8 3S T A AP O R T B , X C 1 C 41 8 C E 0 F F F2 8 4L D Y# $ F F F C 1 C 81 8 0 92 8 5Z ZD E Y C 1 C A2 6 F C2 8 6B N EZ Z C 1 C C3 92 8 7N O S E GR T S 2 8 8 2 8 9 2 9 0; I N T E R R U P TR O U T I N EF O RP O S I T I O NC O N T R O L F F F 22 9 1O R G$ F F F 2; V E C T O RF O RI R Q F F F 2F F F 42 9 2F D BI R Q H N D 2 9 3 F F F 47 C 0 0 0 72 9 4I R Q H N DI N CF L G I R Q F F F 73 B2 9 5R T I 2 9 6 2 9 7 2 9 8 2 9 9

There are numerous stepper motor applications that can take advantage of the power, features and flexibility of the M68HC11 single-chip MCU. Applications would include robotics controllers, turning machine tools and other precise shaft positioning control environments. This example is a general solution that demonstrates the ease with which an MCU can be designed into a stepper motor control application. Due to the types of applications supported, stepper motors operate at relatively low rotating speeds. The actual speed is controlled by varying the delay between coil activations. With this system application, the stepper motor converts binary input pulses coming from the MCU to rotary shaft movement on the stepper motor. The direction of turn is a function of the sequence in which the binary pulses are applied to the stepper motor. In addition, the requirement for a digital-to-analog converter is eliminated when using stepper motors versus dc or ac motors in dc systems. Ac and dc motors provide continuous shaft rotation. However, stepper motors produce shaft rotation in precise steps or increments as the result of the applied binary pulses. This can be in the form of either half or full steps (step-angular sensitivity) depending on the sequence of coil activations. It is noteworthy to mention that most stepper motors are used in applications with relatively small loads. An overload condition could result in a shaft slip. This undesirable condition could induce an error that might not be recognized and affect operating precision. To minimize the possibility of this occurring, buffer type amplifiers should be placed between the MCU and the stepper motor. CONTACT REQUEST If you want to know more about this Freescale product, please submit your request to Arrow Italy using this form.
dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9 10/11

6/21/13

Howto Design a Stepper Motor System Using an 8-bit Freescale microcontroller MCU - MC68HC11E9 | Your Electronics Open Source

NOTE: this form is valid ONLY for Companies or Customers based in Italy and working in the Italian area. Read the Italian version: Come progettare un sistema Stepper Motor utilizzando un microcontrollore a 8-bit dalla Freescale - MC68HC11E9
HowT o 8bit MC68HC11E9 stepper m otor Ionela's blog Login to post comments

Elnec PIKprog2 - Reliable


www.elnec.com/programmer_PIKprog2 MCS51 series microcontrollers programmer. Check & Order Now!

Featured Projects
FTPmicro Freescale i.MX27 IP Camera Reference Design IperCODE - RollingCode

Who's online
There are currently 8 users and 6 guests online.

Recent comments
Using this code to send an SMS using USB GRPS modem (cellphone)? 50 weeks 1 day ago Try ing to communicate with a GSM/GPRS modem (by mobile phone) 50 weeks 2 day s ago Please send me the pdf 1 y ear 4 weeks ago S87 C1 96KB1 6 1 y ear 4 weeks ago Great Project 1 y ear 4 weeks ago As per Luigi Auriemma, if the 1 y ear 23 weeks ago Custom Design for iMX27 (IP Camera) 1 y ear 23 weeks ago Help needed to read and write to Max im DS2431 chip 1 y ear 26 weeks ago programming 24FJ1 28 1 y ear 26 weeks ago request 1 y ear 26 weeks ago

Online users
Qui93rrma Qui7 3ppbr cq4s1 0ddd Louispccx Sacsnkbf Sacstjtw y ichedd3n8z8 nort7 wx mj7

dev.emcelettronica.com/howto-design-stepper-motor-system-using-8-bit-freescale-microcontroller-mcu-mc68hc11e9

11/11

S-ar putea să vă placă și