没辙了,发帖求助stc89c51rc的下载问题
我用delphi编写他的上位机下载软件,pc端发送7f,单片机可以回复它的测试信息,再发送波特率检验8f命令,单片机也可以回复8f命令,pc端再发命令,单片机就停止响应,等会就去执行原来下载的用户程序了,不知为何,用网上下的mcuisp5.2也是如此;附我用串口监视软件截取的stc原版下载软件和单片机通讯的数据流(波特率固定9600)
单片机回复的数据
包头+标识 + 数据包长度 + 命令 + 数据 + 校验和 + 包尾
包头:0x46 0xb9
标识 68 00
数据包长度 除开包头外的所有字节数
命令一字节
8F 新波特率测试 8F 测试应答
8E 正式修改波特率
数据
校验和:除开包尾的所有字节相加的低8位
包尾:16
68 00 3B 00 08 B6 08 B6 08 B6 08 B6 08 B6 08 B6 08 B6 08 B6 43 43 FC F0 01 82 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 88 16
连续8次测得的测量得到的7bit高电平的长度
46 B9 68 00 0C 8F FF 88 00 F0 78 80 72 16
46 B9 68 00 0B 8E FF 88 00 F0 78 F0 16
修改波特率
46 B9 68 00 06 80 EE 16
46 B9 68 00 06 80 EE 16
46 B9 68 00 06 80 EE 16
46 B9 68 00 06 80 EE 16
46 B9 68 00 06 80 EE 16
46 B9 68 00 06 80 EE 16
46 B9 68 00 07 80 48 37 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 DF CE 16 46 B9 68 00 07 80 8D 7C 16
46 B9 68 00 07 80 31 20 16 46 B9 68 00 07 80 00 EF 16
46 B9 68 00 07 80 00 EF 16
*****************************************
pc端发送的数据
包头+标识 + 数据包长度 + 命令 + 数据 + 校验和 + 包尾
包头:0x46 0xb9
标识 0x6a 00 pc机下传
数据包长度 除开包头外的所有字节数 8c=140
命令一字节
8F 新波特率测试 8F 测试应答
8E 正式修改波特率
数据
校验和:除开包尾的所有字节相加的低8位
包尾:16
7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F 7F
46 B9 6A 00 0C 8F FF 88 00 F0 78 80 74 16 46 B9 6A 00 0B 8E FF 88 00 F0 78 F2 16
46 B9 6A 00 0C 80 02 00 36 01 F0 01 20 16 46 B9 6A 00 0C 80 02 00 36 01 F0 01 20 16
46 B9 6A 00 0C 80 02 00 36 01 F0 01 20 16 46 B9 6A 00 0C 80 02 00 36 01 F0 01 20 16
46 B9 6A 00 0C 80 02 00 36 01 F0 01 20 16 46 B9 6A 00 0D 84 08 33 33 33 33 33 33 35 16
46 B9 6A 00 8C 00 00 00 00 00 00 80
02 0E D9 FF FF FF FF FF FF FF FF 02 0E B4 00 11 00 00 00 03 E8 00 00 FF 03 E8 00 00 7F 03 E8 00
00 3F 03 E8 00 00 1F 03 E8 00 00 0F 03 E8 00 00 07 03 E8 00 00 03 03 E8 00 00 01 03 E8 00 00 00
03 E8 00 00 80 03 E8 00 00 C0 03 E8 00 00 E0 03 E8 00 00 F0 03 E8 00 00 F8 03 E8 00 00 FC 03 E8
00 00 FE 03 E8 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
BE
16
46 B9
6A 00 8C 00 00 00 0C 80 00 80
前面两个固定00 00,后面的 00 00 是写入地址,再后面的00 80是数据量大小。
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
02 16 46 B9
6A 00 8C 00 00 000E 00 00 80
地址高位 地址低位 数据长度
01 0C 74 0E 2D F5 82 74 00 3C F5 83 E4 93 F9 0D BD 00 01 0C 74 0E
2D F5 82 74 00 3C F5 83 E4 93 89 90 85 0D 80 F5
A0 E4 F5 0B F5 0C C3 E5 0C 9F E5 0B 9E 50 05 75 E1 3E 80 F2 22 12 0E 9E E4 F5 90 F5 A0 F5 80 75
E1 3E 90 00 0E 93 75 09 00 F5 08 A3 E4 93 25 09 F5 09 E4 35 08 F5 08 45 09 70 04 7F 01 80 02 7F
00 C3 E5 09 94 BC E5 08 94 02 40 04 7E 01 80 02 7E 00 EE 4F 70 21 7B 01 7A 00 11 16 46 B9 6A 00
8C 00 00 00 0E 80 00 80 AF 03 AE 02 12 0D BA C3 EB 95 09 EA 95 08 40 06 7A 00 7B 01 80 EA 0B BB
00 01 0A 80 E3 22 75 89 01 75 8C 3A 75 8A B1 75 88 10 75 A8 82 75 8E 03 E4 F5 87 22 C0 E0 75 8C
FA 75 8A 19 05 0C E5 0C 70 02 05 0B D0 E0 32 EF 8D F0 A4 A8 F0 CF 8C F0 A4 28 CE 8D F0 A4 2E FE
22 78 7F E4 F6 D8 FD 75 81 0D 02 0E 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
35 16 46 B9
6A 00 8C 00 00 00 0F 80 00 80
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
05 16 FE FE FE FE 46 B9
最后
6A 00 06 82 F2 16 FE FE FE FE 46 B9
82 退出 Reset
6A 00 06 82 F2 16
请知道的说下 通讯过程:
pc: 7f 7f
52: 68 00 3B 00 08 B6 08 B6 08 B6 08 B6 08 B6 08 B6 08 B6 08 B6 43 43 FC F0 01 82 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 88 16
pc: 46 B9 6A 00 0C 8F FF 88 00 F0 78 80 74 16
52: 46 B9 68 00 0C 8F FF 88 00 F0 78 80 72 16
pc: 46 B9 6A 00 0B 8E FF 88 00 F0 78 F2 16
52: 没反应,回用户程序
不知何解,用1200波特率也是一样 这么专业?我知道用我笔记本的USB转串口,十次能有一次下载成功。 我也是用的usb转232,但用在原版下载软件上没问题,用监视软件可以看到pc端下发的数据,但单片机没回复 不懂,太高深了 急,请知道的说下 不懂!!!!! 今天我又换了一块stc10f04的芯片,碰到同样的问题,发送7f,单片机能回复,再发就复位了。
有知道的说下! 我用usb转 rs232小板和原版下载程序,从未发生无法下载的情况,挺好用的。 支持研究。。。不过建议还是先用源生串口isp去调试,usb转的以后再测。 问题终于解决了。是————————————————————————————————————
——————————————————————————
通讯协议的问题,pc机要设置为偶校验方式。
在10f04上烧写成功! 厉害,这都被你破_解了 不错,有这个可以自己写下载STC的软件了。。。呵呵
页:
[1]