迪文科技论坛

 找回密码
 立即注册
搜索
查看: 2412|回复: 14

【提问】What is a checksum? Is it very important? I had a painful experie...

[复制链接]

26

主题

79

回帖

405

积分

中级会员

Rank: 3Rank: 3

积分
405
发表于 2020-10-17 14:23:45 | 显示全部楼层 |阅读模式
I save some important data in the eprom of my dwin screen. however, he sometimes reads incorrectly while reading. my device has worked for two months. every day he read correctly from the eprom of the screen. Two months later he read wrong once. so I had problems with my customers. but I guess this error is because of me. what could be the reason for this? I read a statement about the checksum in a document, but I did not pay any attention to it. I did not use checksum in communication. Could this be the cause of my problem?
my screen modal: DMT80600L104_01WT
回复

使用道具 举报

0

主题

1

回帖

11

积分

新手上路

Rank: 1

积分
11
发表于 2020-10-17 15:25:57 | 显示全部楼层
YOU need to do CRC verify

ANSI CRC-16(X16+X15+X2+1)format was adopted in DGUS and program C as follows:
unsigned char CRCTABH[256]={0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0
0x80,0x41,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41
0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0
0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x00,0xC1
0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x00,0xC1
0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0
0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40
0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1
0x81,0x40,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0
0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x01,0xC0
0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0
0x80,0x41,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41
0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0
0x80,0x41,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x01,0xC0
0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40
0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1
0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0
0x80,0x41,0x00,0xC1,0x81,0x40};
unsigned char CRCTABL[256]={0x00,0xC0,0xC1,0x01,0xC3,0x03,0x02,0xC2,0xC6,0x06
0x07,0xC7,0x05,0xC5,0xC4,0x04,0xCC,0x0C,0x0D,0xCD
0x0F,0xCF,0xCE,0x0E,0x0A,0xCA,0xCB,0x0B,0xC9,0x09
0x08,0xC8,0xD8,0x18,0x19,0xD9,0x1B,0xDB,0xDA,0x1A
0x1E,0xDE,0xDF,0x1F,0xDD,0x1D,0x1C,0xDC,0x14,0xD4
0xD5,0x15,0xD7,0x17,0x16,0xD6,0xD2,0x12,0x13,0xD3
0x11,0xD1,0xD0,0x10,0xF0,0x30,0x31,0xF1,0x33,0xF3
0xF2,0x32,0x36,0xF6,0xF7,0x37,0xF5,0x35,0x34,0xF4
0x3C,0xFC,0xFD,0x3D,0xFF,0x3F,0x3E,0xFE,0xFA,0x3A
0x3B,0xFB,0x39,0xF9,0xF8,0x38,0x28,0xE8,0xE9,0x29
0xEB,0x2B,0x2A,0xEA,0xEE,0x2E,0x2F,0xEF,0x2D,0xED
0xEC,0x2C,0xE4,0x24,0x25,0xE5,0x27,0xE7,0xE6
回复

使用道具 举报

26

主题

79

回帖

405

积分

中级会员

Rank: 3Rank: 3

积分
405
 楼主| 发表于 2020-10-17 17:46:44 | 显示全部楼层
what exactly do these mean? how do i apply it in my software?
回复

使用道具 举报

0

主题

24

回帖

1394

积分

金牌会员

Rank: 6Rank: 6

积分
1394
发表于 2020-10-17 20:50:31 | 显示全部楼层
Hi Sir, CRC is a check code, which can be added or not after each instruction. To judge whether this instruction is normal, it cannot be sent if it is wrong. If you have set the check code, then the command may be wrong, and maybe it was not sent successfully. But if you haven't set it before, I think maybe there are some other questions.
回复

使用道具 举报

26

主题

79

回帖

405

积分

中级会员

Rank: 3Rank: 3

积分
405
 楼主| 发表于 2020-10-20 17:32:22 | 显示全部楼层
I've never used crc before. I use the following command while writing to the memory of the dgus screen. but sometimes I get wrong data.



I just learned what CRC does. but I don't know how to use it. What does CRCTABH/L [256] mean? what am i going to do with it?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0

主题

47

回帖

2743

积分

金牌会员

Rank: 6Rank: 6

积分
2743
发表于 2020-10-20 19:37:45 | 显示全部楼层
Hello, CRC is a channel coding technology that generates short fixed bit parity check codes based on network data packets or computer files. Our screen CRC needs to enable verification in the configuration file. The model you are using does not have CRC enabled
坚持不一定成功,但放弃一定失败!
回复

使用道具 举报

26

主题

79

回帖

405

积分

中级会员

Rank: 3Rank: 3

积分
405
 楼主| 发表于 2020-10-20 21:38:17 | 显示全部楼层
Do you mean that the model I use does not have CRC feature?
So how can I avoid erroars in reading data from the screen's memory?
回复

使用道具 举报

0

主题

47

回帖

2743

积分

金牌会员

Rank: 6Rank: 6

积分
2743
发表于 2020-10-21 09:02:34 | 显示全部楼层
Yes, the instruction set does not have CRC. If you need CRC function, you need to change the configuration screen
坚持不一定成功,但放弃一定失败!
回复

使用道具 举报

26

主题

79

回帖

405

积分

中级会员

Rank: 3Rank: 3

积分
405
 楼主| 发表于 2020-10-21 15:46:14 | 显示全部楼层
well, How can I change the configuration screen
回复

使用道具 举报

26

主题

79

回帖

405

积分

中级会员

Rank: 3Rank: 3

积分
405
 楼主| 发表于 2020-10-22 13:41:07 | 显示全部楼层
How can I change the configuration screen
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|迪文科技论坛 ( 京ICP备05033781号-1 )

GMT+8, 2024-11-23 03:12 , Processed in 0.086719 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表