How to design USB1 OTG device/host using same circuit

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to design USB1 OTG device/host using same circuit

2,340 Views
vasudhevan
Contributor V

Hi,

       How can we design usb1 otg should act device as well as host using imxrt1064 ?

       I got some link from nxp forum https://community.nxp.com/thread/319562  any other method is there using single usb micro connector achieve both host and device operation ?

Thanks & Regards

        Vasu

Labels (1)
0 Kudos
5 Replies

2,116 Views
fangfang
NXP TechSupport
NXP TechSupport

Hello.

For the application please refer to the design of the EVK. USB OTG1 is configured in Dual Role mode, that is, it can be used as HOST or device.

  The resistor pulls the USB OTG1 ID pin to 3.3V. For the RT1064 EVK circuit, when the USB OTG1 ID is high, the NX5P3090UK passes the role of the 2SK3018 transistor. The EN interface is low, so 5V_USB_OTG is not output. So the development board is device.
When the circuit is connected to the USB OTG to Host line, the USB OTG1 ID automatically switches to a low level, so the EN interface of the NX5P3090UK is high. At this time, there is 5V_USB_OTG output voltage, so the development board can be used as HOST.

Hope it help you.

0 Kudos

2,116 Views
vasudhevan
Contributor V

Hi fangfang,

        Thank you for your response.

        I checked with evk schematic.

        I imported evkmimxrt1064_host_msd_fatfs_bm example project USB OTG1 ID pin is not assigned.

        How this pin managed USB OTG1 ID in example projects ?

        Whenever inserting host device that time only this pin goes to low correct ?

        MCU one pin USB_OTG1_ID assigned how can we handle this pin using code ?

Thanks & Regards

         Vasu

0 Kudos

2,116 Views
fangfang
NXP TechSupport
NXP TechSupport

Hello Vasu.

Please refer to the file as the attached.

0 Kudos

2,115 Views
johannzimmerman
Contributor II

Hi,
I have the same question:
How does the application get what is currently connected to the USB port?
Can I then initialize the USB device and USB host (as in the examples of the SDK)
at the same time and handle both in the IRQ like below?

void USB_OTG1_IRQHandler ()
{
    USB_DeviceEhciIsrFunction(s_cdcVcom.deviceHandle);
    USB_HostEhciIsrFunction (g_HostHandle);
}

In the examples of the SDK, only hosts or devices exist.
Is there any example of other NXP CPUs in the SDK?

Regards
Johann

0 Kudos

2,116 Views
tim_wang
NXP Employee
NXP Employee

Hi Johann,

You can refer to the pin_detect_hid_mouse demo in SDK.

Thanks

0 Kudos