Hi,
I bought a Futuba s3003 servo
They say with 20ms delay and range b/w 1-2 ms u can control the rotation.
Should the PWN be continously sent to the motor?..
doubt: if i do,the motor continously rotates till mechanical limits.
i believe 1.5 ms is the mid position.
This is the CODE sample for 1.5 ms
when external input to 3.2 pin of 89c51 is given,i enable the servo..
======================================================
void main()
{
TMOD = 0x01;
TH0 = 0xB1;
TL0 = 0xE0;
EX0=1;
EA = 1;
ET0 = 1;
TR0 = 1;
if(P3_2 == 0)
{
void timer0_0();
}
}
void timer0_0 () interrupt 0
{
if(F0){
F0 = 0;
TH0 = 0xB1; // 20ms
TL0 = 0xE0;
P1_0 = 0;
TF0 = 0;
return;
}
else {
F0 = 1;
TH0 = 0xFA; // 1.5ms
TL0 = 0x24;
P1_0 = 1;
TF0 = 0;
return;
}
}
also i find one more issue..if 2ms is for counter clockwise..the servo still rotates in the same clk wise direction..
I bought a Futuba s3003 servo
They say with 20ms delay and range b/w 1-2 ms u can control the rotation.
Should the PWN be continously sent to the motor?..
doubt: if i do,the motor continously rotates till mechanical limits.
i believe 1.5 ms is the mid position.
This is the CODE sample for 1.5 ms
when external input to 3.2 pin of 89c51 is given,i enable the servo..
======================================================
void main()
{
TMOD = 0x01;
TH0 = 0xB1;
TL0 = 0xE0;
EX0=1;
EA = 1;
ET0 = 1;
TR0 = 1;
if(P3_2 == 0)
{
void timer0_0();
}
}
void timer0_0 () interrupt 0
{
if(F0){
F0 = 0;
TH0 = 0xB1; // 20ms
TL0 = 0xE0;
P1_0 = 0;
TF0 = 0;
return;
}
else {
F0 = 1;
TH0 = 0xFA; // 1.5ms
TL0 = 0x24;
P1_0 = 1;
TF0 = 0;
return;
}
}
also i find one more issue..if 2ms is for counter clockwise..the servo still rotates in the same clk wise direction..
Last edited: