need helps

Hello everybody
I’m trying to make a robot but I’ve got few problem with servo controls.
i’m driving a servo by a pic16f84A but i’m not sure that my program is coccect.
I want to move the servo in the middle position so I give it a signal that is high(5V) for 1.5ms and low for 18.5ms and then I repeat.

This program put the min RA0 to high and than by many useless function it wait 1.5ms: I calculated 8000000^ -1 to check out the time that the pic need to do an instruction and than I made it count till it west 1.5 ms.

PROCESSOR 16F84A
RADIX DEC
INCLUDE “P16F84A.INC”
;ERROR LEVEL -302
__CONFIG 3FF1H

ORG 0CH

COUNT RES 2

ORG 00H

BSF STATUS,RP0

CLRF TRISA
CLRF TRISB

BCF STATUS,RP0

MAIN
BSF PORTA,0
MOVLW 00101111
MOVWF COUNT
MOVLW 00000000
MOVWF COUNT+1
CALL DELAY

BCF PORTA,0

CLRF COUNT
CLRF COUNT+1
CALL DELAY

CLRF COUNT
CLRF COUNT+1
CALL DELAY

MOVWF 00000001
MOVLW COUNT
MOVWF 01000010
MOVLW COUNT+1
CALL DELAY

MOVLW 00000001
MOVWF COUNT
MOVLW 10010100
MOVWF COUNT+1
CALL DELAY

GOTO MAIN

DELAY

DELAYLOOP

DECFSZ COUNT,1
GOTO DELAYLOOP
DECFSZ COUNT+1,1
GOTO DELAYLOOP

RETURN

END

I wrote this program but it doesn’t work but I don’t understand why.
Can some help me?

Haven’t read the entire code, the only thing that stood out to me is that you’re not reloading COUNT in your delay loop, so it’s gonna have a value of 0xFF everytime except in the first loop.

Dunno if that’s the point, but if you’re having timing problems that could be a hint.

it is crrect because in every loop it goeg in over(i don’t know how it’s called): it pass from 0 to 255 because i tell hit to decrese

i’ve understoold!!! in the delay rootime that i used i didn’t cauculated the time of “goto delay” so the time of delay is very differenct from what i calculated. thank you everydody!!!

Well, did it work?