Hi there
I am mot famiriar with the ibutton you work on but here are my code i use in a modbus protocol to calculate CRC16 cheksums

Calcul_CRC16:

CRC16=$FFFF
For i=0 to (DataAmount -3)
CRC16=CRC16^DATACRC[i]
For j=1 to 8
IF CRC16.Bit0=1 Then
CRC16=$A001^(CRC16>>1)
Else
CRC16=CRC16>>1
EndIF
Next j
Next i
Return

hope it helps