Questions about the LPC51U68 USB

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

Questions about the LPC51U68 USB

Jump to solution
370 Views
hermus
Contributor II

Hi

I want to use a software a approach to simulate the condition where USB VBus detects a connection, and modify it using the framework of the exmaple code 'dev_cdc_vcom_lite_bm'.

The environment I'm working with is the LPC51U68 EVK.

In the LPC51U68 Product data sheet, on page 85, there's a section that says: 
'Remark: When a self-powered circuit is used without connecting VBUS, configure the USB_VBUS pin for GPIO (PIO1_6 or PIO1_11) and provide software that can detect the host presence through some other mechanism before enabling USB_CONNECT and the SoftConnect feature. Enabling the SoftConnect without host presence leads to USB compliance failure. '

Does this mean that other methods can be used to replace VBus detection of the host? For example, using a software flag to directly drive USB enumeration?

I noticed in UM11071 that when both DCON (bit 16) and VBUSDEBOUNCED (bit 28) in DEVCMDSTAT are 1, the devices status changes to 'connected'. So, the code should include a condition that checks these two bits to ensure USB Initial or Run succeeds, leading to normal enumeration, right? Can you tell me the key word to focus on?

Labels (2)
0 Kudos
Reply
1 Solution
326 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @hermus 

On the LPC51U68 EVK, JP10 connects the USB VBUS signal to P1_6, which is the dedicated USB0_VBUS pin. When JP10 is shorted, the MCU can detect VBUS, set the VBUSDEBOUNCED bit, and proceed with USB enumeration.

 

If JP10 is open, the MCU cannot detect VBUS, meaning the VBUSDEBOUNCED bit never gets set. Consequently, the internal pull-up on D+ will never be activated, causing enumeration failure.

Harry_Zhang_0-1742443350210.png

If you want to bypass the VBUS detection mechanism by simulating it in software. Since you’ve already tried configuring P1_6 as GPIO, you could manually set the VBUSDEBOUNCED bit using the DEVCMDSTAT register.

Harry_Zhang_1-1742443459038.png

 

However, the VBUSDEBOUNCED bit is read-only, meaning it’s not directly writable by software.

you can try:

Powering the Device Externally: Provide a constant VBUS signal through hardware to keep P1_6 high.

Jumping Directly to Enumeration: Skip the VBUS check and directly set the DCON bit after USB initialization. For example, after calling USBD_API->hw->Init() and configuring endpoints, immediately call:

USBD_API->hw->Connect(g_hUsb, 1);

BR

Harry

 

View solution in original post

3 Replies
347 Views
hermus
Contributor II

Hardware: OM40005 (LPC51U68 EVK)
Software:
    SDK Version: 2.15.00
    Maifest Version: 3.14.0

In the example code under usb_examples > rom_dev_cdc_bm, I noticed the line USBD_API->hw->Connect(g_hUsb, 1) which seems to align with the SoftConnect functionality.

To verify whether the Connect function works, I performed open-circuit and short-circuit tests on JP10 of the LPC51U68 EVK. When JP10 is shorted, enumeration works normally, but when it’s open, enumeration fails.

Regardless of whether I configure P1_6 as USB0_VBUS or GPIO, after opening JP10 and monitoring D+ with a Logic Analyzer, I found that during operation, there’s no period where D+ goes high, meaning enumeration fails.

What confuses me is that in UM11071, Chapter 22.4.3 SoftConnect, it states:

'The softConnect signal is implemented internally. An external pull-up resistor between USB_DP and VDD is not necessary. Software can control the pull-up by setting the DCON bit in the DEVCMDSTAT register. If the DCON bit is set to 1, the USB_DP line is pulled up to VDD through an internal 1.5 KOhm pull-up resistor.'

So why does the pull-up only work when JP10 is shorted and P1_6 is set to USB0_VBUS?

Additionally, the description in Section 22.4.3 seems inconsistent with the description of the DCON bit in Table 348 of the DEVCMDSTAT register. The DCON bit is described as:

'The connect bit must be set by SW to indicate that the device must signal a connect. The pull-up resistor on USB0_DP will be enabled when this bit is set and the VBUSDEBOUNCED bit is one.'

It appears that the VBUSDEBOUNCED bit must also be set to 1, and since VBUSDEBOUNCED is tied to the VBus detection pin. Does this mean VBus detection is required for D+ to be pulled up?

I’d like to ask: If I don’t connect JP10, what methods can I use in the LPC51U68 example code to ensure normal USB operation? Or is it absolutely necessary to short JP10 for VBus detection to enable USB to perform subsequent actions properly?

0 Kudos
Reply
327 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @hermus 

On the LPC51U68 EVK, JP10 connects the USB VBUS signal to P1_6, which is the dedicated USB0_VBUS pin. When JP10 is shorted, the MCU can detect VBUS, set the VBUSDEBOUNCED bit, and proceed with USB enumeration.

 

If JP10 is open, the MCU cannot detect VBUS, meaning the VBUSDEBOUNCED bit never gets set. Consequently, the internal pull-up on D+ will never be activated, causing enumeration failure.

Harry_Zhang_0-1742443350210.png

If you want to bypass the VBUS detection mechanism by simulating it in software. Since you’ve already tried configuring P1_6 as GPIO, you could manually set the VBUSDEBOUNCED bit using the DEVCMDSTAT register.

Harry_Zhang_1-1742443459038.png

 

However, the VBUSDEBOUNCED bit is read-only, meaning it’s not directly writable by software.

you can try:

Powering the Device Externally: Provide a constant VBUS signal through hardware to keep P1_6 high.

Jumping Directly to Enumeration: Skip the VBUS check and directly set the DCON bit after USB initialization. For example, after calling USBD_API->hw->Init() and configuring endpoints, immediately call:

USBD_API->hw->Connect(g_hUsb, 1);

BR

Harry

 

278 Views
hermus
Contributor II
Hi @Harry_Zhang,

Thank you for your response. Your method is feasible. However, I later noticed a pull-down resistor R75 near P1_6. Therefore, I performed an inverted operation on P1_6 and left JP10 open circuit, allowing the LPC51U68 to interpret 0 as 1.
0 Kudos
Reply