Quote Originally Posted by burak450 View Post
Hi Acetronics,
I think you are wrong because my signal is 50hz.I am using 20ms periodic pulses,if t=100 then 1ms high and 19ms low.if the period 20ms then frequency will be 50hz from the formula f=(1/T)
here is my signal code

PULSOUT PORTC.2,T
PAUSEUS 20000-(T*10)

where am I wrong?
Look at the loop in your code.
Aboslutely no 'bounds' checking.
What if...T = 0? Then pauseus = 20000, ok no problem...
What if T=2000? Then pauseus = 0, ok not much of a problem...
What if T=2001? Then pauseus = 65526, ok, shouldn't happen because you've got T defined as a BYTE

But...what happens when you try to drive the servo out of it's physical limits?
What happens to the current draw if you hold a servo that's trying to move? Hook up an ammeter and find out real quick. And if you don't have an ammeter, hook up a voltmeter to your 'battery' and try it and see what happens to your voltage...