Hi,
I'm working with MCB4300 eval board using MDK 4 and trying to operate the OTG supplement on USB0. Is there a specific support for OTG in case I'm using the USB library given by keil ( V4.60 )? Does anyone have a good code example demonstrating the use of OTG?
Thanks in advance, Idan
Yes. I'm familiar with this ID pin but don't know exactly when do I need to check it out during enumeration process...?
Is this not a must to support the HNP & SRP protocols using software?
Do you maybe have a code example for switching the roles?
Do you know if OTG is supported in a newer keil version say MDK5 ( USB Component V6.0 and above ) ?
Thanks for all the help!
Idan
Well, for ID pin you could initialize device as Peripheral when it is powered on, ID pin should have a pull-up enabled and when micro-A plug is connected it will pull ID pin low and that should generate an interrupt preferably and at that time you would uninitialize Peripheral and initialize Host until disconnect is signaled on port your device is Host unless you implement HNP and enable your Host to become Peripheral.
> Is this not a must to support the HNP & SRP protocols using software? This is really not clear to me, aren't most of microcontroller actions determined by software?
I do not have sample code but generally if you want to use Host you would call something like: usbh_init or USBH_Initialize
if you want to use Peripheral you would call something like: usbd_init or USBD_Initialize followed by usbd_connect(true) or USBD_Connect
if you want to switch to Peripheral from Host you would do something like: usbh_uninit or USBH_Uninitialize followed by usbd_init or USBD_Initialize followed by usbd_connect(true) or USBD_Connect
if you want to switch to Host from Peripheral you would do something like: usbd_connect(false) or USBD_Disconnect usbd_uninit or USBD_Uninitialize followed by usbh_init or USBH_Initialize followed by
> Do you know if OTG is supported in a newer keil version say MDK5 ( USB Component V6.0 and > above ) ? You should ask Keil support for that.
Thanks! you've helped a lot clearing some things up.
BTW, I meant example code for SRP & HNP.