;*******вычисление CRC****************
ldi temp2, 3 ; кол-во байт в пакете+1
clr temp4 ; начальное значение crc
clr temp5
ldi ZL, low(start_bait_out) ;адрес первого байта пакета-1
ldi ZH, high(start_bait_out)
;************************************
crc0:
dec temp2
tst temp2
breq crc_end
ld temp, Z+
eor temp5, temp
;*****цикл 8 бит *****
ldi temp, 9
crc1:
dec temp
tst temp
breq crc0
lsl temp4
rol temp5
brcc crc1
;******полином*******
ldi temp3, 0x21
eor temp4, temp3
ldi temp3, 0x10
eor temp5, temp3
rjmp crc1
crc_end: