You are on page 1of 4

K-BUS CRC SPECIFICATION

1. An example for CRC of K-bus

Calculating FCS(CRC) for HDLC frame

up

I have the following frame:

vote0do
wn vote

7e 01 00 00 01 00 18 ef 00 00 00 b5 20 c1 05 10 02 71 2e 1a c2 05 10 01
71 00 6e 87 02 00 01 42 71 2e 1a 01 96 27 be 27 54 17 3d b9 93 ac 7e

favorite

If I understand correctly, then it is this portion of the frame on which the FCS is calculated:
010000010018ef000000b520c1051002712e1ac205100171006e8702000142712e1a
019627be2754173db9

I've tried entering this into a number of online calculators but I cant produce 0x93ac from the
above data.
http://www.lammertbies.nl/comm/info/crc-calculation.html with input type hex.
How is 0x93ac arrived at?
Thanks,
Barry
serial-port frame checksum crc

shareimprove this question

edited Nov 3 '14 at 19:24

asked Nov 2 '11 at 16:30

dsolimano

Baz

5,60832339

90152684

add a comment

1 Answer
activeoldestvotes

up
vote4
down
vote
accepted

first of all, CRC value is 0xac93


Use this calculator: http://www.zorc.breitbandkatze.de/crc.html

Set CRC order 16

Polynomial 1021

Initial value ffff


Final value ffff
"reverse data bytes"

"reverse CRC result before Final XOR"

Enter your sequence as:


%01%00%00%01%00%18%ef%00%00%00%b5%20%c1%05%10%02%71%2e
%1a%c2%05%10%01%71%00%6e%87%02%00%01%42%71%2e%1a
%01%96%27%be%27%54%17%3d%b9`

Press "calculate" and you get 0xAC93

shareimprove this answer

edited Jan 12 '12 at 21:11

answered Jan 12 '12 at 19:57

Peter O.

Ilya

12.3k63546

562

2. Result calculate K-bus from Relay with stream : 0100026140 024F


(http://www.zorc.breitbandkatze.de/crc.html)

3. IEC870 to Kbus Frame (FT1.2)

3.1 IEC870
68
START

03
LEN

03
LEN

68
START

40
FC

01
ADD

00
DATA1

41
CHECKSUM

16
STOP

START = 68H, STOP = 16, CHECKSUM = FC+DATA1+DATA2


3.1 KBUS
7E
01
FLAG ADD

00
?

02
LEN

61
?

40
FC

02
CRC1

4F
CRC2

7E
FLAG

CRC: CCITT, X16+X12+X5+1

Set CRC order 16


Polynomial 1021
Initial value ffff
Final value ffff
"reverse data bytes"
"reverse CRC result before Final XOR"

IEC FRAME
68

07

07

68

7B
FC

01
00
07
ADD ADD

14

04

00

9B
16
CHK STOP

KBUS FRAME
01

00

06
61
LEN ?

7B
FC

07

14

04

00

E7

43

Note: K-bus HDLC is serial LSB First


PC
KBUS
PC

TX: 68 07 07 68 |7B 01 00 07 14 04 00| 9B 16


TX: 01 00 06 61 |7B 07 14 04 00| E7 A3
RX: 68 0B 0B 68 |08 01 00 38 04 8A 3C 2A 01 5D 68| FB 16

IEC len = Kbus Len +1, IECFrame lenth = IEC len + 6


IEC FC calculate from : 4 to IECFrame Lenth -2
KBUS RX: 01 00 0A 61 |08 38 04 87 3C 2A 01 5D 68| DD E3
Gia tri nay thay doi
ngau nhien

Gia tri Kbus + 3

Loi bus
Kitz
68 0B 0B 68 08 01 00 38 04 F1 17 06 00 5D 68 18 16
Arduino 68 0B 0B 68 08 01 00 38 04 EF 2B 0C 00 BA D0 F5 16
KitZ
68 0B 0B 68 08 01 00 38 04 F4 0B 06 00 5D 68 0F 16
Arduino 68 0B 0B 68 08 01 00 38 04 F1 0B 06 00 5D 68 0C 16

You might also like