Go Down

Topic: Serial communication between Gyro and compass repeater (Read 992 times) previous topic - next topic

scoobsalamander

I have a gyro compass (Octans) wich is sending a data string to a compass repeater and also many other applications.

The data string looks like this :

$HEHDT,123.45,Txx
SHEROT,123.45,Txx
$HEHDT,123.45,Txx
SHEROT,123.45,Txx

(HEHDT = heading, HEROT = Rate of Turn, xx = checksum)

The problem is that the repeater doesn't understand this because it is expecting only the heading, when the repeater receives both values he doesn't know what to show on the compass rose. Sometimes the value of the ROT is displayed instead of the heading.
Changing the output protocol on the Octans Gyro isn't possible because al the other applications do need the ROT signal.

Is it possible to read the string into an Arduino (Uno) and then remove the ROT line and send it out again (on a second serial port) with only the heading line in the string?

I don't need a complete solution (for now), but I realy don't know how to start with this. Maybe someone can point me already in the good direction?

Thx in advance

PaulS

Quote
Is it possible to read the string into an Arduino (Uno)

Yes, it is.

Quote
and then remove the ROT line

The ROT portion is not a line, but, you can parse the string (strtok() would be useful), and assemble an array of characters to send.

Quote
and send it out again (on a second serial port)

Have you counted serial ports on the Uno? There is one.

You could, however, use NewSoftSerial to create a software serial port, to send data out. Whatever you are sending it to needs to be connected to the appropriate pins (and ground).

tastewar

And if it's RS-232 level serial, you'll need a converter chip, e.g. MAX232.

scoobsalamander

#3
May 15, 2011, 07:47 pm Last Edit: May 16, 2011, 01:56 am by scoobsalamander Reason: 1
I know that the Arduino is not equiped with multiple serial ports but due to the fact that it is RS422 (instead of RS232) I will have to use two MAX485's I suppose.
But first of all I will take a look at the strtok() - thing...

thanks for the quick respond

wildbill

It might be possible to get away with one serial port - RX comes from the gyro, TX goes to the repeater with the editted string.

Go Up