Data transfer error checking protocols
Archiver
Posts: 46,084
I'm transferring data in an AT45, wirelessly via a BS2p40 and I'm
wondering if there is any code (CRC-XModem, ZModem, or checksums?)
in PBasic that anyone has used to ensure data integrity? Using
parity can let too many errors slip through. Would certainly
appreciate any input on this issue.
Kind Regards,
Eric
wondering if there is any code (CRC-XModem, ZModem, or checksums?)
in PBasic that anyone has used to ensure data integrity? Using
parity can let too many errors slip through. Would certainly
appreciate any input on this issue.
Kind Regards,
Eric
Comments
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=kvUuGqiBPOmqC-MGUm-w_ium3WX37bhZUPEjEb49hgjhx_FE_aaK4sSo90vL-NvbPvjy1GKSM6ZO6A]khufumen@y...[/url
Sent: Monday, July 05, 2004 11:28 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Data transfer error checking protocols
I'm transferring data in an AT45, wirelessly via a BS2p40 and I'm
wondering if there is any code (CRC-XModem, ZModem, or checksums?)
in PBasic that anyone has used to ensure data integrity? Using
parity can let too many errors slip through. Would certainly
appreciate any input on this issue.
Kind Regards,
Eric
there was any confusion regarding the Surelink modules (I've not worked
with them personally, so I can't give any details).
Jon Williams
Parallax
Original Message
From: Jon Williams
Sent: Tuesday, July 06, 2004 6:57 AM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error checking protocols
Nothing built in; you would have to code it yourself.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=UMw22lZVcvMiFDtrJZ4nf0Rd6g43aYqYH0sVwOE3kdFSiSt8G0ScKal8a8rFh9Negf621sMFA09V]khufumen@y...[/url
Sent: Monday, July 05, 2004 11:28 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Data transfer error checking protocols
I'm transferring data in an AT45, wirelessly via a BS2p40 and I'm
wondering if there is any code (CRC-XModem, ZModem, or checksums?)
in PBasic that anyone has used to ensure data integrity? Using
parity can let too many errors slip through. Would certainly
appreciate any input on this issue.
Kind Regards,
Eric
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Yahoo! Groups Links
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
byte checksum. 65535 divided by 255 gives me 257 bytes
I can add up and then send as a check sum. Should be
able to detect most of the errors. I looked at the
SureLink RF modules but I already have a wirless CDMA
modem that I am using.
Eric
--- Jon Williams <jwilliams@p...> wrote:
> Let me correct myself -- I was referring to the
> BASIC Stamp; sorry if
> there was any confusion regarding the Surelink
> modules (I've not worked
> with them personally, so I can't give any details).
>
> Jon Williams
> Parallax
>
>
>
Original Message
> From: Jon Williams
> Sent: Tuesday, July 06, 2004 6:57 AM
> To: basicstamps@yahoogroups.com
> Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error
> checking protocols
>
>
> Nothing built in; you would have to code it
> yourself.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=pnpMwOoUDMug0g1fTNuwft3Gk-ax6VuEcWpJuOQHSiQ7SzvBc86_wELXNAF9BXMP-CQIzQNjTjaiZnk]khufumen@y...[/url
> Sent: Monday, July 05, 2004 11:28 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Data transfer error checking
> protocols
>
>
> I'm transferring data in an AT45, wirelessly via a
> BS2p40 and I'm
> wondering if there is any code (CRC-XModem, ZModem,
> or checksums?)
> in PBasic that anyone has used to ensure data
> integrity? Using
> parity can let too many errors slip through. Would
> certainly
> appreciate any input on this issue.
>
> Kind Regards,
> Eric
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed.
> Text in the Subject
> and Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> This message has been scanned by WebShield. Please
> report SPAM to
> abuse@p....
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed.
> Text in the Subject and Body of the message will be
> ignored.
>
> Yahoo! Groups Links
>
>
> basicstamps-unsubscribe@yahoogroups.com
>
>
>
>
Start with a checksum (word) = 0
Then add the outgoing bytes, each after the preceeding, to the checksum.
Don't bother for overflows.
When finished, send the checksum word.
At the receiving side, the checksum is made similarly and then checked with the original (two last bytes)
Regards
ECO
Original Message
From: "Eric" <khufumen@y...>
To: <basicstamps@yahoogroups.com>
Sent: Tuesday, July 06, 2004 4:41 PM
Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error checking protocols
> Well, I think I'll make do for the time being with a 2
> byte checksum. 65535 divided by 255 gives me 257 bytes
> I can add up and then send as a check sum. Should be
> able to detect most of the errors. I looked at the
> SureLink RF modules but I already have a wirless CDMA
> modem that I am using.
>
> Eric
>
>
> --- Jon Williams <jwilliams@p...> wrote:
> > Let me correct myself -- I was referring to the
> > BASIC Stamp; sorry if
> > there was any confusion regarding the Surelink
> > modules (I've not worked
> > with them personally, so I can't give any details).
> >
> > Jon Williams
> > Parallax
> >
> >
> >
Original Message
> > From: Jon Williams
> > Sent: Tuesday, July 06, 2004 6:57 AM
> > To: basicstamps@yahoogroups.com
> > Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error
> > checking protocols
> >
> >
> > Nothing built in; you would have to code it
> > yourself.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=BDrj8AFbbTI8-oZLPdcOKiwEQKdSOu45-OXOhdLO216m9T8zh8viXHdPuu5-OQRQLq_B3MwiaqZsbA]khufumen@y...[/url
> > Sent: Monday, July 05, 2004 11:28 PM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] Data transfer error checking
> > protocols
> >
> >
> > I'm transferring data in an AT45, wirelessly via a
> > BS2p40 and I'm
> > wondering if there is any code (CRC-XModem, ZModem,
> > or checksums?)
> > in PBasic that anyone has used to ensure data
> > integrity? Using
> > parity can let too many errors slip through. Would
> > certainly
> > appreciate any input on this issue.
> >
> > Kind Regards,
> > Eric
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed.
> > Text in the Subject
> > and Body of the message will be ignored.
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please
> > report SPAM to
> > abuse@p....
> >
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed.
> > Text in the Subject and Body of the message will be
> > ignored.
> >
> > Yahoo! Groups Links
> >
> >
> > basicstamps-unsubscribe@yahoogroups.com
> >
> >
> >
> >
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>
program. The device sends a big packet up to a PC program. I can't
explain the code ... it was given to me (in VB form) by a friend. It
did work, though. I've cleaned up the formatting and made it $PBASIC
2.5 compatible. In the program, the constant called CrcPoly is defined
as $A001.
' ***************************************
' calculate 16-bit CRC of upload packet
' ***************************************
'
Do_CRC:
tmpCRC = dByte ^ (crc & $FF)
crc = (crc & $FF00) | (tmpCRC & $00FF)
FOR x = 0 TO 7
tmpCRC = crc & $0001
crc = ((crc & $FFFE) / 2) & $7FFF
IF (tmpCRC > 0) THEN
crc = crc ^ CrcPoly
ENDIF
NEXT
RETURN
In the program, crc (a Word) is initialized to 0 before a loop goes
through all the bytes of the packet. Each of the packet bytes is sent
to this routine in dByte.
HTH.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=MH6zVxkK7rPSctq5XsW15M7tfcsZd9FMMaHDSxPmhZAXmI7P8WJ4Og9qz2saV8_XEDKXDUa_WMs]khufumen@y...[/url
Sent: Tuesday, July 06, 2004 9:41 AM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error checking protocols
Well, I think I'll make do for the time being with a 2
byte checksum. 65535 divided by 255 gives me 257 bytes
I can add up and then send as a check sum. Should be
able to detect most of the errors. I looked at the
SureLink RF modules but I already have a wirless CDMA
modem that I am using.
Eric
This is exactly what I was after. I shall run some
tests on the code. Interestingly enough, the recent
issue of the Economist has an article on coding theory
and how the Cassini spacecraft in Saturn's orbit is
able to send back information through the noisy vacuum
of space and have it received accurately using
sophisticated error checking routines.
Eric
--- Jon Williams <jwilliams@p...> wrote:
> I don't know if this will be helpful at all, but I
> found it in an old
> program. The device sends a big packet up to a PC
> program. I can't
> explain the code ... it was given to me (in VB form)
> by a friend. It
> did work, though. I've cleaned up the formatting
> and made it $PBASIC
> 2.5 compatible. In the program, the constant called
> CrcPoly is defined
> as $A001.
>
> ' ***************************************
> ' calculate 16-bit CRC of upload packet
> ' ***************************************
> '
> Do_CRC:
> tmpCRC = dByte ^ (crc & $FF)
> crc = (crc & $FF00) | (tmpCRC & $00FF)
> FOR x = 0 TO 7
> tmpCRC = crc & $0001
> crc = ((crc & $FFFE) / 2) & $7FFF
> IF (tmpCRC > 0) THEN
> crc = crc ^ CrcPoly
> ENDIF
> NEXT
> RETURN
>
> In the program, crc (a Word) is initialized to 0
> before a loop goes
> through all the bytes of the packet. Each of the
> packet bytes is sent
> to this routine in dByte.
>
> HTH.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
>
Original Message
> From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=z1h0XUmwKINHW0yQX-VsiLo2J5j6BgGJOPIB_IAG8kfM89hNCIVLLb_esNuY4oFD2kbhwHi1pzPD]khufumen@y...[/url
> Sent: Tuesday, July 06, 2004 9:41 AM
> To: basicstamps@yahoogroups.com
> Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error
> checking protocols
>
>
> Well, I think I'll make do for the time being with a
> 2
> byte checksum. 65535 divided by 255 gives me 257
> bytes
> I can add up and then send as a check sum. Should be
> able to detect most of the errors. I looked at the
> SureLink RF modules but I already have a wirless
> CDMA
> modem that I am using.
>
> Eric
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed.
> Text in the Subject and Body of the message will be
> ignored.
>
> Yahoo! Groups Links
>
>
> basicstamps-unsubscribe@yahoogroups.com
>
>
>
>
the error *detecting* codes that were originally requested here. The two are
really quite different. Error detection is easier to implement and, assuming
that the data can be resent, more appropriate for most purposes.
>
Original Message
> From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=a1CNlLEnnY7yQLrYOrYZBv0ps6vGT-tbXsC021vv9d7sStGD0tqgBNFJJnYetasW8F7mi0jUfUyYPcQjhw]khufumen@y...[/url
> Sent: July 7, 2004 08:56
> To: basicstamps@yahoogroups.com
> Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error checking protocols
>
> Thanks Jon,
> This is exactly what I was after. I shall run some
> tests on the code. Interestingly enough, the recent
> issue of the Economist has an article on coding theory
> and how the Cassini spacecraft in Saturn's orbit is
> able to send back information through the noisy vacuum
> of space and have it received accurately using
> sophisticated error checking routines.
>
> Eric
--- Ken Strauss <ken.strauss@s...> wrote:
> I believe that the Cassini project uses error
> *correcting* codes instead of
> the error *detecting* codes that were originally
> requested here. The two are
> really quite different. Error detection is easier to
> implement and, assuming
> that the data can be resent, more appropriate for
> most purposes.
>
> >
Original Message
> > From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=qb288QsrLM-HvSiYmzOdfIZyNaFpgZEioq27W1WrvBaNq_brxFq-A_zgnqAA4RhZ12Y8zpLjd5MKxoVcCQ]khufumen@y...[/url
> > Sent: July 7, 2004 08:56
> > To: basicstamps@yahoogroups.com
> > Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error
> checking protocols
> >
> > Thanks Jon,
> > This is exactly what I was after. I shall run some
> > tests on the code. Interestingly enough, the
> recent
> > issue of the Economist has an article on coding
> theory
> > and how the Cassini spacecraft in Saturn's orbit
> is
> > able to send back information through the noisy
> vacuum
> > of space and have it received accurately using
> > sophisticated error checking routines.
> >
> > Eric
>
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed.
> Text in the Subject and Body of the message will be
> ignored.
>
> Yahoo! Groups Links
>
>
> basicstamps-unsubscribe@yahoogroups.com
>
>
>
>
detection/correction codecs work, here's a pretty good tutorial. I think for
most Stamp projects a simple CRC or parity check that tells you to resend
the block of data would be sufficient. But hamming encoded data carries
enough redundancy that the original information can be recovered from a
corrupted data block. It's a fascinating thing to think about, even if you
don't have an immediate application.
http://www.comlab.hut.fi/opetus/227/2002/lecture1.ppt
Mike Sokol
mike@f...
Original Message
From: "Eric" <khufumen@y...>
To: <basicstamps@yahoogroups.com>
Sent: Wednesday, July 07, 2004 11:22 AM
Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error checking protocols
> I stand corrected.
>
> --- Ken Strauss <ken.strauss@s...> wrote:
> > I believe that the Cassini project uses error
> > *correcting* codes instead of
> > the error *detecting* codes that were originally
> > requested here. The two are
> > really quite different. Error detection is easier to
> > implement and, assuming
> > that the data can be resent, more appropriate for
> > most purposes.
> >
> > >
Original Message
> > > From: Eric [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=tRvcYPrr81plBMoIkvKtaCj-aDKD0Nit54z8ecoTCFnEWqeaOOMKHuWzNxn7wBn1S0iAKF-3ggY]khufumen@y...[/url
> > > Sent: July 7, 2004 08:56
> > > To: basicstamps@yahoogroups.com
> > > Subject: RE: [noparse][[/noparse]basicstamps] Data transfer error
> > checking protocols
> > >
> > > Thanks Jon,
> > > This is exactly what I was after. I shall run some
> > > tests on the code. Interestingly enough, the
> > recent
> > > issue of the Economist has an article on coding
> > theory
> > > and how the Cassini spacecraft in Saturn's orbit
> > is
> > > able to send back information through the noisy
> > vacuum
> > > of space and have it received accurately using
> > > sophisticated error checking routines.
> > >
> > > Eric
> >
> >
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed.
> > Text in the Subject and Body of the message will be
> > ignored.
> >
> > Yahoo! Groups Links
> >
> >
> > basicstamps-unsubscribe@yahoogroups.com
> >
> >
> >
> >
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
> Yahoo! Groups Links
>
>
>
>
>
>