Calculate the checksum for SSI command

Article ID: 21736246

Issue / Question

How to calculate checksum for SSI Commands in Simple Serial Interface Programmer's Guide

Applicable To

DS4308, DS457, DS8100, DS3608, DS3678, MS1204, MS954

Resolution / Answer

Steps:

1.    Get the command that you want in Simple Serial Interface Programmer's Guide , for example start session


2.    Get the 4 bits status value from the status field description, for example 0000 which represented to
Bit 0: 0 – First Transmission
Bit 1: 0 – Last packet of a multipacket message
Bit 2: 0 – Always 0
Bit 3: 0 – Temporary Change

3.    Convert 0000 to 1 bytes.
In this case, it is required addition 4 bits to become 1 byte, so add 0000 in front the status bit value to become 0000 0000.
 

Bit 7 6 5 4 3 2 1 0
  0 0 0 0 0 0 0 0


Note: 
1 byte = 8 bits
0000 is the most common selected 4 bits value for status.


4.    Convert 0000 0000 to hexadecimal value 0000 0000
   0

You can refer to following table

Decimal Number 4-bit Binary Number Hexadecimal Number
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F



5.    Now you get the hex value for status
 

Length Opcode Message Source Status Checksum
04h E4h 04h 00h  



6.    Sum all the above hex value by using hex calculator.
04 + E4 + 04 + 00 = EC

7.    Convert EC to binary
E           C
1110    1100

8.    Convert 1110 1100 to 2 bytes. In this case, it is required addition 1 byte, so add 0000 0000 in front the value to become 0000 0000 1110 1100

9.    You need to do 2 complements for 0000 0000 1110 1100 to get the checksum.

10.    For the 1st complement is to convert 0 to 1 and 1 to 0.

0000 0000 1110 1100
Become
1111 1111 0001 0011

11.    For the 2nd complement is adding 1 to the value 1111 1111 0001 0011 that obtained from 1st complement.

         1111 1111 0001 0011
+                                      1
_________________________________
        1111 1111 0001 0100

12.    Convert 1111 1111 0001 0100 to hex value
1111 1111 0001 0100
F       F      1       4

13.    Now you get the 2 bytes checksum FF and 14.

14.    Your complete command is 04 E4 04 00 FF 14.
 

Length Opcode Message Source Status Checksum
04h E4h 04h 00h FFh    14h


 

+ Applicable Products

  • DS3608-DPA
  • DS3608-DPX
  • DS3678-DPA
  • DS3678-DPX
  • DS457 Series
  • DS8100 Series