>-----Original Message----- >From: Bruce Douglas [mailto:bdouglas@UOL.COM.BR] >Sent: 15 July 2004 03:33 >To: PICLIST@MITVMA.MIT.EDU >Subject: [PIC:] Tri-stating outputs > > >There is a small pdf on Microchip's site called "Better PWM Linearity" >(MP077) where the author recomends tri-stating a pwm output >when you have some slow processing to do which will >significantly mess up the pwm cycles. > >I am guessing that I have to switch my pwm outputs to inputs >to do this. > Is this correct? Correct, but this will only help if you have a low pass filter ( RC Circuit) on the PWM output to get an average DC level. Tri-stating the output will ensure the voltage across the capacitor does not change significantly whilst you perform any processing that messes up the PWM period. Note that this is only required if you are "bit bashing" PWM in your main loop. If you are using hardware PWM (CCP module) or software PWM via timer interrupts then main loop CPU utilisation should have no effect. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads