五一放假在家没事,逛到了END圈圈的USB专区,小组公告的那段话很实在。原来做的项目都是通过串口通讯,看来有时间还是要学习一下USB。
这段时间看了一下协议和其他的一些资料,还只是一个模糊的认识,就先按照圈圈的那个USB鼠标的例子做了一个,电路和程序都没变,就是把晶振换成了11.0592M的,同时相应把config.h 上的Fclk换过来。确认无误后,插入电脑的USB接口,居然一次成功。
下面是通过USBTrace得到的一些数据,希望能给和我一样的初学者有所帮助。
port 1 : USB 人体学输入设备
Hardware ID: USB\Vid_8888&Pid_0002&Rev_0100Setup Class: HIDClassClass GUID: {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}PDO Name: \Device\USBPDO-5Service Name: HidUsb
Connection InformationConnectionIndex: 0x1CurrentConfigurationValue: 0x1LowSpeed: FALSEDeviceIsHub: FALSEDeviceAddress: 0x2NumberOfOpenPipes: 0x2ConnectionStatus: DeviceConnected
Pipe #0
Endpoint DescriptorbLength: 0x7bEndpointAddress: 0x82 [IN]bmAttributes: 0x3 (USB_ENDPOINT_TYPE_INTERRUPT)wMaxPacketSize: 0x40bInterval: 0xA
Pipe #1
Endpoint DescriptorbLength: 0x7bEndpointAddress: 0x2 [OUT]bmAttributes: 0x3 (USB_ENDPOINT_TYPE_INTERRUPT)wMaxPacketSize: 0x40bInterval: 0xA
Device DescriptorbLength: 0x12bcdUSB: 0x110bDeviceClass: 0x0bDeviceSubClass: 0x0bDeviceProtocol: 0x0bMaxPacketSize0: 0x10idVendor: 0x8888idProduct: 0x2bcdDevice: 0x100iManufacturer: 0x1iProduct: 0x2iSerialNumber: 0x3bNumConfigurations: 0x1
Configuration DescriptorbLength: 0x9bDescriptorType: USB_CONFIGURATION_DESCRIPTOR_TYPEwTotalLength: 0x29bNumInterfaces: 0x1iConfiguration: 0x0bmAttributes: 0xA0 ( Bus_Powered Remote_Wakeup )MaxPower: 0xC8
Interface DescriptorbLength: 0x9bInterfaceNumber: 0x0bAlternateSetting: 0x0bNumEndpoints: 0x2bInterfaceClass: 0x3 (Human Interface Device)bInterfaceSubClass: 0x1 (Boot Interface)bInterfaceProtocol: 0x2 (Mouse)iInterface: 0x0
有了一个初步的认识,再回过头来还是要好好领会一下协议、体会一下程序。
在这里感谢USB专区、感谢圈圈!
发布
用户220544 2009-5-16 21:41