=?iso-8859-2?Q?Jak_si=EA_liczy_CRC_dla_=28x

Loading thread data ...

W dniu 2011-02-14 14:25, Piotr Gałka pisze:

Zobacz w źródłach freemodbus.

Reply to
Mario

W dniu 2011-02-14 22:17 Mario napisał(a):

Tyle że w dokumentacji Atmela jest błąd i w rzeczywistości CRC jest liczone wg bardziej powszechnego wzoru:

x^19 + x^4 + x^3 + x^1 + 1

formatting link
/*

  • The Xmega manual Rev G lists the CRC Polynomial
  • as: x^24 + 4x3 + 3x +1.
*
  • Based on some untested code supplied by avr(at)atmel.com,
  • I believe the correct Polynomial is:
  • x^19 + x^4 + x^3 + x^1 + 1
*
  • At any rate after cleaning up their code issues, the following C
  • code generates the same values as the XMega 128A1 hardware.

To by chyba zamykało problem. W okolicy tego wpisu na forum AVRFreaks jest podany link do źródeł funkcji obliczającej poprawnie CRC (tzn. z wynikiem identycznym jak ATxmega).

Reply to
Adam Dybkowski

cos mi sie widzi ze i tak trzeba bedzie prosic Atmela o wyjasnienie, ba tam chyba wiecej szczegolow jest istotnych.

podejrewam ze w kluczowym momencie trzeba cos co przesunac o dwa bity (4) albo o jeden i xorowac z oryginalem (razem 3).

J.

Reply to
J.F.

[...]

No wlasnie - cos mi to zbyt prosto wyglada. CRC zwykle wymagalo przetwarzania po bicie, albo dosc skomplikowanych programow z tablicami. Cos tu mocno uproscili.

J.

Reply to
J.F.

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.