Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Motion Page Checksum

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
4 postsPage 1 of 1
4 postsPage 1 of 1

Motion Page Checksum

Post by JavaRN » Sun Mar 22, 2009 8:13 pm

Post by JavaRN
Sun Mar 22, 2009 8:13 pm

Can anyone tell me how to compute the checksum for motion pages?

Right now I am working on a simple utility (in Java) that will allow me to move and mirror pages using the *.mtn file. The program seems to work ok i.e. pages are all saved in the file(including the mirrored and copied ones). However when I try to load the mtn file into the CM-5 the pages that are mirrored do not appear. It is as if they don't exist!

What I suspecting is that since I did not compute the checksum (I don't know the algorithm!) the loading program is ignoring the new pages and so they are not loaded.

Any help is greatly appreciated. Thanks

Charles
Can anyone tell me how to compute the checksum for motion pages?

Right now I am working on a simple utility (in Java) that will allow me to move and mirror pages using the *.mtn file. The program seems to work ok i.e. pages are all saved in the file(including the mirrored and copied ones). However when I try to load the mtn file into the CM-5 the pages that are mirrored do not appear. It is as if they don't exist!

What I suspecting is that since I did not compute the checksum (I don't know the algorithm!) the loading program is ignoring the new pages and so they are not loaded.

Any help is greatly appreciated. Thanks

Charles
F'dan il-passatemp ghandek bzonn zewg affarijiet - FLUS u HIN. Zewg affarijiet li huma skarsi hafna u li jien minnhom ghandi vera ftit!
JavaRN
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 282
Joined: Fri Mar 02, 2007 11:01 pm

Post by Bullit » Mon Mar 23, 2009 4:35 am

Post by Bullit
Mon Mar 23, 2009 4:35 am

Here you go. Its a simple 8 bit checksum that doesn't count the checksum itself which happens to be at address 31.

Code: Select all
byte ComputePageCheckSum(byte *bytePtr,word bytes)
{
  byte b=0;
  word addr;
   
  for(addr=0;addr<bytes;addr++)
    {
    if(addr != 31) //skip checksum byte
      {
      b = b + *bytePtr;
      }
    bytePtr++;
    }
  b = 0xff - b;
  return b;
}

for structure content if you're not already aware
http://forums.tribotix.info/forum1/76.html
Here you go. Its a simple 8 bit checksum that doesn't count the checksum itself which happens to be at address 31.

Code: Select all
byte ComputePageCheckSum(byte *bytePtr,word bytes)
{
  byte b=0;
  word addr;
   
  for(addr=0;addr<bytes;addr++)
    {
    if(addr != 31) //skip checksum byte
      {
      b = b + *bytePtr;
      }
    bytePtr++;
    }
  b = 0xff - b;
  return b;
}

for structure content if you're not already aware
http://forums.tribotix.info/forum1/76.html
Bullit
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 291
Joined: Wed May 31, 2006 1:00 am
Location: Near robot

Post by JavaRN » Mon Mar 23, 2009 4:02 pm

Post by JavaRN
Mon Mar 23, 2009 4:02 pm

Thanks a lot. Regarding the motion page structure I got info form there and here and manage to compile it - Thanks again.
Thanks a lot. Regarding the motion page structure I got info form there and here and manage to compile it - Thanks again.
F'dan il-passatemp ghandek bzonn zewg affarijiet - FLUS u HIN. Zewg affarijiet li huma skarsi hafna u li jien minnhom ghandi vera ftit!
JavaRN
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 282
Joined: Fri Mar 02, 2007 11:01 pm

Post by StuartL » Wed Apr 15, 2009 7:03 am

Post by StuartL
Wed Apr 15, 2009 7:03 am

To calculate the checksum just zero the checksum byte and sum the remainder. Invert the result and place that in byte 31.

To check the checksum sum all bytes in the page and check to see if they total 0xff.
To calculate the checksum just zero the checksum byte and sum the remainder. Invert the result and place that in byte 31.

To check the checksum sum all bytes in the page and check to see if they total 0xff.
StuartL
Savvy Roboteer
Savvy Roboteer
Posts: 350
Joined: Mon Jun 04, 2007 3:46 pm
Location: Thatcham, Berkshire, UK


4 postsPage 1 of 1
4 postsPage 1 of 1