I don't know why Olin suggested a flyback diode. If this is a regular RC servo, this is simply a command input, not PWM being fed directly to a motor. Have you tried looking at the output of the pin without anything connected (besides the scope)? Also, although it is difficult to imagine how it could show one edge nice and clean and the other edge incorrectly, I am a bit suspicious of the accuracy of the sound card as a scope. If configured properly, I guess it could be fine, but it could be a challenge in some cases to make sure it is all set up properly, especially since it is not designed for this purpose. You might also try a different pin on the PIC or a different PIC to rule out damage to the point pin drivers. Finally, I took a quick look at your code and I don't see how this could be happening, but what you are seeing is consistent with switching the port pin's DIRECTION (input vs output) rather than value. In other words, if you somehow have the PORTB register's bit # 3 permanently high and you are switching TRISB's bit 3 instead, you would be switching the pin between high and tristate rather than high and low. This is remotely possible since PORTB and TRISB are the same address but in different banks (depends on the setting of RP0 in the STATUS register). Sean At 08:19 AM 6/15/2003 -0700, you wrote: >Yes I do not have a flyback diode. I am not sure how >to implement this with a servo, are they any examples >on the web that I can look at? > >--- Olin Lathrop wrote: > > > Well I found out that I am not > > > getting a nice square wave. The rising edge looks > > fine > > > but the falling edge is a slope. > > > > This depends on the external circuit. Something > > must be sourcing lots of > > current (almost certainly above spec) when the PIC > > tries to lower the pin, > > or the low side driver is blown. Did you forget a > > flyback diode? > > > > If the timing is otherwise right, then it's not a > > software problem. > > > > > snipped> > > > > > > >***************************************************************** > > Embed Inc, embedded system specialists in Littleton > > Massachusetts > > (978) 742-9014, http://www.embedinc.com > > > > -- > > http://www.piclist.com hint: To leave the PICList > > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > >__________________________________ >Do you Yahoo!? >SBC Yahoo! DSL - Now only $29.95 per month! >http://sbc.yahoo.com > >-- >http://www.piclist.com hint: To leave the PICList >mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu