LPC177x/178x USB configuration clarification

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

LPC177x/178x USB configuration clarification

863 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdupre on Mon Oct 28 17:31:17 MST 2013
On the LPC 177x/178x chips, is it possible to configure USB1 as a regular device (not OTG device) while simultaneously using USB2 as host?

User Manual 14.7.3  (Figure 51) shows host on USB1 and device on USB2.  There is no mention of the reversed configuration with device on USB1 and host on USB2.

Section 14.8.5 (Table 314) lists STCTRL PORT_FUNC bits:


Quote:
Controls connection of USB functions (see Figure 52). Bit 0 is set or cleared by hardware
when B_HNP_TRACK or A_HNP_TRACK is set and HNP succeeds. See Section 14.9.
00: U1 = device (OTG), U2 = host
01: U1 = host (OTG), U2 = host
10: Reserved
11: U1 = host, U2 = device
In a device-only configuration, the following values are allowed:
00: U1 = device. The USB device controller signals are mapped to the U1 port:
USB_CONNECT1, USB_UP_LED1, USB_D+1, USB_D-1.
11: U2 = device. The USB device controller signals are mapped to the U2 port:
USB_CONNECT2, USB_UP_LED2, USB_D+2, USB_D-2.




I'm not sure what is meant by "In a device-only configuration".  Does that mean no hosts?  Or does it only mean not operating in OTG mode? 

If I set STCTRL bits 1:0 to 00,  can I use USB1 as device (without the extra OTG hardware) while simultaneously using USB2 as host???


- Joe

Labels (1)
0 Kudos
Reply
2 Replies

821 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kiantek on Wed Jul 29 04:39:05 MST 2015
Hi Tsuneo,

Greeting. Can you share with us how you handle the USB2 Over-current Flag?

I am using LPCOPEN v2.10 on LPC1788. I able to modify the code and change the host from U1 to U2. However, I face problem when I try to enable Over-current protection. The code is working fine if I do not define P1.31 as USB_OVRCR2.

I added "Chip_IOCON_PinMux(LPC_IOCON, 1, 31, IOCON_MODE_INACT, IOCON_FUNC1);"  in the HAL_USBInit(...).  But the power is switch off and the board can't read the thumbdrive. Is there anyway to enable the power? i.e. Vout?

Sincerely,

KT
0 Kudos
Reply

821 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Tue Oct 29 09:42:24 MST 2013

Quote:
On the LPC 177x/178x chips, is it possible to configure USB1 as a regular device (not OTG device) while simultaneously using USB2 as host?


It's possible by setting STCTRL:PORT_FUNC to 00
Assign pin functions, as follows.

USB1 - device
P0.29 - USB_D+1
P0.30 - USB_D-1
P1.30 - USB_VBUS - input for VBUS(5V) detection
P2.9  - #USB_CONNECT1 - output to enable 1k5 D+ pull-up resistor

USB2 - host
P0.31 - USB_D+2
USB_D-2
P1.30 - USB_PWRD2 - input to detect VBUS(5V) voltage
P1.31 - #USB_OVRCR2 - input to get over-current flag
P0.12 - #USB_PPWR2 - output to enable an external VBUS(5V) power switch

Tsuneo
0 Kudos
Reply