LPC5528 Clock Setting

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

LPC5528 Clock Setting

1,504 Views
tks11111
Contributor II

Hi all,

Recently I was checking the clock setting of our project. Some questions comes out in my mind.

Here are the questions:

1. The user manual states that we need to enable the 32 kHz clock for USB1_PHY. However, I found a comment in the function USB_DeviceClockInit with the following content inside. call POWER_DisablePD(kPDRUNCFG_PD_LDOUSBHS); /*!< Ensure xtal32k is on */
Do we need a xtal32k crystal for USB1? This is strange because I set up the osc32kHz in BOARD_BootClockPLL150M. You can see the following.

/*!< Configure RTC OSC */
    POWER_EnablePD(kPDRUNCFG_PD_XTAL32K);                /*!< Powered down the XTAL 32 kHz RTC oscillator */
    POWER_DisablePD(kPDRUNCFG_PD_FRO32K);                /*!< Powered the FRO 32 kHz RTC oscillator */
    CLOCK_AttachClk(kFRO32K_to_OSC32K);                  /*!< Switch OSC32K to FRO32K */
    CLOCK_EnableClock(kCLOCK_Rtc);                       /*!< Enable the RTC peripheral clock */
    RTC->CTRL &= ~RTC_CTRL_SWRESET_MASK;                 /*!< Make sure the reset bit is cleared */

2. If we do need the xtal32k for USB1, what's the freq tolerance for it?

3. For xtal32M, it can support the frequency from 12M to 32M. For my project, the peripheral frequencies I need are all below 12 M (except for USB1). Is there any difference in power consumption if I choose 32M instead of 12M?

Thanks,

BR,

Peter

Labels (4)
0 Kudos
Reply
3 Replies

1,476 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

For LPC552x, the 32KHz RTC clock is only used when the USB1 is host and in low power mode, when the USB1 PLL is off and reference clock is also powered down, the  32 kHz clock is used to send Resume to respond to the device remote wake-up (for host mode only).

 

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

1,431 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suggest you refer to RTC module init function, I copy it here.

void RTC_Init(RTC_Type *base)

{

#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)

/* Enable the RTC peripheral clock */

CLOCK_EnableClock(kCLOCK_Rtc);

#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */

 

#if !(defined(FSL_FEATURE_RTC_HAS_NO_RESET) && FSL_FEATURE_RTC_HAS_NO_RESET)

RESET_PeripheralReset(kRTC_RST_SHIFT_RSTn);

#endif

/* Make sure the reset bit is cleared */

base->CTRL &= ~RTC_CTRL_SWRESET_MASK;

 

#if !(defined(FSL_FEATURE_RTC_HAS_NO_OSC_PD) && FSL_FEATURE_RTC_HAS_NO_OSC_PD)

/* Make sure the RTC OSC is powered up */

base->CTRL &= ~RTC_CTRL_RTC_OSC_PD_MASK;

#endif

}

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

1,470 Views
tks11111
Contributor II

Hi XiangJun Rong,

I tried to comment out the code related to configuring RTC OSC, and it led to USB1 device being not able to enumerate.

Also, from the MCUXpresso Config Tools v14, it showed that USB would not work if we didn't enable OSC32kHz_clock, which matched the same result from my test (commenting out the code related to configuring RTC OSC).

Could you please help me check if there is any flaw in my test result? BTW, the sample code I used was generated by MCUXpresso Config Tools v14.

Let me know if I need to provide any.

Thanks.

BR,

Peter 

0 Kudos
Reply