打印

请问谁有STC单片机的下载协议?

[复制链接]
9975|29
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
jumpio|  楼主 | 2009-12-11 11:37 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
huangqi412| | 2009-12-11 12:20 | 只看该作者
晕,吃饱了没事做...            老姚怎么可能把协议给你.   想要弄也很简单,监视串口数据,自己分析协议.这类东西不会很复杂.

使用特权

评论回复
板凳
huangqi412| | 2009-12-11 12:21 | 只看该作者
费这个劲折腾,不如弄个AVR或者89S51的下载软件,人家协议都公开.

使用特权

评论回复
地板
jumpio|  楼主 | 2009-12-11 13:39 | 只看该作者
我测了串口数据如下:
1:PC先发7FH給MPU;
2: MPU确认后发送一串数据到PC:46,B9,68,00,31,50,01,62,01,63,01,62......0E,70,16共51byte;
   估计是給出了时钟,及波特率,MPU型号等;
3: pc再发:46,B9,6A,00,0D,50,07,00,36,01,D1,70,02,46,16
  我到第三步后MPU没反应;发送数据同截获的都一样。请问哪位高手能否指点一下。
 

使用特权

评论回复
5
wangguixi110| | 2010-11-4 08:06 | 只看该作者
兄台,不知你的STC协议现在弄的怎么样了,我也遇到相同的问题,我用的单片机STC12LE5612AD,第三步时一点反应都没了,我是采用的1200固定波特率,这帧的发送信息是没有什么问题的,多谢兄台指点。

使用特权

评论回复
评论
飞舞的水瓶 2021-9-4 16:29 回复TA
兄台!11年后我也做这个,好久才翻到这条,有没有找到方案了!也遇到这个问题了 
6
smile_luo| | 2010-11-25 08:33 | 只看该作者
:lol路过

使用特权

评论回复
7
老鱼探戈| | 2010-11-26 12:24 | 只看该作者
我是卖酱油的

使用特权

评论回复
8
Zpc| | 2010-11-28 11:24 | 只看该作者
没用过STC的路过
第三步没反应是不是有时间上的要求呢?

使用特权

评论回复
9
zeadoit| | 2010-11-28 11:53 | 只看该作者
路过,MARK,学习一下,我也想自己写。

使用特权

评论回复
10
必有我师| | 2010-12-4 19:32 | 只看该作者
我也需要啊。高手指点呢。

使用特权

评论回复
11
kubuco| | 2010-12-6 18:35 | 只看该作者
用用逻辑分析仪看看吧。

使用特权

评论回复
12
zdjtcl1| | 2011-11-20 20:01 | 只看该作者
我用逻辑分析仪分析了一下,同时查了别人的一些,需要的话发邮件给我 zdjtclzty@163.com

使用特权

评论回复
13
Ryanhsiung| | 2011-11-20 20:06 | 只看该作者
告诉你个办法,把老姚的软件嵌到你的软件中去就好了!

  不过估计很多杀毒软件会报病毒

使用特权

评论回复
14
hotpower| | 2011-11-21 18:54 | 只看该作者
串口拦截小事一件,没有任何难度。

使用特权

评论回复
15
znmcu| | 2012-8-27 11:21 | 只看该作者
STC的下载协议有没有版权?

使用特权

评论回复
16
dlyt_test001| | 2012-8-27 13:53 | 只看该作者
支持,搞好定它之后,最好拿出来分享一下!

使用特权

评论回复
17
zou_sky| | 2012-12-12 14:28 | 只看该作者
同问,第三步没有收到来自MCU的数据.

使用特权

评论回复
评论
飞舞的水瓶 2021-9-4 16:41 回复TA
找到方案了吗?我也卡这了 
18
江枫渔火| | 2012-12-12 14:56 | 只看该作者
无非就是分析它用的封包结构。STC有一个ISP的demo程序,应该原理类似。再不行,就自己弄ISP自己写协议拉到~

使用特权

评论回复
19
logokfu| | 2012-12-12 19:16 | 只看该作者
应该不行,没有那么简单吧。

使用特权

评论回复
20
江枫渔火| | 2012-12-12 19:47 | 只看该作者


数据包格式:

包头 + 标识 + 数据包长度 + 命令 + 数据 + 校验和 + 包尾  

包头:0x46,0xB9
标识:PC机发送给MCU的为0x6A,MCU回应给PC的是0x68,标识后面还有一个字节固定为0x00。
包长:为除包头外的数据包总长。
命令:一个字节。  
数据:可以有也可以无,最多时有100多个字节。
校验和:为两字节,为包头之后,校验和之前所有字节相加的值。
包尾:固定为0x16   


通信流程:


1,连续发送0x7F,触发ISP程序
2,有效回应68 00 1C 00 0A 76 0A 76 0A 76 0A 76 0A 72 0A 76 0A 76 0A 76 33 43 FD F0 02 82 67 16
重复都部分估计是用来检测波特律的。
33->固件版本3.3
43->固件版本后缀C
FD->单倍速 FE双倍速
F0->芯片型号STC89C52RC

67->前面所有字节的和校验
16->包尾
其他暂时不明作用

3,换波特率从最高开始尝试,每个尝试3次:

115200: 46 B9 6A 00 0C 8F FF FD 00 06 2D 81 B5 16
57600: 46 B9 6A 00 0C 8F FF FA 00 0C 2D 81 B8 16
38400: 46 B9 6A 00 0C 8F FF F7 00 12 2D 81 BB 16
28800: 46 B9 6A 00 0C 8F FF F4 00 18 2D 81 BE 16
19200: 46 B9 6A 00 0C 8F FF EE 00 24 2D 81 C4 16
14400: 46 B9 6A 00 0C 8F FF E8 00 30 2D 81 CA 16


联机:
t:7F                        改双倍速
s: 68 00 1C 00 14 F2 14 F2/EE 14 F2 14 F2 14 F2 14 F2 14 F2 14 F2 33 43 FD F0 02 82 9B/97 16

不关掉COM马上变最低波特率并让单片机切换波特率
9600
: 46 B9 6A 00 0C 8F FF DC 00 48 28 81 D1 16
关掉,马上上位机变波特率和单片机一样,收到回应:
: 46 B9 68 00 0C 8F FF DC 00 48 28 81 CF 16
关掉,变最低波特率发送
: 46 B9 6A 00 0B 8E FF DC 00 48 28 4E 16
关掉,变单片机波特率,收到
: 46 B9 68 00 0B 8E FF DC 00 48 28 4C 16
*******************************************************确定
T: 46 B9 6A 00 0C 80 02 00 36 01 F0 02 21 16
R: 46 B9 68 00 06 80 EE 16
T: 46 B9 6A 00 0C 80 02 00 36 01 F0 02 21 16
R: 46 B9 68 00 06 80 EE 16
T: 46 B9 6A 00 0C 80 02 00 36 01 F0 02 21 16
R: 46 B9 68 00 06 80 EE 16
T: 46 B9 6A 00 0C 80 02 00 36 01 F0 02 21 16
R: 46 B9 68 00 06 80 EE 16
T: 46 B9 6A 00 0C 80 02 00 36 01 F0 02 21 16
R: 46 B9 68 00 06 80 EE 16
***************5次估计是测试****************************

关闭端口

用上面测试的波特率打开

发送
T: 46 B9 6A 00 0D 84 01 33 33 33 33 33 33 2E 16
R: 46 B9 68 00 06 80 EE 16

T: 46 B9 6A 00 8C 00 00 00 00 00 00 80
E4 F5 08 12 00 0E AF 08 05 08 8F 80 80 F5 7F C8 7E FA DE FE DF FA 22 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
55 16

R: 46 B9 68 00 07 80 DF CE 16

T: 46 B9 6A 00 8C 00 00 00 00 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
F6 16

R: 46 B9 68 00 07 80 00 EF 16

T: 46 B9 6A 00 8C 00 00 00 01 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 77 16

R: 46 B9 68 00 07 80 00 EF 16

T: 46 B9 6A 00 8C 00 00 00 01 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 F7 16

R: 46 B9 68 00 07 80 00 EF 16

T: 46 B9 6A 00 8C 00 00 00 02 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 78 16

R: 46 B9 68 00 07 80 00 EF 16

T: 46 B9 6A 00 8C 00 00 00 02 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 F8 16

R: 46 B9 68 00 07 80 00 EF 16

T: 46 B9 6A 00 8C 00 00 00 03 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 79 16

R: 46 B9 68 00 07 80 00 EF 16

T: 46 B9 6A 00 8C 00 00 00 03 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 F9 16

R: 46 B9 68 00 07 80 00 EF 16

这可关闭端口

T: FE FE FE FE 46 B9 6A 00 06 82 F2 16

R: 46 B9 68 00 06 80 00 EE 16

T: FE FE FE FE 46 B9 6A 00 06 82 F2 16

关闭端口

设置双倍速多了:
T: 46 B9 6A 00 0A 8D FC FF B8 FF B3 16
R: 46 B9 68 00 0A 8D FC FF B8 FF B1 16

关闭端口

T: 46 B9 6A 00 06 50 C0 16
R: 46 B9 68 00 10 10 C0 16 B8 FF B3 03 FF 33 43 FC 3C 16

T: FE FE FE FE 46 B9 6A 00 06 82 F2 16 //确定
R: 46 B9 68 00 06 80 EE 16

关闭端口

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

27

主题

62

帖子

2

粉丝