madhan2madhan
Junior Member level 3
Hi Everyone,
I'm doing my final year project as Bipedal Walking Robot,I'm using Futaba 3006 Servomotor and PIC 16F877A IC.I have to Control totally 20 Servomotors,I tried to generate the PWM signal from PORTB Its working fine for single servomotors,But for multi servomotors control the code is not running, Its getting hang after some movement of the servomotor.
Anyone please help me to do the control of multi servo at simultaneously,for different angles..
Here i given my simple program to control two servomotors.
<#include pic.h>
<#include htc.h>
__CONFIG(0x3f3a);
#define __XTAL_FREQ 16000000L
void main()
{
TRISB=0x00;
int x=0;
while(1)
{
for(x=0;x<50;x++)
{
RB1=1;
RB4=1;
__delay_us(1400);//neutal
RB1=0;
RB4=0;
__delay_ms(19);
}
for(x=0;x<50;x++)
{
RB1=1;
RB4=1;
__delay_us(1900);//left
RB1=0;
RB4=0;
__delay_ms(19);
}
}
}
This is my sample program for control two servos,Please help me to control more servos with different angles simultaneously please,Its really Urgent.I'm Waiting for Ur Timely help please.
I'm doing my final year project as Bipedal Walking Robot,I'm using Futaba 3006 Servomotor and PIC 16F877A IC.I have to Control totally 20 Servomotors,I tried to generate the PWM signal from PORTB Its working fine for single servomotors,But for multi servomotors control the code is not running, Its getting hang after some movement of the servomotor.
Anyone please help me to do the control of multi servo at simultaneously,for different angles..
Here i given my simple program to control two servomotors.
<#include pic.h>
<#include htc.h>
__CONFIG(0x3f3a);
#define __XTAL_FREQ 16000000L
void main()
{
TRISB=0x00;
int x=0;
while(1)
{
for(x=0;x<50;x++)
{
RB1=1;
RB4=1;
__delay_us(1400);//neutal
RB1=0;
RB4=0;
__delay_ms(19);
}
for(x=0;x<50;x++)
{
RB1=1;
RB4=1;
__delay_us(1900);//left
RB1=0;
RB4=0;
__delay_ms(19);
}
}
}
This is my sample program for control two servos,Please help me to control more servos with different angles simultaneously please,Its really Urgent.I'm Waiting for Ur Timely help please.