Advertisement

05.07.2004 at 11:19AM PDT, ID: 20981873
[x]
Attachment Details

Checksum (CRC-16) calculation algorithm

Asked by DmitriyAndreyev in Assembly Programming Language

Tags: algorithm, calculation, checksum

I am trying to figure out the Checksum alrorithm used by one of the printers I am working with. I have set up a serial communications monitoring interface and was able to record the "conversation" betwee the device and the printer. At the end of the every data line, sent to the printer, device sends a 16 bit code. I suspect the device and the printer use CRC-16 algorithm to calculate this code.

Example 1 of the "conversation":
--------------------------------------------------------------------------
1) Device:
 4 4 0 4 48 227 86
2) Printer:
16 6
3)Device:
   2 48 0 83 30 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95   95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 13 10 224 62
4) Printer:
 16 21
 
As a result of this "Conversation" a Printer prints 83 underscore characters
--------------------------------------------------------------------------------------------
Here is Example 2 of the recorded conversation:

1) Device:
4 4 0 4 48 227 86
2) Printer:
 16 6
3) Device:
2 48 0 44 31 14 32 32 32 32 32 32 32 32 32 32 32 32 80 82 79 68 85 67 84 32 83 85 77 77 65 82 89 32 32 32 32 32 32 32 32 32 32 32 32 20 13 10 196 130
4) Printer:
 16 21
 
As a result of this conversation, printer Prints “Product Summary” in the middle of the line
------------------------------------------------------------------------------------

I have analized the strings sent by the device and here is what I've come up with.
2, 48, 0 - is likely to be a beginning of the printing command
44 (in exampe 2) and  83 (in example 1) - is likely to be the number of characters to be printed

[224 62] (in example 1) and [196 130] in example 2 is the checksum.

QUESTION:
Find the way to calculate this checksum.

Start Free Trial
 
Keywords: Checksum (CRC-16) calculation al…
 
Loading Advertisement...
 
[+][-]05.07.2004 at 03:29PM PDT, ID: 11018964

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2004 at 10:52AM PDT, ID: 11022613

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.08.2004 at 04:44PM PDT, ID: 11023776

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2004 at 06:54AM PDT, ID: 11031146

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2004 at 10:35AM PDT, ID: 11033251

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2004 at 02:24PM PDT, ID: 11035316

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2004 at 02:09PM PDT, ID: 11044721

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.11.2004 at 02:45PM PDT, ID: 11045003

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2004 at 03:48PM PDT, ID: 11045375

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2004 at 04:07PM PDT, ID: 11045462

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Assembly Programming Language
Tags: algorithm, calculation, checksum
Sign Up Now!
Solution Provided By: dimitry
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.12.2004 at 09:54AM PDT, ID: 11051827

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2004 at 11:08AM PDT, ID: 11052488

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2004 at 11:31AM PDT, ID: 11052687

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32