How to use both USB (Host and device) on lpc1788

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

How to use both USB (Host and device) on lpc1788

1,046 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbg on Tue Dec 01 01:24:27 MST 2015
Hello,
I would like to use both USB  (Host and device) on the LPC1788 device.
USB_IRQHandler duplicate define in usbh_ohci_lpc177x_8x.c(for host) and usbd_user_hid.c(for device)
How do I combine them?
Labels (1)
0 Kudos
5 Replies

885 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbg on Tue Dec 08 22:36:45 MST 2015
I use Kiel 4.7.4 with RL library (for MMC,USB,Network)
I think RL library does not work well
You have the experience of using the library?
0 Kudos

885 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Wed Dec 02 07:46:45 MST 2015
I may very well be wrong.
I looked at UM10470 section 14.7.1 and it does show U1 as OTG and U2 as host, and 14.7.3 shows another configuration.
I became confused as there is only one USB peripheral.
I would look at the LPCOpen samples to see how to control the peripheral, if such sample code exists.

0 Kudos

885 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbg on Wed Dec 02 03:13:41 MST 2015
sorry but I think your wrong because LPC1788 have two ports and they support OTG. theese two ports have the same interupt.. Can I seprate their interupt or read the USB register status to know the host interupt happen or devise?

0 Kudos

885 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Tue Dec 01 23:36:11 MST 2015

Quote: rocketdawg
The LPC1788 is not capable of doing USB Host and USB Device at the same time because it has only one USB peripheral.
this peripheral can be programmed for Host or device, not Host and device.
you may want to look at LPC1800 or LPC4300 series which have two USB peripherals, so one can be device AND the other can be Host.



This is simply not true.
(There may be a restriction on the 144 pin part, we have the QFP 208.)
The 1778/1788 does have two USB channels (and pins)
In the UM  (Rev 3.1 September 2014) look at the first entry in table 315, chapter 14.
I know this the OTG chapter, but the PORT_FUNC settings are valid for device and/or host.

Cheers, Mike.

As for your question: rename one of them.
Use the 'refactor' feature of the IDE editor perhaps.
I do not edit via the IDE so I don't know exactly how this works, but I saw it in one of the (long) training videos on the NXP site.
(When it was still Code Red!)
0 Kudos

885 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Tue Dec 01 08:12:32 MST 2015
The LPC1788 is not capable of doing USB Host and USB Device at the same time because it has only one USB peripheral.
this peripheral can be programmed for Host or device, not Host and device.
you may want to look at LPC1800 or LPC4300 series which have two USB peripherals, so one can be device AND the other can be Host.
0 Kudos