Page 5 of 5

Servo Controlling using PIC16F877A Need HELP (URGENT)

PostPosted: Sat Dec 03, 2011 1:01 am
by aqish88
hello everyone.. need some help..

I'm using PIC16f877a to control the servo motor
and my problem is.. when I combine my servo motor cooding, the motor is not function on circuit board..
but when i'm using proteus for testing, the motor run smoothly.. what should i do..?!


this is my induvidual cooding to control servo motor..

-MicroC-

void main(void)
{
TRISB = 0xFF;
TRISC = 0x00;
PORTC = 0x00;
Pwm1_Init(10000);

while(1)
{

if (PORTB.B0 == 0)
{

Pwm1_Set_Duty(255); //50% Duty Cycle for forward
Pwm1_Start();

}
else if (PORTB.B1 == 0)
{
Pwm1_Set_Duty(127); //25% Duty Cycle for reverse
Pwm1_Start();

}
}
}

Re: Servo Controlling using PIC16F877A

PostPosted: Mon Dec 05, 2011 11:05 pm
by robosang
Are you controlling standard RC servo? It seem to be modified servo :mrgreen:

Re: Servo Controlling using PIC16F877A

PostPosted: Tue Dec 06, 2011 12:17 am
by aqish88
I'm using C36R.. I'm studying the data sheet but the problem is it's not moving when i applying it for my full cooding system..

Re: Servo Controlling using PIC16F877A

PostPosted: Wed Dec 07, 2011 1:36 pm
by hyng
There is a sample source code under the C36R product page. You can refer to it. Although the sample code is written in C with Hitech C compiler, the basic concept is the same.