Serial output problem using 08 NMEA simulator

yachtbits

New Member
The purpose of this is to simulate NMEA 0183 format heading information that would normally be provided from an electronic compass used on a boat.

What I'm trying to achieve is,
output from the serial out a single, fixed data string. Then after a short delay, loop back to repeat.

The format for the data string needs to be as follows;

$KMHDM,0.0,M*00<CR><LF>

I have it all working okay apart from the <CR><LF> at end of the data string.
These represent <Carriage Return> and <Line Feed>. These are crucial to making it work.

Any ideas how I get the 08 to output <CR><LF> at the end of the string?

All help greatly appreciated.

kev
 

andrewpro

New Member
the cr and lf I believe are ascii characters 13 and 11 respectively (I could have that backwards, but I dont think so). You could try sending them. How are you reading the serial data? Is it in a terminal program?
 

yachtbits

New Member
for testing purposes, hyperterminal is being used. I can get it outputting the data, but not CR or LF.

Ulimatelty, the device will be connected to a Radar display to simulate Magnetic North Heading data.

Looked up ASCII codes and 10 & 13 are what I need, how do I put them into the string? current code is,

label_6: pause 500
SERTXD ("$KMHDM,000,M*00")
goto label_6

Cheers Kev

 

Simmicht

Senior Member
Cr LF is characters 13 and 10 respectively

I was wanting to do nearly the same thing. How is the check digit calculated?

SERTXD ("$KMHDM,000,M*00",13,10)
 

Edited by - simmicht on 4/13/2005 11:35:02 PM
 

yachtbits

New Member
just programmed using suggestion by simmicht and it looks spot on with hyperterminal. I will test it on the radar system over the weekend and will report back afterwards.

As for check sum calculation, I can't say I know. I connected a NMEA compass to hyperterminal and then swung it to read 0 degrees. checksum at that heading was 00!

But I have found this explination in a GPS manual, I would think it would be the same for all strings, but this did apply to GPS strings. The manual and a similar explination was found on google using NMEA CHECK SUM.

Checksum Field: The absolute value calculated by exclusive-OR the 8 data bits of
each character in the Sentence,between, but excluding “$” and “*”.
The hexadecimal value of the most significant and least significant
4 bits of the result are convertted to two ASCII characters ( 0-9,A-F ) for transmission. The most significant character is transmitted first.
 
Top