Microcontroller › 8051 › Stepper Motor interfacing with 8051,
- This topic has 6 replies, 3 voices, and was last updated 11 years, 2 months ago by
AJISH ALFRED.
-
AuthorPosts
-
October 27, 2013 at 1:06 pm #2689
pankaj
ParticipantHi friends
I am having problem in interfacing 8051 uC with stepper motor.
My aim is to rotate the stepper motor by +90 degree when i push a “UP” button once and when I push the “UP” button twice +180 degree and then +270 then 0 degree.
And when I push “DOWN” button rotate by -90 degree and when I push DOWN twice -180 degree and so on.I am working on a Proteus but I think there is problem in program and I am not able to get proper result.
Can you any one give me proper Program for that
Thanks in advance
October 29, 2013 at 8:49 am #10560AJISH ALFRED
ParticipantHi Pankaj,
Please try it on real hardware.November 5, 2013 at 8:33 am #10571daniel diamenu
Participanthi can i have a look at your circuit so i can help with the program, i think that is the way u can get better help
thank u
November 16, 2013 at 10:38 am #10611pankaj
ParticipantI started doing it on real hardware, with bipolar stepper motor, crystal 12MHz, capacitor 33pF ,AT89C51, and L293D .
And my program is:
It is working in proteus but not working in hardware:
Reference:http://www.electrosome.com/interfacing-stepper-motor-8051-keil-c-at89c51/
#include<reg51.h> //using AT89C51#include<stdio.h>void delay(int); // Rotation In sequence without any switch continouslyvoid main(){P1=0;P2=0;P3=0;do{P2=0x01; //0001delay(100);P2=0x04; //0100delay(100);P2=0x02; //0010delay(100);P2=0x08; //1000delay(100);}while(1);}void delay(int k){int i,j;for(i=0;i<k;i++){for(j=0;j<1725;j++){}}}November 16, 2013 at 10:48 am #10612pankaj
ParticipantI am working on real hardware it is not giving any desired response (at output pins) how ever it works perfectly in Proteus my circuit is:
hardware: AT89C51, capacitor 33pF, crystal 12MHz, Bipolar Stepper Motor (4 wire)…
my program is:
#include<reg51.h> //using AT89C51#include<stdio.h>void delay(int); // Rotation In sequence without any switch continouslyvoid main(){P1=0;P2=0;P3=0;do{P2=0x01; //0001delay(100);P2=0x04; //0100delay(100);P2=0x02; //0010delay(100);P2=0x08; //1000delay(100);}while(1);}void delay(int k){int i,j;for(i=0;i<k;i++){for(j=0;j<1725;j++){}}}November 16, 2013 at 1:27 pm #10613pankaj
ParticipantNow it is rotation but after few steps it stop rotating…
tried to change the program but same result…
My motor is:
NMB-MAT pm35s-048 FEE6
TB6628D
I am giving 9 volt supply through HW HI Watt battery (vallue of current is not given in battery)…
Is the current is not enouth to rotate the rotor ?
November 27, 2013 at 6:04 am #10661AJISH ALFRED
ParticipantHi Pankaj,
Please post the circuit diagram of the real hardware, that image dosen’t look like one.
-
AuthorPosts
- You must be logged in to reply to this topic.