[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Re: Re: CRC16
--------------090204050601030403050208
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I did the same with some PIC's a while back and used the RS485 4 wire
approach with a master at the PC, though I've since replaced them with
Ethernet connected devices.
The thing that took the most time was the code for the master to
recognise which devices were on the '485 bus and filter accordingly and
the ring buffer for thexAP messages. The broadcast nature of many xAP
messages is both a blessing and a curse! The 'on the wire' was native
xAP. It seems a shame if there's lots of people developing for RS485 but
using a coded message structure that there'll be no interoperability.
If I was looking at 2 wire again, I'd go CAN BUS with a coded structure,
probably based on J1739/14 and not VSCP - which seems to be in the
doldrums from what I can see of the webpages but I may be wrong.
Lehane
On 07/11/2011 02:27, hillbillies@xxxxxxx wrote:
>
>
> Hi Neil, My current thoughts are to send the whole xAP message across
> the RS485 link. RS485 does not do a very good job of detecting bus
> activity so I'm using the electrical specs from J1708. This then
> allows me to use the code from the YASP project to do Carrier Sense
> Multiple Access / Collision Detection (got the hint from Paul's
> www.bazautomation.com site). The xAP message decoding comes from
> DBZoo's Arduino project. Hopefully this will all fit in a ATmega32U4.
> The prototype board I'm working on is a Teensy from www.pjrc.com.
>
> Currently I have the J1708 interface working and the xAP decode
> working. Hopefully in the next couple of days the transit side will
> be working. Then I need a bridge - based on Patrick's serial bridge
> that will interface to one of my boards to do the half duplex message
> translation from ethernet.
>
> I decided that putting full xAP protocol over the wire was going to
> be easier as then the PC end does not have to do any conversions. I
> think that the bridge will only stop heartbeats, but everything else
> will get through. The AVR can then decide what it wants to do with
> the message. At the moment I think that I can limit the AVR TX
> message length to 256 bytes and the receive length to 512 bytes
> (maybe longer once all the code is in the AVR).
>
> Cheers Alan NZ --- In xAP_developer@xxxxxxx
> <mailto:xAP_developer%40yahoogroups.com>,
"Neil Wrightson"
> <neilw@...> wrote:
> >
> > Hi Alan,
> >
> >
> >
> > What RS485 protocol are you referring to?
> >
> >
> >
> > I'm also doing some xAP stuff using AVR's. I'm creating a gateway
> > that converts between the Ethernet and the RS485 network.
> >
> > It uses a AVR (Mega128) as the go between. From here it then
talks
> > to the RS485 AVR slaves using my own protocol.
> >
> > I found it easier to implememnt this way. Less xAP actually on
the
> > RS485 network.
> >
> >
> >
> > Regards,
> >
> > Neil Wrightson.
> >
> > Australia.
> >
> > From: xAP_developer@xxxxxxx
> > <mailto:xAP_developer%40yahoogroups.com>
> > [mailto:xAP_developer@xxxxxxx
> > <mailto:xAP_developer%40yahoogroups.com>]
On Behalf Of
> > hillbillies@... Sent: Monday, 7 November 2011 11:20 AM To:
> > xAP_developer@xxxxxxx
> > <mailto:xAP_developer%40yahoogroups.com>
Subject: [xAP_developer]
> > CRC16
> >
> >
> >
> >
> >
> > Hi Everybody,
> >
> > New to the group, I only started looking xAP about a month ago.
> >
> > I'm developing a RS485 style network with AVR devices. The wire
> > protocol should allow me to detect collisions but I would like to
> > put CRC16 error checking into the devices. Although the Protocol
> > definition talks about CRC16, it doesn't state which polynomial
is
> > the preferred one.
> >
> > The AVR libraries have have already coded:
> >
> > Optimized CRC-16 calculation. Polynomial: x^16 + x^15 + x^2 + 1
> > (0xa001) Initial value: 0xffff
> >
> > Optimized CRC-CCITT calculation. Polynomial: x^16 + x^12 + x^5 +
1
> > (0x8408) Initial value: 0xffff
> >
> > Optimized Dallas (now Maxim) iButton 8-bit CRC calculation.
> > Polynomial: x^8 + x^5 + x^4 + 1 (0x8C) Initial value: 0x0
> >
> > Optimized CRC-XMODEM calculation. Polynomial: x^16 + x^12 + x^5 +
1
> > (0x1021) Initial value: 0x0
> >
> > Can anyone give me a pointer on which way to go?
> >
> > Thanks
> >
> > Alan
> >
>
>
--------------090204050601030403050208
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<head>
<style type="text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<!-- **begin egp html banner** -->
<br><br>
<!-- **end egp html banner** -->
I did the same with some PIC's a while back and used the RS485 4
wire approach with a master at the PC, though I've since replaced
them with Ethernet connected devices.<br>
<br>
The thing that took the most time was the code for the master to
recognise which devices were on the '485 bus and filter accordingly
and the ring buffer for thexAP messages. The broadcast nature of
many xAP messages is both a blessing and a curse! The 'on the wire'
was native xAP. It seems a shame if there's lots of people
developing for RS485 but using a coded message structure that
there'll be no interoperability.<br>
<br>
If I was looking at 2 wire again, I'd go CAN BUS with a coded
structure, probably based on J1739/14 and not VSCP - which seems to
be in the doldrums from what I can see of the webpages but I may be
wrong.<br>
<br>
Lehane<br>
<br>
<br>
<br>
<br>
<br>
On 07/11/2011 02:27, <a class="moz-txt-link-abbreviated"
href="mailto:hillbillies@xxxxxxx">hillbillies@xxxxxxx</a>
wrote:<br>
<span style="white-space: pre;">> <br>
> <br>
> Hi Neil, My current thoughts are to send the whole xAP
message across<br>
> the RS485 link. RS485 does not do a very good job of
detecting bus<br>
> activity so I'm using the electrical specs from J1708. This
then<br>
> allows me to use the code from the YASP project to do Carrier
Sense<br>
> Multiple Access / Collision Detection (got the hint from
Paul's<br>
> <a class="moz-txt-link-abbreviated" href="http://www.bazautomation.com">www.bazautomation.com</a>
site). The xAP message decoding comes
from<br>
> DBZoo's Arduino project. Hopefully this will all fit in a
ATmega32U4.<br>
> The prototype board I'm working on is a Teensy from
<a class="moz-txt-link-abbreviated" href="http://www.pjrc.com">www.pjrc.com</a>.<br>
> <br>
> Currently I have the J1708 interface working and the xAP
decode<br>
> working. Hopefully in the next couple of days the transit
side will<br>
> be working. Then I need a bridge - based on Patrick's serial
bridge<br>
> that will interface to one of my boards to do the half duplex
message<br>
> translation from ethernet.<br>
> <br>
> I decided that putting full xAP protocol over the wire was
going to<br>
> be easier as then the PC end does not have to do any
conversions. I<br>
> think that the bridge will only stop heartbeats, but
everything else<br>
> will get through. The AVR can then decide what it wants to do
with<br>
> the message. At the moment I think that I can limit the AVR
TX<br>
> message length to 256 bytes and the receive length to 512
bytes<br>
> (maybe longer once all the code is in the AVR).<br>
> <br>
> Cheers Alan NZ --- In <a
class="moz-txt-link-abbreviated" href="mailto:xAP_developer@xxxxxxx">xAP_developer@xxxxxxx</a><br>
> <a class="moz-txt-link-rfc2396E" href="mailto:xAP_developer%40yahoogroups.com"><mailto:xAP_developer%40yahoogroups.com></a>,
"Neil
Wrightson"<br>
> <a class="moz-txt-link-rfc2396E" href="mailto:neilw@..."><neilw@...></a>
wrote:<br>
>> <br>
>> Hi Alan,<br>
>> <br>
>> <br>
>> <br>
>> What RS485 protocol are you referring to?<br>
>> <br>
>> <br>
>> <br>
>> I'm also doing some xAP stuff using AVR's. I'm creating a
gateway<br>
>> that converts between the Ethernet and the RS485
network.<br>
>> <br>
>> It uses a AVR (Mega128) as the go between. From here it
then talks<br>
>> to the RS485 AVR slaves using my own protocol.<br>
>> <br>
>> I found it easier to implememnt this way. Less xAP
actually on the<br>
>> RS485 network.<br>
>> <br>
>> <br>
>> <br>
>> Regards,<br>
>> <br>
>> Neil Wrightson.<br>
>> <br>
>> Australia.<br>
>> <br>
>> From: <a class="moz-txt-link-abbreviated"
href="mailto:xAP_developer@xxxxxxx">xAP_developer@xxxxxxx</a><br>
>> <a class="moz-txt-link-rfc2396E"
href="mailto:xAP_developer%40yahoogroups.com"><mailto:xAP_developer%40yahoogroups.com></a><br>
>> [<a class="moz-txt-link-freetext"
href="mailto:xAP_developer@xxxxxxx">mailto:xAP_developer@xxxxxxx</a><br>
>> <a class="moz-txt-link-rfc2396E"
href="mailto:xAP_developer%40yahoogroups.com"><mailto:xAP_developer%40yahoogroups.com></a>]
On Behalf
Of<br>
>> hillbillies@... Sent: Monday, 7 November 2011 11:20 AM
To:<br>
>> <a class="moz-txt-link-abbreviated"
href="mailto:xAP_developer@xxxxxxx">xAP_developer@xxxxxxx</a><br>
>> <a class="moz-txt-link-rfc2396E"
href="mailto:xAP_developer%40yahoogroups.com"><mailto:xAP_developer%40yahoogroups.com></a>
Subject:
[xAP_developer]<br>
>> CRC16<br>
>> <br>
>> <br>
>> <br>
>> <br>
>> <br>
>> Hi Everybody,<br>
>> <br>
>> New to the group, I only started looking xAP about a
month ago.<br>
>> <br>
>> I'm developing a RS485 style network with AVR devices.
The wire<br>
>> protocol should allow me to detect collisions but I would
like to<br>
>> put CRC16 error checking into the devices. Although the
Protocol<br>
>> definition talks about CRC16, it doesn't state which
polynomial is<br>
>> the preferred one.<br>
>> <br>
>> The AVR libraries have have already coded:<br>
>> <br>
>> Optimized CRC-16 calculation. Polynomial: x^16 + x^15 +
x^2 + 1<br>
>> (0xa001) Initial value: 0xffff<br>
>> <br>
>> Optimized CRC-CCITT calculation. Polynomial: x^16 + x^12
+ x^5 + 1<br>
>> (0x8408) Initial value: 0xffff<br>
>> <br>
>> Optimized Dallas (now Maxim) iButton 8-bit CRC
calculation. <br>
>> Polynomial: x^8 + x^5 + x^4 + 1 (0x8C) Initial value:
0x0<br>
>> <br>
>> Optimized CRC-XMODEM calculation. Polynomial: x^16 + x^12
+ x^5 + 1<br>
>> (0x1021) Initial value: 0x0<br>
>> <br>
>> Can anyone give me a pointer on which way to go?<br>
>> <br>
>> Thanks<br>
>> <br>
>> Alan<br>
>> <br>
> <br>
> </span><br>
<br>
<br>
<!-- **begin egp html banner** -->
<br>
<br>
<!-- **end egp html banner** -->
<div width="1" style="color: white; clear:
both;"/>__._,_.___</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- **begin egp html banner** -->
<img src="http://geo.yahoo.com/serv?s=97476590/grpId=9629476/grpspId=1705007709/msgId=2217/stime=1320661866"
width="1" height="1"> <br>
<!-- **end egp html banner** -->
<!-- **begin egp html banner** -->
<br>
<div style="font-family: verdana; font-size: 77%; border-top: 1px
solid #666; padding: 5px 0;" >
Your email settings: Individual EmailTraditional <br>
<a href="http://groups.yahoo.com/group/xAP_developer/join;_ylc=X3oDMTJmZ3Q3bzY3BF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEzMjA2NjE4NjY-">Change
settings via the Web</a> (Yahoo! ID required) <br>
Change settings via email: <a href="mailto:xAP_developer-digest@xxxxxxx?subject=Email
Delivery: Digest">Switch delivery to Daily Digest</a> <a
href = "mailto:xAP_developer-fullfeatured@xxxxxxx?subject=Change
Delivery Format: Fully Featured">Switch to Fully Featured</a>
<br>
<a href="http://groups.yahoo.com/group/xAP_developer;_ylc=X3oDMTJkOTM4dHEwBF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMzIwNjYxODY2">
Visit Your Group
</a>
<a href="http://docs.yahoo.com/info/terms/">
Yahoo! Groups Terms of Use
</a>
<a href="mailto:xAP_developer-unsubscribe@xxxxxxx?subject=Unsubscribe">
Unsubscribe
</a>
<br>
</div>
<br>
<!-- **end egp html banner** -->
<div style="color: white; clear:
both;"/>__,_._,___</div>
</body>
</html>
--------------090204050601030403050208--
xAP_Development Main Index |
xAP_Development Thread Index |
xAP_Development Home |
Archives Home
|