PDA

View Full Version : Program for controlling analog servo motor using PIC18F452



SolaiKannan
- 22nd February 2012, 15:41
hi
i am using pic 18f452 to control the servo motor Turnigy TG9e.
i am programming it using microcode studio.
i was not able to move the servo motor.

i don't know what was the mistake.

can anyone provide me a basic program in microcode studio for controlling servo motor Turnigy Tg9e using pic 18f452

gadelhas
- 22nd February 2012, 15:44
hi
i am using pic 18f452 to control the servo motor Turnigy TG9e.
i am programming it using microcode studio.
i was not able to move the servo motor.

i don't know what was the mistake.

can anyone provide me a basic program in microcode studio for controlling servo motor Turnigy Tg9e using pic 18f452

I think its better you put here the code that you allready have, and if possible schematic also!

SolaiKannan
- 23rd February 2012, 03:42
this is my coding.

define osc 20

OUTPUT PORTB.0

LOOP:

PULSOUT 0,110
PAUSE 1000

PULSOUT 0,120
PAUSE 1000


PULSOUT 0,130
PAUSE 1000

PULSOUT 0,140
PAUSE 1000

PULSOUT 0,150
PAUSE 1000

PULSOUT 0,160
PAUSE 1000

PULSOUT 0,170
PAUSE 1000

PULSOUT 0,180
PAUSE 1000

PULSOUT 0,190
PAUSE 1000


PULSOUT 0,200
PAUSE 1000
GOTO LOOP
END

SolaiKannan
- 23rd February 2012, 05:11
6295

this is my schema .

Archangel
- 24th February 2012, 07:47
Looks like your motor ground is isolated from ground by capacitors and DC will not flow through those.

Acetronics2
- 24th February 2012, 10:31
Hi,

Moreover your servo is powered between +V and +V ... ( yes, I wrote it fine !!!) ... and the reset pin can't do its job ...

your program won't work fine as servo signal ( 1 to 2 ms pulse ) has to be sent every ~ 20 ms ... and not once every second ... :chargrined:

Alain