The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: CRC16



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, "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@xxxxxxx]
> On Behalf Of hillbillies@...
> Sent: Monday, 7 November 2011 11:20 AM
> To: xAP_developer@xxxxxxx
> 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
>




------------------------------------


xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.