YAPP: Homemade Seatalk to USB interface

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:
Well - at last I have cracked it! I can now read and write SeaTalk to/from a standard RS232 Com port. Particular thanks to Angus McDoon - his code gave me the clue I needed - a short delay when transmitting datagrams. I'll follow it up when I can with more details, but if I can crack it anyone can . . .
Cheers,
Andrew G
 
AP_Remote Scrn1.jpg AP_Remote Scrn2.jpg

Just to answer a few questions raised above. I'm using Windows XP on a laptop, with a real RS232 port (COM1) through Thomas Knauf's circuit which I've made up on my own PCB.
Using an iPhone (or Android) app called AirDisplay I can use my phone as a monitor, linked via WIFI to any point on the boat. Using QB64 I've written code for the PC which reads and sends SeaTalk as though my phone were an Autopilot (I've attached two screenshots).
The phone's buttons work - they actually control the autopilot, send +1, -10, change light levels etc - from the phone. The second display shows one of the user-selected graph functions eg the depth of water - in this case as it shallows the graph colour changes via user-selected ranges and colours. Whilst the displays look busy here - on the phone they are quite good. Tapping the screen acts as a mouse click.

The downside is that it requires the PC to be on - whereas the YAPP is to a low-powered micro. But given the PC can still be used for navigating and AIS / whatever its is likley to be on anyway (my cruisng is mostly long distance, eg Melbourne to Lizard Island, Melbourne to Geraldton via Darwin - mostly single handed, my yacht is well setup with an adequate 12V power supply).
My breakthrough was the need to insert a short (0.005 seconds) delay between sending successive characters.
Cheers, Andrew
 
Just to answer a few questions raised above. I'm using Windows XP on a laptop, with a real RS232 port (COM1) through Thomas Knauf's circuit which I've made up on my own PCB.
Using an iPhone (or Android) app called AirDisplay I can use my phone as a monitor, linked via WIFI to any point on the boat. Using QB64 I've written code for the PC which reads and sends SeaTalk as though my phone were an Autopilot (I've attached two screenshots).

Nice. Again, I'm not familiar with windows but...How did you identify the command bits from QB64 (which google tells me is a BASIC variant)? Does windows give you access to the LSR?
 
Laika, Yes QB64 is a BASIC variant - building on QB45 but with many newer featrures (eg mice, COMs for more than 1 & 2, variable font sizes etc). You can access the LCR (Line Control Register) and use it to set parity, baud rate etc - which is what I had to do (as well as an easier OPEN COM . . . statement). I have today posted a longer explanation on the QB64 forum http://www.qb64.net/forum/index.php?topic=10917.0 .
The nice thing is it is free. Cheers, Andrew
 
You can access the LCR (Line Control Register) and use it to set parity, baud rate etc - which is what I had to do (as well as an easier OPEN COM . . . statement).

Clearly I was wrong in my assumptions about windows if you can access the line status/control register directly to read and write the parity bit directly from userspace. Unless somebody knows differently, you can't do that on Linux and other POSIX systems.
 
Hi,

I know this post is very old but what you did is rally amazing (simple and stable). It is actually all I need to get things sorted on my boat, would you mind to pass me a bit more technical info so that I can try to make it on my own?

Thanks in advance and all the best,

Michael
 
Could OpenCPN connect to boat data that arrives via wifi? I'm not sure whether it would appear as a COM port. Also are there any non-surface mount wifi enabled processors or interface chips?
Mine does using VyachtWifi
Duuhh just realised this is one of those zombie threads that have started popping up!
 
Thanks, John
Hi,

I know this post is very old but what you did is rally amazing (simple and stable). It is actually all I need to get things sorted on my boat, would you mind to pass me a bit more technical info so that I can try to make it on my own?

Thanks in advance and all the best,

Michael


This thread and Angus's YAPP sound amazing!! I just joined this form however and I am having trouble figuring out how to PM. doh
 
Err - hang on a minute here. I have a Seatalk network connected to a number Simnet instruments as well a couple of NEMA tank senders that quite happly talk to each other. If my memory servers we well,these three ( and others) over a CANBUS. Therefore, I suggest that these are using the NMEA 2000 protocol and it is them you should be concerned with.

Als, I am not sure that changing one electrical interface to another without changing the protocol is an infraction of the licence.
 
Err - hang on a minute here. I have a Seatalk network connected to a number Simnet instruments as well a couple of NEMA tank senders that quite happly talk to each other. If my memory servers we well,these three ( and others) over a CANBUS. Therefore, I suggest that these are using the NMEA 2000 protocol and it is them you should be concerned with.

Als, I am not sure that changing one electrical interface to another without changing the protocol is an infraction of the licence.

I have just noticed that Dzevo said stng1 which is not clear if it is old Seatalk 1 or the current Seatalk NG. The project described in this thread is old and interfaced with old Seatalk 1, not Seatalk NG.

You are right that your setup is all NMEA 2000 based.

There is an EU directive that allows protocols to be reversed engineered for interoperability purposes, and that applies to old Seatalk 1 and the current NMEA 2000 protocol. There has been a landmark testcase on this where third party software that interfaced with Skype protocols was challenged and found to be legal. Trademarks like Seatalk, Seatalk NG, Simnet and NMEA 2000 are protected and cannot be used by anyone else. Whether the UK law implemented to fulfil the EU directive still stands in UK law after B I don't know, but I expect it does.

NMEA 2000 has now been reverse engineered and there is an open source software library to interface to it.
 
Hello
Thanks again AngusMcDoon for fast answer... I made mistake in my first post i am searching nmea bridge converter for NMEA to st1 (seatalk) .
I need an old Autohelm 6000 autopilot control unit witch have NMEA protocol for communications between CPU and peripheral controller 6000.
Exist also Raymarine SeaTalk/NMEA interface box E85001 witch is also hard to find.... and YAPP project replace it this is why i am into build it.
I am trying to use new series Raymarine p70 control head (witch support seatalk protocol and STNG) to replace autohelm 6000 control unit, but need
convert NMEA otput sentences from AH6000 to Seatalk protocol, but I am wondering if this will work mean I need NMEA cpmands (+-1 +-10, Standby, Auto
and course data numeric azimut) I looked at Yapp projects and se NMEA senteces for .... bellow part from nmea.h file from st2nmea project.
typedef enum
{
NMEA_DPT,
NMEA_DBT,
NMEA_VHW,
NMEA_RSA,
NMEA_HDM,
NMEA_HDG,
NMEA_HDT,
NMEA_MTW,
NMEA_VLW,
NMEA_VWR,
NMEA_VWT,
NMEA_MWV,
NMEA_RMC,
NMEA_GLL,
// nmea add more message types here

If someone have a YAPP homemade-seatalk-to-usb-interface pcb to sell or finished project please PM.

Sorry for first post confusion I corrected the post.... regards
 

Attachments

  • 895_-1309868281.jpg
    895_-1309868281.jpg
    40.2 KB · Views: 3
  • AH6000 Z055 sch part off.JPG
    AH6000 Z055 sch part off.JPG
    133.2 KB · Views: 3
  • E85001.JPG
    E85001.JPG
    66.4 KB · Views: 3
Top