LPC55S69 USB1 HS PHY PLL initialization

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

LPC55S69 USB1 HS PHY PLL initialization

203 Views
pettel
Contributor II

The documentation (UM11126, Rev. 2.8, Table 850) says for Bit 21 PLL_REG_ENABLE:

SW must set this bit 15 us before settiing PLL_POWER to avoid glitches on PLL output clock.

 

When I look in the source code of the the SDK (Version 25.6.0) into fsl_clock.c:
2045 │ /* Enable USB PHY clock */
2046 │ bool CLOCK_EnableUsbhs0PhyPllClock(clock_usb_phy_src_t src, uint32_t freq)
....

2120 │ USBPHY->PLL_SIC = (USBPHY->PLL_SIC & ~USBPHY_PLL_SIC_PLL_DIV_SEL(0x7)) | phyPllDiv;
2121 │ USBPHY->PLL_SIC_SET = USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK;
2122 │ USBPHY->PLL_SIC_CLR = (1UL << 16U); // Reserved. User must set this bit to 0x0
2123 │ USBPHY->PLL_SIC_SET = USBPHY_PLL_SIC_SET_PLL_POWER_MASK;
2124 │ USBPHY->PLL_SIC_SET = USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK;
2125 │
2126 │ USBPHY->CTRL_CLR = USBPHY_CTRL_CLR_CLKGATE_MASK;

 

PLL_REG_ENABLE is set in line 2121 and PLL_POWER is set in line 2123 with no regard for the 15 us time delay required in the user manual. Is this function in fsl_clock.c flawed or am I missing something?

0 Kudos
Reply
1 Reply

158 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @pettel 

I have reviewed both the UM11126 and the SDK  implementation for enabling the USB PHY PLL.
According to the UM, software must set the PLL_REG_ENABLE bit at least 15 microseconds before setting PLL_POWER to avoid glitches on the PLL output clock:

ZhangJennie_0-1758513929134.png

However, in the current SDK implementation (fsl_clock.c), PLL_REG_ENABLE and PLL_POWER are set consecutively without any delay in between.

To ensure reliable operation, I suggest adding a 15-microsecond delay between setting PLL_REG_ENABLE and PLL_POWER.

I will report it to the SDK team meanwhile. Thank you so much for bringing the problem to our attention.

Best Regards

Jun Zhang

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2172921%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELPC55S69%20USB1%20HS%20PHY%20PLL%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2172921%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20documentation%20(UM11126%2C%20Rev.%202.8%2C%20Table%20850)%20says%20for%20Bit%2021%26nbsp%3BPLL_REG_ENABLE%3A%3C%2FP%3E%3CP%3ESW%20must%20set%20this%20bit%20%3CSTRONG%3E15%20us%20before%20settiing%20PLL_POWER%3C%2FSTRONG%3E%20to%20avoid%20glitches%20on%20PLL%20output%20clock.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EWhen%20I%20look%20in%20the%20source%20code%20of%20the%20the%20SDK%20(Version%2025.6.0)%20into%20fsl_clock.c%3A%3CBR%20%2F%3E2045%20%E2%94%82%20%2F*%20Enable%20USB%20PHY%20clock%20*%2F%3CBR%20%2F%3E2046%20%E2%94%82%20bool%20CLOCK_EnableUsbhs0PhyPllClock(clock_usb_phy_src_t%20src%2C%20uint32_t%20freq)%3CBR%20%2F%3E%3CSPAN%3E....%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E2120%20%E2%94%82%20USBPHY-%26gt%3BPLL_SIC%20%3D%20(USBPHY-%26gt%3BPLL_SIC%20%26amp%3B%20~USBPHY_PLL_SIC_PLL_DIV_SEL(0x7))%20%7C%20phyPllDiv%3B%3CBR%20%2F%3E2121%20%E2%94%82%20USBPHY-%26gt%3BPLL_SIC_SET%20%3D%20USBPHY_PLL_SIC_SET_PLL_REG_ENABLE_MASK%3B%3CBR%20%2F%3E2122%20%E2%94%82%20USBPHY-%26gt%3BPLL_SIC_CLR%20%3D%20(1UL%20%26lt%3B%26lt%3B%2016U)%3B%20%2F%2F%20Reserved.%20User%20must%20set%20this%20bit%20to%200x0%3CBR%20%2F%3E2123%20%E2%94%82%20USBPHY-%26gt%3BPLL_SIC_SET%20%3D%20USBPHY_PLL_SIC_SET_PLL_POWER_MASK%3B%3CBR%20%2F%3E2124%20%E2%94%82%20USBPHY-%26gt%3BPLL_SIC_SET%20%3D%20USBPHY_PLL_SIC_SET_PLL_EN_USB_CLKS_MASK%3B%3CBR%20%2F%3E2125%20%E2%94%82%3CBR%20%2F%3E2126%20%E2%94%82%20USBPHY-%26gt%3BCTRL_CLR%20%3D%20USBPHY_CTRL_CLR_CLKGATE_MASK%3B%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EPLL_REG_ENABLE%20is%20set%20in%20line%202121%20and%20PLL_POWER%20is%20set%20in%20line%202123%20with%20no%20regard%20for%20the%2015%20us%20time%20delay%20required%20in%20the%20user%20manual.%20Is%20this%20function%20in%20fsl_clock.c%20flawed%20or%20am%20I%20missing%20something%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2173232%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC55S69%20USB1%20HS%20PHY%20PLL%20initialization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173232%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F244769%22%20target%3D%22_blank%22%3E%40pettel%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20reviewed%20both%20the%20UM11126%20and%20the%20SDK%26nbsp%3B%20implementation%20for%20enabling%20the%20USB%20PHY%20PLL.%3CBR%20%2F%3EAccording%20to%20the%20UM%2C%20software%20must%20set%20the%20PLL_REG_ENABLE%20bit%20at%20least%2015%20microseconds%20before%20setting%20PLL_POWER%20to%20avoid%20glitches%20on%20the%20PLL%20output%20clock%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ZhangJennie_0-1758513929134.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ZhangJennie_0-1758513929134.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357869iA2D2E338DCD01848%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ZhangJennie_0-1758513929134.png%22%20alt%3D%22ZhangJennie_0-1758513929134.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EHowever%2C%20in%20the%20current%20SDK%20implementation%20(fsl_clock.c)%2C%20PLL_REG_ENABLE%20and%20PLL_POWER%20are%20set%20consecutively%20without%20any%20delay%20in%20between.%3C%2FP%3E%0A%3CP%3ETo%20ensure%20reliable%20operation%2C%20I%20suggest%20adding%20a%2015-microsecond%20delay%20between%20setting%20PLL_REG_ENABLE%20and%20PLL_POWER.%3C%2FP%3E%0A%3CP%3EI%20will%20report%20it%20to%20the%20SDK%20team%20meanwhile.%20Thank%20you%20so%20much%20for%20bringing%20the%20problem%20to%20our%20attention.%3C%2FP%3E%0A%3CP%3EBest%20Regards%3C%2FP%3E%0A%3CP%3EJun%20Zhang%3C%2FP%3E%3C%2FLINGO-BODY%3E