Sei sulla pagina 1di 5

29/08/13

Stepper Motor interfacing with Microcontrollers tutorial: Programming stepper - Rickey's World of Microcontrollers & Microprocessors

Home

Forum

Tutorials

Downloads

LCD Pinouts

Jet Engine

Games

Project Demos

More
Thursday, 29 August 2013 19:04

Pic16f84 Programmer MPLAB Compatible USB Programmer Starting at only $34.95! www.canakit.com Variadores de Velocidad Driver-Motores-PAP-Servos tel.011- 4220-7628 - LANUS www.giis.com.ar Datasheet Datasheet 350 Million Datasheets 8500 Manufacturers www.datasheetarchive.com Controls Drives & Sensors One-stop shop for Sales & Service of Electric Automation Systems. www.netwell-systems.com Stepper Motor interfacing with Microcontrollers: Programming Stepper motor Support Rickey's World
$ 5.00 Custom

C Programming Microcontrollers Stepper Motor

Programming Full step Sequence


C Programming I am assuming that stepper motor is connected at Port 1.0 to Port 1.3. Adjusting the delay will increase or decrease the speed of the motor. Here just for demonstration i have taken some delay, you can change it as you want. [Tip: Do testing.. ]

Name & Comments!

Welcome
Username: Password:
L ogin

PIC C Compilers
www.fored.co.uk PIC Rapid Application Development ANSI C Compiler & Simulator : WIZ-C

Remember me [ Signup ] [ Forgot password? ] [ Resend Activation Email ]

CODE:

# i n c l u d e< R E G 2 0 5 1 . H > . # d e f i n es t e p p e rP 1 v o i dd e l a y ( ) ; v o i dm a i n ( ) { w h i l e ( 1 ) { s t e p p e r=0 x 0 C ; d e l a y ( ) ; s t e p p e r=0 x 0 6 ; d e l a y ( ) ; s t e p p e r=0 x 0 3 ; d e l a y ( ) ; s t e p p e r=0 x 0 9 ; d e l a y ( ) ; } } v o i dd e l a y ( ) { u n s i g n e dc h a ri , j , k ; f o r ( i = 0 ; i < 6 ; i + + ) f o r ( j = 0 ; j < 2 5 5 ; j + + ) f o r ( k = 0 ; k < 2 5 5 ; k + + ) ; }

Chatbox

wahenoor | 26 Aug : 21:24 Sir i want to interface zigbee with microcontroller for the controlling purpose..i need to control the movement of my robot with the help of zigbee..so plzz tell me the assembly program for that..thank u in advance

Assembly Programming CODE:

Ajay Bhargav | 26 Aug : 08:48 no problem.. I will make this chatbox more active hehe.. there will be changes on design again.. But This time I am thinking to make them permanent ExperimenterUK | 26 Aug : 08:42 Sorry Ajay I was afk Things are okay. Ajay Bhargav | 26 Aug : 08:29 Mr. six pack.. post in forum please. Ajay Bhargav | 26 Aug : 08:29 Things are great how bout you

o r g0 H s t e p p e re q uP 1 m a i n : m o vs t e p p e r ,# 0 C H a c a l ld e l a y m o vs t e p p e r ,# 0 6 H a c a l ld e l a y m o vs t e p p e r ,# 0 3 H a c a l ld e l a y m o vs t e p p e r ,# 0 9 H a c a l ld e l a y s j m pm a i n d e l a y : m o vr 7 , # 4 w a i t 2 :

www.8051projects.net/stepper-motor-interfacing/programming-microcontroller.php

sridharsixpack | 26 Aug : 08:25 doubt regarding ANDROID CONTROLLED ROBOT hi i've build your project but i was fail i have used HC-05 Bluetooth module , i directly connect that with a microcontroller do i need to interface with the PC before interface with a UC

1/5

29/08/13

Stepper Motor interfacing with Microcontrollers tutorial: Programming stepper - Rickey's World of Microcontrollers & Microprocessors
w a i t 2 : w a i t 1 : m o vr 5 , # 0 F F H w a i t : d j n zr 5 , w a i t d j n zr 6 , w a i t 1 d j n zr 7 , w a i t 2 r e t e n d
The working of the above code can be seen in the demo animation below.

m o vr 6 , # 0 F F H

before interface with a UC i've connected TX pin bluetooth to RX pin of UC , and i gave supply to bluetooth i'm using 89s52 U ExperimenterUK | 26 Aug : 08:13 Hi Ajay.. how are things ? Ajay Bhargav | 26 Aug : 08:12 Hi Phil jalal.zaid | 22 Aug : 00:54 dear sir i m making this propeller display but i face problem in programming AT89c2051. when i try to burn its hex file in AT89c2051 i get the message "ROM PROGRAMMING FAILED" whenever same hex file can successfully burned in 89c51 . and when i tried other hex file in 89c2051 it successfully burned on it. pleas help me to program the ic. i tried all hex files related to this project posted on forums Anonymous | 21 Aug : 21:05 *** ERROR: COMMAND-FILE 'LCD' NOT FOUND View all posts (27019)

Trending Topics
adaptive cruise control in the automobile industry 40x4 lcd simulation proteus pull ups greenbee v2 radio frequency band ingenuity 4G technology digital ac voltmeter Programming 32-bit Microcontrollers in C

orcad layout
I2C eeprom addressing generating audio and video

signal on PIC

alarm

time

bio resonance

internet protocol RS-232 firmware and hardware Digital electronics processor modelling PC BASED DATA LOGGER Microcontroller Based Caller ID more tags

Link to Us!

Programming Half step Sequence


C Programming Just the main routine changes rest everything remains same, i mean same delay routine. CODE:

Put this button on your website to link with us!

Online
Guests: 41, Members: 0 ... most ever online: 182184 (Members: , Guests: 182184) on 06 Aug : 02:37 Members: 36697 Newest member: tsunwingsc66

Info Panel

v o i dm a i n ( ) { w h i l e ( 1 ) { s t e p p e r=0 x 0 8 ; d e l a y ( ) ; s t e p p e r=0 x 0 C ; d e l a y ( ) ; s t e p p e r=0 x 0 4 ; d e l a y ( ) ; s t e p p e r=0 x 0 6 ; d e l a y ( ) ; s t e p p e r=0 x 0 2 ; d e l a y ( ) ; s t e p p e r=0 x 0 3 ; d e l a y ( ) ; s t e p p e r=0 x 0 1 ; d e l a y ( ) ; s t e p p e r=0 x 0 9 ; d e l a y ( ) ; } }

Assembly Programming Here also the main routine changes rest everything remains same. CODE:

m a i n : m o vs t e p p e r ,# 0 8 H a c a l ld e l a y m o vs t e p p e r ,# 0 C H a c a l ld e l a y m o vs t e p p e r ,# 0 4 H a c a l ld e l a y m o vs t e p p e r ,# 0 6 H a c a l ld e l a y m o vs t e p p e r ,# 0 2 H a c a l ld e l a y m o vs t e p p e r ,# 0 3 H a c a l ld e l a y m o vs t e p p e r ,# 0 1 H a c a l ld e l a y

www.8051projects.net/stepper-motor-interfacing/programming-microcontroller.php

2/5

29/08/13

Stepper Motor interfacing with Microcontrollers tutorial: Programming stepper - Rickey's World of Microcontrollers & Microprocessors
a c a l ld e l a y m o vs t e p p e r ,# 0 9 H a c a l ld e l a y s j m pm a i n

The working of the above code can be seen in the demo animation below.

Programming for 2-wire connection of Unipolar Stepper Motor


C Programming

CODE:
v o i dm a i n ( ) { w h i l e ( 1 ) { s t e p p e r=0 x 0 3 ; d e l a y ( ) ; s t e p p e r=0 x 0 1 ; d e l a y ( ) ; s t e p p e r=0 x 0 0 ; d e l a y ( ) ; s t e p p e r=0 x 0 2 ; d e l a y ( ) ; } }

Assembly Programming CODE:


m a i n : m o vs t e p p e r ,# 0 3 H a c a l ld e l a y m o vs t e p p e r ,# 0 1 H a c a l ld e l a y m o vs t e p p e r ,# 0 0 H a c a l ld e l a y m o vs t e p p e r ,# 0 2 H a c a l ld e l a y s j m pm a i n

The working of the above code can be seen in the demo animation below.

www.8051projects.net/stepper-motor-interfacing/programming-microcontroller.php

3/5

29/08/13

Stepper Motor interfacing with Microcontrollers tutorial: Programming stepper - Rickey's World of Microcontrollers & Microprocessors

Programming for Bipolar Stepper Motor


C Programming CODE:
v o i dm a i n ( ) { w h i l e ( 1 ) { s t e p p e r=0 x 0 8 ; d e l a y ( ) ; s t e p p e r=0 x 0 2 ; d e l a y ( ) ; s t e p p e r=0 x 0 4 ; d e l a y ( ) ; s t e p p e r=0 x 0 1 ; d e l a y ( ) ; } }

Assembly Programming CODE:


m a i n : m o vs t e p p e r ,# 0 8 H a c a l ld e l a y m o vs t e p p e r ,# 0 2 H a c a l ld e l a y m o vs t e p p e r ,# 0 4 H a c a l ld e l a y m o vs t e p p e r ,# 0 1 H a c a l ld e l a y s j m pm a i n

Now you're ready to use stepper motors. If you have any doubts, please post in the forum.
Prev ious Page | Next Page

Back to main

DC Motor Tutorial Index Introduction to Stepper Motors Step Sequence of Stepper Motors Stepper Motor Connections Programming for Stepper Motor

2010 Rick ey 's World

www.8051projects.net/stepper-motor-interfacing/programming-microcontroller.php

4/5

29/08/13

Stepper Motor interfacing with Microcontrollers tutorial: Programming stepper - Rickey's World of Microcontrollers & Microprocessors
Render time: 0.0423 sec, 0.0055 of that for queries. DB queries: 18. Memory Usage: 2,162k B

www.8051projects.net/stepper-motor-interfacing/programming-microcontroller.php

5/5

Potrebbero piacerti anche