usb程序测试成功!!!
操作步骤:(1)连接超级终端
(2)运行tftp
(3)dn
(4)文本方式选择发送testusb.uue
(5)go
(6)接上lumit4510的usb接口到PC上
(7)在winxp/2000下,自动弹出对话框要你选择安装sys文件
(8)运行exe文件,可控制led1,led2,led3 以下是使用bushound工具,pc机上接收到的信息:
Bus Hound 5.00 capture. Complements of www.perisoft.net
Device - Device ID (followed by the endpoint for USB devices)
(12) USB Root Hub
(13) Generic USB Hub
(14) Philips PDIUSBD12 Evaluation Board
Phase- Phase Type
CTL USB control transfer
DI Data in
DO Data out
Data - Hex dump of the data transferred
Descr- Description of the phase
Cmd... - Position in the captured data
DevicePhaseData Description Cmd.Phase.Ofs(rep)
--------------------------------------------------------
13.1DI 04 . 1.1.0
13.0CTL a3 00 00 00GET STATUS 2.1.0(2)
02 00 04 00 2.1.4
13.0DI 01 01 01 00.... 2.2.0
13.0CTL 23 01 10 00CLEAR FEATURE 4.1.0
02 00 00 00 4.1.4
13.0CTL a3 00 00 00GET STATUS 5.1.0
01 00 04 00 5.1.4
13.0DI 00 01 00 00.... 5.2.0
13.0CTL a3 00 00 00GET STATUS 6.1.0(2)
02 00 04 00 6.1.4
13.0DI 01 01 00 00.... 6.2.0
13.0CTL 23 03 04 00SET FEATURE 8.1.0
02 00 00 00 8.1.4
13.1DI 04 . 9.1.0
13.0CTL a3 00 00 00GET STATUS 10.1.0
02 00 04 00 10.1.4
13.0DI 03 01 10 00.... 10.2.0
13.0CTL 23 01 14 00CLEAR FEATURE 11.1.0
02 00 00 00 11.1.4
13.0CTL a3 00 00 00GET STATUS 12.1.0(2)
02 00 04 00 12.1.4
13.0DI 03 01 00 00.... 12.2.0
13.0CTL 23 03 04 00SET FEATURE 14.1.0
02 00 00 00 14.1.4
13.1DI 04 . 15.1.0
13.0CTL a3 00 00 00GET STATUS 16.1.0
02 00 04 00 16.1.4
13.0DI 03 01 10 00.... 16.2.0
13.0CTL 23 01 14 00CLEAR FEATURE 17.1.0
02 00 00 00 17.1.4
13.0CTL a3 00 00 00GET STATUS 18.1.0
03 00 04 00 18.1.4
13.0DI 00 01 00 00.... 18.2.0
13.0CTL a3 00 00 00GET STATUS 19.1.0
04 00 04 00 19.1.4
13.0DI 00 01 00 00.... 19.2.0
14.0CTL 80 06 00 01GET DESCRIPTOR 20.1.0
00 00 12 00 20.1.4
14.0DI 12 01 10 01.... 20.2.0
00 00 00 10.... 20.2.4
71 04 22 02q.". 20.2.8
13 01 00 00.... 20.2.12
00 01 .. 20.2.16
14.0CTL 80 06 00 02GET DESCRIPTOR 21.1.0
00 00 09 00 21.1.4
14.0DI 09 02 20 00.. . 21.2.0
01 01 00 80.... 21.2.4
32 2 21.2.8
14.0CTL 80 06 00 02GET DESCRIPTOR 22.1.0
00 00 20 00 22.1.4
14.0DI 09 02 20 00.. . 22.2.0
01 01 00 80.... 22.2.4
32 09 04 002... 22.2.8
00 02 08 04.... 22.2.12
50 00 07 05P... 22.2.16
82 02 40 00..@. 22.2.20
00 07 05 02.... 22.2.24
02 40 00 00.@.. 22.2.28
14.0CTL 00 09 01 00SET CONFIG 23.1.0
00 00 00 00 23.1.4
14.2DO 78 56 34 12xV4. 24.1.0
f3 ff .. 24.1.4
14.2DO 78 56 34 12xV4. 25.1.0
f7 ff .. 25.1.4
14.2DO 78 56 34 12xV4. 26.1.0
ff ff .. 26.1.4
14.2DO 78 56 34 12xV4. 27.1.0
fb ff .. 27.1.4
14.2DO 78 56 34 12xV4. 28.1.0
f3 ff .. 28.1.4
14.2DO 78 56 34 12xV4. 29.1.0
f1 ff .. 29.1.4
14.2DO 78 56 34 12xV4. 30.1.0
f5 ff .. 30.1.4
14.2DO 78 56 34 12xV4. 31.1.0
fd ff .. 31.1.4
14.2DO 78 56 34 12xV4. 32.1.0
f9 ff .. 32.1.4
14.2DO 78 56 34 12xV4. 33.1.0
fb ff .. 33.1.4
14.2DO 78 56 34 12xV4. 34.1.0
ff ff .. 34.1.4
14.2DO 78 56 34 12xV4. 35.1.0
f7 ff .. 35.1.4
14.2DO 78 56 34 12xV4. 36.1.0
ff ff .. 36.1.4
14.2DO 78 56 34 12xV4. 37.1.0
fb ff .. 37.1.4
14.2DO 78 56 34 12xV4. 38.1.0
ff ff .. 38.1.4
14.2DO 78 56 34 12xV4. 39.1.0
f7 ff .. 39.1.4
14.2DO 78 56 34 12xV4. 40.1.0
ff ff .. 40.1.4
14.2DO 78 56 34 12xV4. 41.1.0
fd ff .. 41.1.4
14.2DO 78 56 34 12xV4. 42.1.0
ff ff .. 42.1.4
14.2DO 78 56 34 12xV4. 43.1.0
fb ff .. 43.1.4
14.2DO 78 56 34 12xV4. 44.1.0
ff ff .. 44.1.4
14.2DO 78 56 34 12xV4. 45.1.0
f7 ff .. 45.1.4
14.2DO 78 56 34 12xV4. 46.1.0
ff ff .. 46.1.4
14.2DO 78 56 34 12xV4. 47.1.0
fb ff .. 47.1.4
14.2DO 78 56 34 12xV4. 48.1.0
f9 ff .. 48.1.4
13.1DI 04 . 49.1.0
13.0CTL a3 00 00 00GET STATUS 50.1.0(2)
02 00 04 00 50.1.4
13.0DI 00 01 01 00.... 50.2.0
13.0CTL 23 01 10 00CLEAR FEATURE 52.1.0
02 00 00 00 52.1.4
13.0CTL a3 00 00 00GET STATUS 53.1.0
01 00 04 00 53.1.4
13.0DI 00 01 00 00.... 53.2.0
13.0CTL a3 00 00 00GET STATUS 54.1.0
02 00 04 00 54.1.4
13.0DI 00 01 00 00.... 54.2.0
13.0CTL a3 00 00 00GET STATUS 55.1.0
03 00 04 00 55.1.4
13.0DI 00 01 00 00.... 55.2.0
13.0CTL a3 00 00 00GET STATUS 56.1.0
04 00 04 00 56.1.4
13.0DI 00 01 00 00.... 56.2.0
13.0CTL a3 00 00 00GET STATUS 57.1.0
01 00 04 00 57.1.4
13.0DI 00 01 00 00.... 57.2.0
13.0CTL a3 00 00 00GET STATUS 58.1.0
02 00 04 00 58.1.4
13.0DI 00 01 00 00.... 58.2.0
13.0CTL a3 00 00 00GET STATUS 59.1.0
03 00 04 00 59.1.4
13.0DI 00 01 00 00.... 59.2.0
13.0CTL a3 00 00 00GET STATUS 60.1.0
04 00 04 00 60.1.4
13.0DI 00 01 00 00.... 60.2.0 以下是lumit4510上超级终端的运行结果(注:和源程序有些出入,主要增加了一些调试信息):
/*************************************************************/
Bios for download and program.
Author Jerry
Build date : Oct 11 2004 Time : 22:20:11
Type help for help.
/*************************************************************/
\>dn
ev-7t bootloader download
No begin address for download, use default address 0x8000
Ready to download. Use 'transmit' option on terminal emulator to download file.
Loaded file testusb.bin at address 8000, size = 8124
\>go
go at address 0x8000
D12 chip ID:1210
PDIUSBD12 TEST
Pdiusbd12 Found, chip id = 0x1210
Please connect USB Line from PC to the Board
run LEDDEMO.EXE in the PC and Test
D12SuspChgProc
D12Ep0IntProc
D12Ep1IntProc
D12Ep0IntProc
D12Ep1IntProc
D12BusRstProc
D12Ep0IntProc
D12Ep1IntProc
D12Ep0IntProc
D12Ep1IntProc
D12Ep0IntProc
D12Ep1IntProc
D12Ep1IntProc
D12Ep0IntProc
D12Ep1IntProc
D12Ep0IntProc
D12Ep1IntProc
D12Ep0IntProc
D12Ep1IntProc
D12Ep0IntProc
Device attached!
D12Ep1IntProc
D12Ep4IntProc
f3
fff3
D12Ep4IntProc
f7
fff7
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
fb
fffb
D12Ep4IntProc
f3
fff3
D12Ep4IntProc
f1
fff1
D12Ep4IntProc
f5
fff5
D12Ep4IntProc
fd
fffd
D12Ep4IntProc
f9
fff9
D12Ep4IntProc
fb
fffb
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
f7
fff7
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
fb
fffb
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
f7
fff7
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
fd
fffd
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
fb
fffb
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
f7
fff7
D12Ep4IntProc
ff
ffff
D12Ep4IntProc
fb
fffb
D12Ep4IntProc
f9
fff9 希望大家能够从这个程序的调试信息中学到一点东西!! :-) 能否将带有调试信息的代码也发上来, 这样大家可以对照着进行测试.
另外, 我在宿舍的win2000机器上安装那个 D12 的驱动似乎不是很顺利,能否详细介绍一下你的安装过程:?: 斑竹,在这里不能添加附件,我开新帖回复!! 凌晨1:10分, 我在新一批板子上测试成功!太棒了!:lol::lol::lol: 早上又试了一下以前没有飞线的板子,发现可以读出 usb 芯片 id ,但后面握手就不行了, 看样子还是必须得飞线才能正常工作.:cry:
另外, led.h的定义似乎还是 zhaoic 板子的, 所以点灯还有点小问题. 可改为:
#define LED_4_ON (LEDBANK=LEDBANK|0x00000040)
#define LED_3_ON (LEDBANK=LEDBANK|0x00000020)
#define LED_2_ON (LEDBANK=LEDBANK|0x00000010)
#define LED_1_ON (LEDBANK=LEDBANK|0x00020000)
#define LED_4_OFF (LEDBANK=LEDBANK^0x00000040)
#define LED_3_OFF (LEDBANK=LEDBANK^0x00000020)
#define LED_2_OFF (LEDBANK=LEDBANK^0x00000010)
#define LED_1_OFF (LEDBANK=LEDBANK^0x00020000)
还有, 那个 windows 上的控制测试程序, 每次执行点击 button 发出的 int
数好像是这样, 和程序上的有些出入:?::
LED1 button:f3 和 f1
LED2 button:f5 和 f1
LED3 button:f9 和 f1 在获得端点状态的时候,有个笔误:
//SetupPkt = (D12Dat&2)?1:0;
//SetupPkt = 0;
应改过来:
SetupPkt = (D12Dat&2)?1:0;
SetupPkt = 0;
页:
[1]