[MCXN236] Example source code for OTG

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

[MCXN236] Example source code for OTG

357 Views
bryan_hong
Senior Contributor I

dear nxp 

Could you provide the example  source code for OTG on mcxn236 ?

I can't find the example `application code hub` and MCUXpresso.

Thanks,
Bryan

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

329 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @bryan_hong 

Thank you for your question.

The OTG protocol is quite complex and has largely been phased out. Using a pin to detect and switch between host and device  is a simpler approach.

Please refer to the pin_detect_hid_mouse demo under SDK  for reference. 

Alice_Yang_0-1763005755267.png

 

When running the demo,

Host:  

Plug in a mouse to the test board. The board acts as an USB host. The stack switches to host mode and some device attached information is printed out.

Device:

Unplug the mouse with the cable. The board now acts as a USB device mouse. The mouse is detached and the USB switches to the device mode information.

 

Hope it helps.

 

BR

Alice

0 Kudos
Reply