laika
Well-Known Member
I know I am doing something wrong - but I read this as 8 data bits plus the parity bit set only on the command character and not set for the rest. My only glimmer of hope is that I know it is "possible" to do with a PC because the "SeaSigma" program successfuly sends canned SeaTalk datagrams (on my PC) to my instruments.
I may have misunderstood this but hopefully can contribute something even if I have.
The code examples on Thomas Knauf's site are (I think) for systems where you have direct access to devices and registers. I've never "done" windows, but I'll guess (someone else please chip in here: I really have no idea...) that direct access to a COM port's line status register from an application program was possible only for the old single user versions (e.g. Windows 95).
In a modern multiuser OS you don't have that direct access from a userspace program: You can't play with the parity bit directly. You can, however, play some Stupid Parity Tricks with a standard serial API using the concepts of SPACE and MARK parity. With the former, the parity bit is always 0. With the latter, always 1 (so it's not really a "parity" bit as such...)
Reading, you set your device to expect SPACE parity. When a command word is received you get a "parity error" because that 9th bit is set. Hopefully your API allows you to get the "erroneous" byte as well as notification of the error.
Writing, you have space parity set, but just flip that to mark parity when you send a command byte.
I'd be hesitant about writing seatalk from a userland program on a multiuser OS because the possible variability in latency between data appearing on the wire and being read/written by the program might not be conducive to good collision avoidance behaviour. Might be fine but might result in more nonsense on the seatalk bus. This is a good reason to use a dedicated microcontroller rather than a userspace program in Linux
If you're using a serial to USB converter be aware that not all drivers will support MARK/SPACE parity and that there are some converters out there which are rather poor at flagging up *any* kinds of parity errors as data rates approach the seatalk maximum (a Keyspan USA-19HS fell into that category). FTDI ones seem to work fine in Linux.
All of this assumes that the user has first inverted the signal using Thomas Knauf's circuit, the one Nigel proposed here:
http://www.ybw.com/forums/showthread.php?328981-cheaper-large-instrument-displays-mast-mount&p=3903230#post3903230
Or something similar...
Last edited:

