1)
The stepper motor is an open-loop control element that converts electrical pulse signals into angular displacement or linear displacement. In the case of non-overload, the motor's speed and stop position depend only on the frequency and number of pulses of the pulse signal, and are not affected by load changes. That is, when a signal is added to the motor, the motor rotates a step angle. The existence of this linear relationship, coupled with the characteristics of the stepper motor having only periodic errors but no accumulated errors, makes it very simple to use stepper motors to control in the field of linear speed, position and other control areas.
2)
Use the microcontroller to drive the stepper motor in software mode. Through the editing method, the speed, reciprocating angle and number of rotations of the stepper motor can be controlled within a certain range. It can also conveniently and flexibly control the operating status of the stepper motor:
3) Schematic diagram:
4) Connection diagram:
Output |
Input |
||||
A |
C1 |
P2.0 |
KM1 |
P1.0 |
1B |
B |
C2 |
P2.1 |
KM2 |
P1.1 |
2B |
C |
C3 |
P2.2 |
KM3 |
P1.2 |
3B |
D |
C4 |
P2.3 |
KM4 |
P1.3 |
4B |
|
|
P2.4 |
KM5 |
|
|
5) Application components and circuit diagram
Component Name |
model |
Number of items |
Microcontroller |
1 |
|
Crystal Oscillator |
CRYSTAL |
1 |
capacitance |
CAP |
2 |
resistance |
RES |
1 |
Stepper Motor |
STEPER |
1 |
Stepper motor chip |
ULN2003A |
1 |
Button |
BUTTON |
6 |
2. Experimental Procedure
org 0000H
start:
jnb p2.0,step
jnb p2.1,step
sjmp start
step:
jnb p2.2,one
jnb p2.3,ten
jnb p2.4,hundred
ljmp start
one:
mov r0,#2
jnb p2.0,zh1
jnb p2.1,fan1
ljmp start
ten:
mov r0,#10
jnb p2.0,zh1
jnb p2.1,fan1
ljmp start
hundred:
mov r0,#100
jnb p2.0,zh1
jnb p2.1,fan1
ljmp start
zh1:
mov p1,#03H
lcall delay
jnb p2.7,stop
djnz r0,zh2
ljmp stop
zh2:
mov p1,#06H
lcall delay
jnb p2.7,stop
djnz r0,zh3
ljmp stop
zh3:
mov p1,#0cH
lcall delay
jnb p2.7,stop
djnz r0,zh4
ljmp stop
zh4:
mov p1,#09H
lcall delay
jnb p2.7,stop
djnz r0,zh1
sjmp stop
fan1:
mov p1,#09H
lcall delay
jnb p2.7,stop
djnz r0,fan2
ljmp stop
fan2:
mov p1,#0cH
lcall delay
jnb p2.7,stop
djnz r0,fan3
ljmp stop
fan3:
mov p1,#06H
lcall delay
jnb p2.7,stop
djnz r0,fan4
ljmp stop
fan4:
mov p1,#03H
lcall delay
jnb p2.7,stop
djnz r0,fan1
sjmp stop
stop:
mov p1,#00H
ljmp start
delay:
mov r2,#200
d1:mov r1,#200
djnz r1,$
djnz r2,d1
ret
end
3. Debugging records:
After the program is compiled and downloaded to the microcontroller, it is found that the 10-step button cannot be run during the operation, while the others are running normally. When checking the program, it is found that there is an error in the 10-step program. After correction, it can be run.
Previous article:Summary of MCU learning experience 2.
Next article:Microcontroller clock design
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Help! CCS7.3 enters the exit.c file after entering debug mode. I don't know how to solve it
- Share Gigabit Ethernet port circuit design
- [RVB2601 creative application development] 2. CH2601 serial port receiving
- How to draw this shape in Protel 99se
- Fairchild Semiconductor adds analog product development team to develop power analog business
- A summary of the most downloaded electronic technical materials this week (2020.5.1~9), each one is a classic
- [i.MX6UL development problem] How to use tftp to burn program in uboot
- FPGA image processing algorithm.zip
- DM9000 Series
- Improving Oscilloscope Testing of Low-Speed Serial Buses