Crystalfontz LCD Forum
 
 

Go Back   Crystalfontz LCD Forum > LCD Software > 3rd Party Software

Notices

Reply
 
Thread Tools Rate Thread Display Modes
Old 2005/12/03, 08:26 AM   #1
vthinsel
Registered
 
Join Date: 2005/12
Posts: 11
635 - CRC - perl

Hello !

I have tried the perl code included in the data sheet, and here is the output:

~/dev/lcdlib/TestsStandalone> ./cftest.pl
A CRC of Packet (800105) Should Equal (5584)
ffff
b24c
b959
fe7e
ba0d
eadc
7a25
85da

So I get 85da instead of 5584.

Before I go to the cellar to get my old lessons on data integrity could someone tell me if this example should work ?

I'm getting confused between ord, char, hexa, decimal, carcters...
when saying type '80', it is 0x80, correct ? 10000000 in binary ?
What should be the CRC for 0x80 ?

Thanks !

Vincent
vthinsel is offline   Reply With Quote
Old 2005/12/03, 06:01 PM   #2
CF Tech
Administrator
 
Join Date: 2001/03
Location: Spokane, Washington
Posts: 4,015
Aye, I couldn't PERL meself out of a wet paper bag. The person that submitted the PERL example to us stated it worked, but beyond that . . .

Here are a couple of debugger screenshots of packets showing the exact byte order, right before they go out the port. Unfortunately, they are for the CFA-633, and the commands 7 & 8 used as examples have been deprecated in the CFA-635.

http://www.crystalfontz.com/backligh...est_packet.pdf
CF Tech is offline   Reply With Quote
Old 2005/12/04, 08:49 AM   #3
vthinsel
Registered
 
Join Date: 2005/12
Posts: 11
Thanks for the update and the nice snapshot. I'll also check on the wintest app when I get the 635.

The CRC is calculated the same way on 633 and 635 ?

Vincent.
vthinsel is offline   Reply With Quote
Old 2005/12/04, 07:13 PM   #4
CF Tech
Administrator
 
Join Date: 2001/03
Location: Spokane, Washington
Posts: 4,015
Yes
CF Tech is offline   Reply With Quote
Old 2005/12/05, 02:25 PM   #5
vthinsel
Registered
 
Join Date: 2005/12
Posts: 11
Quote:
Originally posted by CF Tech
Yes
Ok.

I really don't see how the perl example in the appendix can work.
The value 80 should be 0x80, as it is hexa, and not decimal
Moreover using the concatenation operato r "." generates 6 cars, and not 3 bytes: 800105.

All in all, I got the example to work succesfully by doing this:
my $type = 0x00;
my $length = 0x02;
my $data = 0xff;
my $packet = pack 'C4',$type,$length,$data,$data;

Thsi is a ping packet, with 2 bytes set to 0xff.
The calculated CRC for this packet is: b9de, as the packet debugger tells me. So now, I need to make the packet generator more versatile.

Vincent.
vthinsel is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -7. The time now is 08:11 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.