Computer Interfacing
Discussions about interfacing and electronics
 

checksum calculation.

dont know how to.


 

       Computer Interfacing Forum Index -> RS232
Author Message
germt
New User



Joined: 21 May 2011
Posts: 1
Location: Venlo

May 21, 2011 7:41 pm

Hello,

Iam trying to send a file to a dmx player, but i have problem to find out how the checksum works.
In the manuel they see that i have to do a xor with the address and the data bytes.
But i dont know how to do this.

I can send data to the player I captured with a rs232 spy and that works fine, but i don't see how the checksum is calculated.

To start i send a $FD, $00, $00, $28, the $28 is the checksum i captured.
Then i send the last 2 bytes with a hextoi :
0000:f0
0001:02
0002:14
0003:00
0004:00
0005:00
0006:01
0007:1f
0008:00
0009:80
000a:1c
000b:00
000c:00
000d:4e
000e:65
000f:77
0010:20
0011:73
0012:63
0013:65
0014:6e
0015:65
0016:20
0017:31
0018:20
0019:20
001a:20
001b:20
001c:1c
001d:00
001e:00
001f:00
0020:14
0021:00
0022:01
0023:00
0024:00
0025:ff
0026:00
0027:00

This is working, but how are they calculate the checsum of $28

But when i put a other file it don't and i see that the checksum is changed.

This is what into the manual is:
0xFD(Block transfer header)

address low(0x00 ... 0xFF)

address high(0x00 ... 0xFF)

data byte(0x00 ... 0xFF)

checksum(0xDF xor address low xor address high
xor data byte)


Is there someone that can tell me how this checksum is working.
thanks

       Computer Interfacing Forum Index -> RS232
Page 1 of 1



Running on php BB © 2001, 2009 php BB Group
   Lammert Bies     Interfacing     Sitemap     Forum