用的是c8051f321单片机,USB初始化使用的是系统默认的配置
void USB0_Init (void)
{
POLL_WRITE_BYTE (POWER, 0x08); // Force Asynchronous USB Reset
POLL_WRITE_BYTE (IN1IE, 0x07); // Enable Endpoint 0-1 in interrupts
POLL_WRITE_BYTE (OUT1IE,0x07); // Enable Endpoint 0-1 out interrupts
POLL_WRITE_BYTE (CMIE, 0x07); // Enable Reset, Resume, and Suspend interrupts
USB0XCN = 0xE0; // Enable transceiver; select full speed
POLL_WRITE_BYTE (CLKREC,0x80); // Enable clock recovery, single-step mode disabled
EIE1 |= 0x02; // Enable USB0 Interrupts
POLL_WRITE_BYTE (POWER, 0x01); // Inhibit Bit and enable suspend detection // Enable USB0 by clearing the USB
}
当bNumEndpoints为1的时候枚举正常,系统正常运行,但是调试上位机的时候出现了问题,然后我想把bNumEndpoints改为2试下的时候,枚举通过不了,(甚至电脑usb一度用不了)获取配置描述符的时候第二个端点描述符不能获取,然后停留在那里,哪位大神帮我分析下 |