infidelboy
- Aug 8, 2010
- 5
- Joined
- Aug 8, 2010
- Messages
- 5
i have bought a brushless motor from robokit and tried to run it with at80s52.. but i am not able to run it.
here is image of motor i bought
http://robokits.co.in/shop/bmz_cache/a/a4d6a0116d5b7b58e5db972c6ffb4641.image.350x233.jpg
at the input power pin, i have applied a 12 V dc.
at the other three pins i have applied the control pulse, but it is not working.
here is the programing code for the control pins i used
#include <regx51.h>
sbit i1=P2^0; //for control pin 1
sbit i2=P2^1; //for control pin 2
sbit i3=P2^2; //for control pin 3
void MSDelay(unsigned int);
void main()
{ P2=0x00;
while(1)
{
i1=0x01;
MSDelay(40);
i2=0x01;
MSDelay(40);
i3=0x01;
MSDelay(40);
i1=0x00;
MSDelay(40);
i2=0x00;
MSDelay(40);
i3=0x00;
MSDelay(40);
}
}
void MSDelay(unsigned int a)
{
unsigned int i,j;
for (i=0;i<a;i++)
for (j=0;j<1275;j++);
}
resulting in output as...
whats wrong here..
here is image of motor i bought
http://robokits.co.in/shop/bmz_cache/a/a4d6a0116d5b7b58e5db972c6ffb4641.image.350x233.jpg
at the input power pin, i have applied a 12 V dc.
at the other three pins i have applied the control pulse, but it is not working.
here is the programing code for the control pins i used
#include <regx51.h>
sbit i1=P2^0; //for control pin 1
sbit i2=P2^1; //for control pin 2
sbit i3=P2^2; //for control pin 3
void MSDelay(unsigned int);
void main()
{ P2=0x00;
while(1)
{
i1=0x01;
MSDelay(40);
i2=0x01;
MSDelay(40);
i3=0x01;
MSDelay(40);
i1=0x00;
MSDelay(40);
i2=0x00;
MSDelay(40);
i3=0x00;
MSDelay(40);
}
}
void MSDelay(unsigned int a)
{
unsigned int i,j;
for (i=0;i<a;i++)
for (j=0;j<1275;j++);
}
resulting in output as...
whats wrong here..