PDA

View Full Version : Servo motor interfacing



ichigohnvn
02-10-2006, 09:56 AM
Hi

I'm using futaba S148 servo motor and PIC18F452 microcontroller to control the motor. The control circuit only has an external oscillator with frequency of 4Mhz and other necessary devices to provide power to the MCU.

I used this circuit to test the motor. The program I wrote to test the motor is in C language using MPLAB C18 compiler:

#include <p18f452.h>
#include <timers.h>
#include <pwm.h>

void main(void)
{

PORTB = 0;
TRISB = 0;

OpenTimer2 (TIMER_INT_OFF & TS_PS_1_1 & TS_POST_1_1);
OpenPWM1 (0xD2);
SetDCPWM1 (1000111010);
}

I set the output to port B any connect the signal controlling wire of the motor (the white one) to this output but still cannot make it rotate as expected. The motor and the MCU are powered properly as I think.

I wish you could help me to figure out what is wrong with this.

Thank you very much.

nmittal
03-26-2006, 05:02 AM
Hi,
if the problem still persists then please drop me the datasheets of the motor at my email address mittal.nitin@Gmail.com