Цитата(Trashy @ Jun 20 2005, 09:01)
Как на 68013 определить подключение/отключение ЮСБ кабеля?
Есть какой-нить битик? А то, "Start Of Frame" по таймеру лень вылавливать...
И ещё как принудительно ПЛЛ перевести в режим USB1.1...
Только, у меня всё обрабатывается железом. По сему нет возможности дескрипторами сконфигурить.
There is another way. Here's an 8051 procedure for controlling FS / HS mode:
Set bit7 in the I2C Configuration Byte and leave it (8051 always controls mode)
At the top of periph.c file make it, xdata volatile unsigned char force_mode _at_ 0xE6FB
Set up an event to switch between modes, perhaps a vend_cmd
Assuming you use two separate vend_cmd's then do this:
case VX_A2: // full speed
{ // doing a discon does affect some EZ-USB FX2 register, check TRM to see
// ...if this will impact your applicaton
USBCS |= 0x80; // Discon
EZUSB_Delay(1500);
// ...you may need more delay here for the host to see this....
force_mode = 0x02; // set to FS mode
//...you may want to clear interrupts or whatever else here...
USBCS &= 0xF7; // Connect
break;
}
case VX_A3: // high speed
{ // doing a discon does affect some EZ-USB FX2 register, check TRM to see
//...if this will impact your applicaton
USBCS |= 0x80; // Discon
EZUSB_Delay(1500); // you may need more delay here for the host to see
this....
force_mode = 0x00; // set to HS mode
// ...you may want to clear interrupts or whatever else here....
USBCS &= 0xF7; // Connect
break;
}
I'm assuming this will be self powered. If so, then you might want to
come up "Disconnect", set bit6 of I2C Configuration Byte, and sense the
presence of VBus with a port pin.... as well...
The above allows the PC to send vend_cmds down to the device in order to
enumerate in FS or HS mode, your choice. Since the 8051 is in control you
should also include one of the above procedures in TD_Init( ); as the POR
default... so the PC can "talk" to the device using the vend_cmds.&