LPC55S16 - Reconfiguring USB from Host to Device on the fly?

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

LPC55S16 - Reconfiguring USB from Host to Device on the fly?

819 Views
pg8v
Contributor I

As the LPC55S16 does not support OTG, I'm investigating other ways in which the chip could take on Host and Device roles within the same software application. From a hardware perspective, it appears that the physical layer functionality required for either Host or Device operation is largely contained internal to the chip (eg. the Host or Device specific pull-up arrangements required for initial signalling), so other than providing the usual termination resistors, and dealing with the USB Vbus power arrangements, the hardware aspects look fairly easy to accomplish.  What I have no feel for though, is whether it would be practical to have both Host and Device drivers / middleware resident in the user application, and to somehow switch between the two on the rare occasions that the product needed to function as a USB Host (for 95% of the time, the product would be used in Device mode). The switching doesn't need to happen automatically; it would be perfectly ok to have the user set the product into Host mode, eg via a user menu, when Host behaviour is required. I realise that this is a pretty "clunky" way to get around the lack of OTG functionality, but I'd be really grateful for any advice on whether this could actually be made to work, or is likely to be beset with problems.

0 Kudos
Reply
2 Replies

801 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

As you know that the LPC55S16 does not support OTG although the LPC5516 has both separate USB device and USB host modules for full speed USB and high speed usb.

I suppose it is difficult to implement OTG for the LPC55S16 without hardware support.

Hope it can help you

BR

XiangJun Rong

 

0 Kudos
Reply

795 Views
pg8v
Contributor I

Very many thanks XiangJun Rong, for your reply! To be clear, I don't require actual OTG in the true sense (ie. automatic Host & Device detection etc.). All that I need is the ability within my code to switch the USB port functionality from Device to Host at the manual request of the user; this would mean having both Host and Device USB stack code present in the application, and invoking one or the other depending on what operating mode the user has manually selected.  Due to the complexities of the USB Device and Host code, I'm not sure if it the two could co-exist in the same application, pointing at the same USB port, and for the user application software to then select one or the other manually; are the Host and Device code modules independent from each other, or do they share common software aspects which would conflict with each other if the user application tries to include them both?

0 Kudos
Reply