On Fri, 8 Nov 2002, Daniel Rubin wrote: > Josh, > > Thanks for your input... What do you mean by tristate? Is there another > state besides on and off? Are you saying I do the following: > > disable outputs > write W to GPIO > enable outputs > > If that is what you are referring to I am not sure that is possible as this > output is PWM and the extra 2 instructions per toggle would cut my possible > rate. Dan, This kind of thing is done (at least I've done it) to boost the current drive of a logic gate. You probably have a resistor in series with the line already to limit the current. If so, replace it with two resistors with twice the resistance. Tie one end of the resistors together (and to your load) and tie the other ends to the two I/O pins. If the I/O's momentarily drive in opposite states, then the current will be limited. But, if there is no series resistor to limit the current (then I guess the question would be how are you limiting the current?) then there's a chance the I/O's will experience significant loading if they're driving in opposite states. The duration of these illegal states is presumably quite low. I.e. it only happens at the edges. I strongly doubt this will damage the I/O drivers, since it's energy and not current that kills. In other words, If you left the i/o's in this illegal state for a *long* time, then you may damage them (I doubt it though - pic I/O's are notoriously robust). The only caveat is that you want to advoid RMW (read-modify-write) operations on the I/O port. There's a good chance that the RMW operation can cause a bit a error. To advoid this, add a shadow register and copy that to the I/O port. You mention GPIO so I assume you're using the 12c508. If you were using the 18f's you could write directly to the LATch registers. BTW, if you're using PWM on the 12c508, check out: http://www.dattalo.com/technical/software/pic/pwm256.txt It was originally written for the 12-bit cores. Since first written, I've used it on the 14-bit cores, so there may be some 14-bit dependcy that has crept in. --- With the 18f's you can toggle an LED with something like: BTG LATA,0 ; bit toggle a LATch bit. Isn't that cute! Scott -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu