打印
[圈圈教你玩USB]

求救版主

[复制链接]
1963|10
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zdxlxq|  楼主 | 2008-12-6 18:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
下载了您老的USB键盘程序后,把电路板与电脑连接,电脑上显示无法识别的设备.在这个过程中,USB的指示灯会闪几下,USB芯片已经用你的测试程序试过是好的,请问这是怎么回事呢?

相关帖子

沙发
zdxlxq|  楼主 | 2008-12-6 22:12 | 只看该作者

附上bus hound的数据

Device  Phase  Data                                                                                                    Description       Cmd.Phase.Ofs(rep)
------  -----  ------------------------------------------------------------------------------------------------------  ----------------  ------------------
  12.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS               1.1.0(2)     
  12.0  DI     01 05 01 00                                                                                             ....                     1.2.0        
  12.0  CTL    23 01 10 00  01 00 00 00                                                                                CLEAR FEATURE            3.1.0        
  12.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS               4.1.0(2)     
  12.0  DI     01 05 00 00                                                                                             ....                     4.2.0        
  12.0  CTL    23 03 04 00  01 00 00 00                                                                                SET FEATURE              6.1.0        
  12.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS               7.1.0        
  12.0  DI     00 85 11 00                                                                                             ....                     7.2.0        
  12.0  CTL    23 01 14 00  01 00 00 00                                                                                CLEAR FEATURE            8.1.0        
  12.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS               9.1.0(3)     
  12.0  DI     00 85 01 00                                                                                             ....                     9.2.0        
  12.0  CTL    23 01 10 00  01 00 00 00                                                                                CLEAR FEATURE           12.1.0        
  12.0  CTL    a3 00 00 00  02 00 04 00                                                                                GET STATUS              13.1.0        
  12.0  DI     00 85 00 00                                                                                             ....                    13.2.0        
  12.0  CTL    a3 00 00 00  03 00 04 00                                                                                GET STATUS              14.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    14.2.0        
  12.0  CTL    a3 00 00 00  04 00 04 00                                                                                GET STATUS              15.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    15.2.0        
  12.0  CTL    a3 00 00 00  05 00 04 00                                                                                GET STATUS              16.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    16.2.0        
  12.0  CTL    a3 00 00 00  06 00 04 00                                                                                GET STATUS              17.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    17.2.0        
  12.0  CTL    a3 00 00 00  07 00 04 00                                                                                GET STATUS              18.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    18.2.0        
  12.0  CTL    a3 00 00 00  08 00 04 00                                                                                GET STATUS              19.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    19.2.0        
  12.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              20.1.0        
  12.0  DI     00 85 00 00                                                                                             ....                    20.2.0        
  12.0  CTL    a3 00 00 00  02 00 04 00                                                                                GET STATUS              21.1.0        
  12.0  DI     00 85 00 00                                                                                             ....                    21.2.0        
  12.0  CTL    a3 00 00 00  03 00 04 00                                                                                GET STATUS              22.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    22.2.0        
  12.0  CTL    a3 00 00 00  04 00 04 00                                                                                GET STATUS              23.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    23.2.0        
  12.0  CTL    a3 00 00 00  05 00 04 00                                                                                GET STATUS              24.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    24.2.0        
  12.0  CTL    a3 00 00 00  06 00 04 00                                                                                GET STATUS              25.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    25.2.0        
  12.0  CTL    a3 00 00 00  07 00 04 00                                                                                GET STATUS              26.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    26.2.0        
  12.0  CTL    a3 00 00 00  08 00 04 00                                                                                GET STATUS              27.1.0        
  12.0  DI     00 05 00 00                                                                                             ....                    27.2.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              28.1.0(2)     
  10.0  DI     01 01 01 00                                                                                             ....                    28.2.0        
  10.0  CTL    23 01 10 00  01 00 00 00                                                                                CLEAR FEATURE           30.1.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              31.1.0(2)     
  10.0  DI     01 01 00 00                                                                                             ....                    31.2.0        
  10.0  CTL    23 03 04 00  01 00 00 00                                                                                SET FEATURE             33.1.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              34.1.0        
  10.0  DI     03 01 10 00                                                                                             ....                    34.2.0        
  10.0  CTL    23 01 14 00  01 00 00 00                                                                                CLEAR FEATURE           35.1.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              36.1.0(2)     
  10.0  DI     03 01 00 00                                                                                             ....                    36.2.0        
  10.0  CTL    23 03 04 00  01 00 00 00                                                                                SET FEATURE             38.1.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              39.1.0        
  10.0  DI     03 01 10 00                                                                                             ....                    39.2.0        
  10.0  CTL    23 01 14 00  01 00 00 00                                                                                CLEAR FEATURE           40.1.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              41.1.0(2)     
  10.0  DI     03 01 00 00                                                                                             ....                    41.2.0        
  10.0  CTL    23 03 04 00  01 00 00 00                                                                                SET FEATURE             43.1.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              44.1.0        
  10.0  DI     03 01 10 00                                                                                             ....                    44.2.0        
  10.0  CTL    23 01 14 00  01 00 00 00                                                                                CLEAR FEATURE           45.1.0        
  10.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              46.1.0        
  10.0  DI     03 01 00 00                                                                                             ....                    46.2.0        
  10.0  CTL    23 01 01 00  01 00 00 00                                                                                CLEAR FEATURE           47.1.0        
  10.0  CTL    a3 00 00 00  02 00 04 00                                                                                GET STATUS              48.1.0        
  10.0  DI     03 01 00 00                                                                                             ....                    48.2.0        
  14.0  CTL    a3 00 00 00  01 00 04 00                                                                                GET STATUS              49.1.0        
  14.0  DI     03 03 00 00                                                                                             ....                    49.2.0        
  14.0  CTL    a3 00 00 00  02 00 04 00                                                                                GET STATUS              50.1.0        
  14.0  DI     00 01 00 00                                                                                             ....                    50.2.0        
  14.0  CTL    a3 00 00 00  03 00 04 00                                                                                GET STATUS              51.1.0        
  14.0  DI     00 01 00 00                                                                                             ....                    51.2.0        
  14.0  CTL    a3 00 00 00  04 00 04 00                                                                                GET STATUS              52.1.0        
  14.0  DI     00 01 00 00                                                                                             ....                    52.2.0        

使用特权

评论回复
板凳
computer00| | 2008-12-7 17:00 | 只看该作者

可能是D12没焊好,或者连接的线路太长了

使用特权

评论回复
地板
zdxlxq|  楼主 | 2008-12-7 17:24 | 只看该作者

如图,串口的调试信息是这样的

系统启动.
********************************************************************
******                 EDN USB学习板键盘程序                  ******
******                      AT89S52 CPU                       ******
******                  建立日期:Dec 10 2007                 ******
******                   建立时间:14:23:19                   ******
******                    作者:电脑圈圈                      ******
******                    欢迎访问作者的                      ******
******           USB专区:http://group.**/93/       ******
******      BLOG1:http://www.**/blog/computer00    ******
******                BLOG2:http://computer00.21ic.org       ******
******                  请按K1-K8分别进行测试                 ******
******       K1:左Ctrl键  K2:左Shift键  K3:左Alt键  K4:0键    ******
******       K5:1键  K6:2键  K7:Caps Lock键 K8:Num Lock键     ******
********************************************************************
断开USB连接.
USBD12芯片初始化
   设置地址.
       地址为:  0
连接USB.
USB总线复位.
USB总线挂起.
USB总线复位.
USB总线复位.
USB总线复位.
USB总线挂起.
USB总线挂起.
USB总线挂起.

使用特权

评论回复
5
zdxlxq|  楼主 | 2008-12-7 17:26 | 只看该作者

突然记起来了

板子上的上拉电阻和下拉电阻我是焊了100k的,会不会是这个原因?那两个电子推荐是1M的.

使用特权

评论回复
6
computer00| | 2008-12-8 12:50 | 只看该作者

换成4.7K或者10K的试试吧。

使用特权

评论回复
7
zdxlxq|  楼主 | 2008-12-8 22:18 | 只看该作者

computer00:还是不行哦

我把上下拉电阻换成5k的,结果usb的led只是闪了一下,电脑还是不能识别出设备.在串口得到的调试信息是
系统启动.
********************************************************************
******                 EDN USB学习板键盘程序                  ******
******                      AT89S52 CPU                       ******
******                  建立日期:Dec 10 2007                 ******
******                   建立时间:14:23:19                   ******
******                    作者:电脑圈圈                      ******
******                    欢迎访问作者的                      ******
******           USB专区:http://group.**/93/       ******
******      BLOG1:http://www.**/blog/computer00    ******
******                BLOG2:http://computer00.21ic.org       ******
******                  请按K1-K8分别进行测试                 ******
******       K1:左Ctrl键  K2:左Shift键  K3:左Alt键  K4:0键    ******
******       K5:1键  K6:2键  K7:Caps Lock键 K8:Num Lock键     ******
********************************************************************
断开USB连接.
USBD12芯片初始化
   设置地址.
       地址为:  0
连接USB.
USB总线复位.

比之前的少了好几个复位和挂起的调试信息.

刚刚才发现我的电路板上的D+信号的5k上拉电阻是上拉到+5v的!!
一般资料是写上拉到3.3v的,这个关系大吗??

使用特权

评论回复
8
computer00| | 2008-12-9 14:20 | 只看该作者

这个USB芯片内部已经有上拉电阻了,外面不用接

你参看一下我USB小组中提供的原理图。

使用特权

评论回复
9
zdxlxq|  楼主 | 2008-12-15 20:57 | 只看该作者

再问圈圈........

使用特权

评论回复
10
zdxlxq|  楼主 | 2008-12-15 21:00 | 只看该作者

再问圈圈........

搞了几天还是不行........我用的单片机是stc的,不知道与通用的51差别在哪里?再调试几天,如果搞不定就去买你的开发板来试试.泪奔啊........

使用特权

评论回复
11
computer00| | 2008-12-15 23:02 | 只看该作者

我们也有用STC的……一定要用52,51的内存小了。

另外数据线别太长了,不然波形不好。

使用特权

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

本版积分规则

19

主题

60

帖子

0

粉丝