NMEA CheckSum Routine


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    I'll have a go,

    'mode 188 is 4800 baud @ 4MHz.


    '
    SendByte:
    serout2 portwhatever,188,[array_byte] 'send array byte
    return
    '
    cksum = 0
    array_byte = "$" 'send "$" qualifier
    gosub SendByte '
    For index = 1 to 35 '
    array_byte = WPT_array[index] 'copy array byte to serial buffer
    gosub SendByte 'send data byte
    cksum = cksum ^ array_byte 'calc checksum
    Next index '
    array_byte = "*" '
    gosub SendByte '
    array_byte = cksum 'load checksum into serial buffer
    gosub SendByte 'send checksum
    '

    Cheers, Art.

  2. #2
    Join Date
    Oct 2006
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: NMEA CheckSum Routine

    I have followed the the suggestion and i wrote this code that is now working in the magnetic compass.
    heading is my compass variable (001 ~359)
    crc is the nmea checksum

    crccalc:
    crc= "H"^"D"^"M"^"," ^ ((heading DIG 0)+"0") ^ ((heading DIG 1)+ "0") ^ ((heading DIG 2)+"0")^"."^ "0"
    Return

    the output is like this:
    $HDM,279.0*4F


    acjacques

Similar Threads

  1. Checksum
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th October 2009, 05:09
  2. Assembly-language checksum routine request
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 21st June 2006, 22:23
  3. NMEA checksum
    By Ron Marcus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd April 2006, 17:59
  4. Creating Checksum in PBP
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 16th March 2005, 05:49
  5. Checksum problem!
    By atomski in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd November 2004, 08:21

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts