Pages: 1 2 [3] 4 5 6   Go Down
Author Topic: Asynchronous SeaTalk  (Read 14256 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

David,
I bought a 2X16 Dfrobot LCD which has 6 buttons.  They combine resistors to affect output voltage running down a wire to A0 and then there's some code that recognizes which button was pushed based on the voltage - two wires instead of many.

and you could have it recognize combinations of buttons too.

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

to use one port it looks as though one needs to switch  back and forth from 8-bit to 9-bit mode.  I have it doing this, but i'm seeing only part of the datagrams.  Likely the right way is to read with it set to 9bits until you have a complete qualified datagram, do the parsing routines, format the data, THEN switch the port to 8 bit and send it on its way - back and forth.  I'm dealing with only two seatalkers, wind and depth, so i won't miss much in the time it should take to do this.

this part will be difficult for me.

best,  john
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My take on Nick's excellent code is that it will require a mega, which has three serial ports.

I tested on a Mega because it was convenient, but it should work on a Uno, as you discovered.

to use one port it looks as though one needs to switch  back and forth from 8-bit to 9-bit mode.

I don't quite understand this part.

In any case if you have two seatalkers, I suggest the Mega. Don't overcomplicate things just to save $20.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


The seatalk talkers are connected to a single backbone and each device adds its message (for example speed in one case, wind direction in another) to the serial backbone --so, there's just one serial port needed for reading the seatalk data. 

What I don't get is why john can't read from the hardware port set to work with 9 bits (thanks again Nick) and send data to where ever needs 8 bits via a software serial port.    I'm probably missing something easy here.

That 2x16 LCD with buttons is definitely cool (duhhh, use an analog pin and some resistors) but it won't save any pins compared to the sparkfun 2x16 LCD that I have now because mine is a serial LCD and the DFRobot one with buttons looks like it needs 7 digital pins just to run the LCD (at $18 its super cheap though!).  Have you seen one like it with a serial connection? 

David
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What I don't get is why john can't read from the hardware port set to work with 9 bits (thanks again Nick) and send data to where ever needs 8 bits via a software serial port. 

He should be able to do that.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys,
Nick is right, i should be able to read with Nick's hardwareserial and write to softwareserial and it IS working, but there seems to be a synchronization issue (mine not Nick's) - might need to jiggle the delay().  I'm having some trouble with vision and some of my problems are with hardware misconstruction.  My drive to make compact hardware seems to be in direct conflict with getting it right.  I suspect that I'm going to build my hardware interface bigger and more spread out so i can better see misconnections.  then when I'm sure i have it running right, build the final box for installation.

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This evening's discovery was that the 5 volt supply from the Uno isn't quite enough for the max232, the compass, and the gps module (Duh). The voltage drop was enough to make it intermittent the way I have it hooked up, so tomorrow a 5 volt regulator get's hung off the 12 volt feed from the seatalk system and I should be back to solving software problems.

john
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi Dave,
After the convulsions attendant on discovering that the loader routine for the Mega 2560 doesn't work quite right on Ubuntu 10.10, but does on Windows, that the Sparkfun UNO shield i was using also doesn't work quite right with ports used for softwareserial, and making headers to connect to the mega, AND getting it to work, I'm back to seatalk.   I'm going to try migrating the listen parts of Frank Wallenwein.s code to the 2560.  I need the collision detection and this seems the most efficient way to get it given that i don't know what i'm doing.  I have two seatalk devices and so have to deal with collisions.

have you enjoyed any progress with any of this?

john

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

John,

I'm still very keen on this project but you are way ahead of me -- work and family have limited my ability to do much of anything this week and I'm traveling next week so I am going to be useless for a while. 

In fact, I'm a bit clueless about the need for collision detection.  I would have thought that the SeaTalk bus would have a string of statements that could be read and parsed to find the ones you want but obviously that isn't correct.

So, I offer encouragement but contribute nothing! 

Cheers,


David
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are using the Mega, can't you connect different units to different serial ports?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nick, yes. different things on different ports, but the odd thing was that ubuntu 10.10 arduino 1.0 iDE worked fine with the UNO but wouldn't correctly program the MEGA.  Windows arduino 1.0 does program fine.  I reloaded every conceivable part of the software but no joy - so 2 or 3 days lost.  I don't like windows much, but I'm glad I kept it for the two things that ubuntu doesn't do well.

Now I'm going to build a simpler level changer for the incoming seatalk sentences and then mess with your software til i get it right.  it will take a few more days.  I am retired, but still have other obligations and sometimes i just fall into a no-progress loop.

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hardware fixed.  board DOES need the 12 volts it would have gotten if the + lead had not become disconnected.

Since we only need to read seatalk, I need to better understand how Nick's code reads. Right now I'm seeing lots of zeros and an occasional 40 which suggests that there is still a problem with collision detection and beginning of datagram identification.

john
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

David,
you don't need to buy dfrobot's lcd to get buttons and resistors.  make your own. you can download their schematic to see how they did it.  

my repeater is going to be in the v-berth where we sleep.  it will have a 4x20 line serial lcd and the buttons.  the arduino will be up near the helm where the seatalk signals are, the compass will be compensated, and the gps gets good signal.

I'm planning a small 12 volt to 5 volt power supply for the repeater for the lcd and the buttons thinking that the 2 way voltage drop running from the bridge to the v-berth and back may be a little much. I'm assuming that the logic signals to the lcd can stand the distance.

john
« Last Edit: February 19, 2012, 11:47:43 am by jferg » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

David,
I'm giving up on the SeaTalk interface.  Since I have Wallenwein's NMEA-SeaTalk bridge, I need only bring in the rs-232 output with its NMEA sentences and siphon the wind, and depth data from that.  I had thought it would be more elegant to monitor the seatalk bus directly, but am completely unable to get usable datagrams which i can see.

I built the level changer and it does work, I think. I would have thought i could read the seatalk datagrams with the level changer, which after much fussing, I'm certain is built correctly.  they could very well have been received but not being able to output them to a terminal where I can look at them, means that I cannot concoct the code i need to parse them.  The problem could well be the limitations of the terminal programs I'm using Terraterm on the pc, Moserial and Serialport terminal on Ubuntu Linux.  Maybe there's another one which is more amenable to 9 bit/ 11 bit bytes.

I am not able to see anything using Knauth's dos monitor program. Maybe this suggests that I've screwed up the converter- don't know.  In any case, Wallenwein's bridge can read the seatalk ok, so I know the wiring is ok.

Using SerialPort, I was able to record a stream of hex data from the Seatalk bus. There were sufficient repetitive byte sequences to make me think that real data are going by but the actual hex codes don't appear to be seatalk - nothing recognizable.  

The Wallenwein code is voluminous and written for the atmega16.  I at first thought I would go through it and change the various atmega16 specific  elements to mega 2560.  This doesn't look impossible, but after doing a couple of the library files, i realized that this could take a lot of time and for me, with my profound ignorance, maybe way too much time.

I'd love to find someone who has built the level changer, run Knauth's dos monitor on a seatalk line connected to more than one sender and had it work.

I even keep an old Compaq M300 around just so i can have a (gasp) real rs-232 port.

In any case, good luck with your project. Thanks, Nick for your efforts.  



« Last Edit: February 20, 2012, 12:17:53 pm by jferg » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 64
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oops. I built another level changer and this one works with the dos programs which Thomas Knauth has on his site, so back to experimenting with Nick's 9 bit reader.  maybe i will get it eventually.  No, i have no idea what was wrong with the first two converters i made, possibly bad transistors?

One other thing.  The SeaTalk bus shouldn't have anything else connected to it (the NMEA Bridge for example).  It looks like this is where the signals were going.  It should be ok if it is powered up, but in my testing it wasn't.
« Last Edit: February 20, 2012, 01:50:51 pm by jferg » Logged

Pages: 1 2 [3] 4 5 6   Go Up
Jump to: