Re: serial.c (half duplex support)

David Woodhouse (David.Woodhouse@mvhi.com)
Tue, 26 Oct 1999 13:06:39 +0100


tytso@MIT.EDU said:
> There's no end of packet character? How.... awful.

OK. It seems that I lied. There is an end of frame character, although I
believe that it can also appear in the payload, and I was hoping to be able to
use the timing specs instead.

It's also possible to work out the frame length after seeing the first couple
of octets, too - if it's a fixed length frame then you know its length after
the first octet, and if it's a variable length frame then its length is
reported in the second octet. So by combining the two, you can tell packets
apart without seeing false end markers in the payload.

And it's 33 bit times, not 27, just in case someone is feeling bored enough to
read the spec, and pedantic enough to correct me.

I suppose could get it to work if I just forget about the timing on the receive
side, and use the start-stop chars to see where packets start and end.

Strictly speaking, though, that approach violates the spec:

PROFIBUS-Specification-Normative-Parts-4:1997, p122, §4.6.1:

Transmission Rules

1. Line idle state corresponds to signalling level binary "1".

2. Each action frame shall be preceded by at least 33 line idle bits
(Syn Time).

3. No idle states are allowed between a frame's UART characters.

4. The receiver checks:
per UART character: start bit, stop bit and parity bit (even),
per frame: start delimiter, DA, SA, FCS and end delimiter and the
SYN Time in the case of an action frame. If the check fails, the
whole frame shall be discarded.

I would like to have the option available of obtaining certification for this,
which means complying fairly strictly with the specification.

On the outgoing side, I can manage OK, but for receive, I really ought to have
access to that kind of timing information.

---- ---- ----
David Woodhouse David.Woodhouse@mvhi.com Office: (+44) 1223 810302
Project Leader, Process Information Systems Mobile: (+44) 7976 658355
Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/