<i>For example, if an external circuit expects one pin high and another low, but gets both high or both low for a while - how much of a problem might I have? </i>
It can be a major problem. A typical mistake is trying to control a parallel LCD by setting the 'character required' bits and the 'clock data out' bit in one output write. The LCD may see the clock activated before the character bits have changed and use the wrong data.
The solution is to do any outputting in a way that ensures the bits which need to be stable when another pin changes are set before the clocking bits are changed -<code><pre><font size=2 face='Courier'> pins = %11010011 ' Clock = 1, Data = %1010011
pins = %01010011 ' Clock = 0, Data = same as before
pins = %11010011 ' Clock = 1, Data = same as before </font></pre></code> If you have control over the receiver, such as if it's a PICAXE, it's unlikely to be a problem because you will have checked the clock bit, seen it active, and by the time you come to read the data it will have become stable ( unless the sender has altered it again too quickly ). If trying to read all pins this can be a problem -<code><pre><font size=2 face='Courier'> ' Bad
b0 = pins
If bit7 = 0 Then
Gosub UseDataInBit0ToBit6
End If
' Good
If pin7 = 0 Then
b0 = pins
Gosub UseDataInBit0ToBit6
End If </font></pre></code> To save the sender having to wait some arbitrary time to ensure the receiver has seen the clock, and read the data, rather than strobe the clock line, it can simply be toggled on every output and the receiver can tell new data has arrived whenever the pin changes from what it previously was. The sender still must not send to quickly but normally 'other processing' will have ensured the receiver has had plenty of time to see and read the data sent to it.
Edited by - hippy on 31/08/2007 12:34:51