> 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. ***************************************************************** 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