Mon Mar 28 22:06:52 EDT 2011
Bi-directional point-to-point link
To summarize: a preamble is necessary to indicate target ready/busy.
It might also be best to build the data direction straight into the
handshake to allow a 2-way packet interface instead of a request,reply
structure: a point-to-point bidirectional link.
( Am I re-inventing I2C? )
In idle state, host is polling one bit at a time from the target.
Target returns 1Z which reads as 10 on the host side.
At this point the host know the client is in sync and can write out
the data direction bit.
After that host generates clock and communication happens in one of
the 2 directions. If the client is sending it needs an extra clock
bit to allow for the line to be released.
This gives the following transaction protocol (target side).
1ZR preamble + dir bit
[<byte> ...] payload
Z = high-Z (pulled down)
R = client read
Testing the 1Z preamble, PK2 reads the 2nd bit as 1, presumably
because it's not pulled to ground fast enough. (I love my DSO!) It
might be a good idea to have the target pull it down, and use the 10
sequence as a consitency check to make sure the target is fast enough.
Tested on target: this works OK.