XMC1404 - oscillater startup time

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User14251
Level 1
Level 1
I'm using XMC1404-Q048F0200 for a small series application.

When testing first 10 prototypes I recognized that exececution time of DAVE_Init() is different:
- 6 devices had a constant 14ms from powering the unit until the end of DAVE_Init()
- 4 devices had higher startup times (up to 80ms).

I did some investigation and found out that difference is caused by this routine in xmc1_scu.c:

/* API which initializes the clock tree ofthe device */
void XMC_SCU_CLOCK_Init(const XMC_SCU_CLOCK_CONFIG_t *const config)

especially this part

do
{
/* Restart OSC_HP oscillator watchdog */
SCU_INTERRUPT->SRCLR1 = SCU_INTERRUPT_SRCLR1_LOECI_Msk;

/* Enable OSC_HP oscillator watchdog*/
SCU_CLK->OSCCSR &= ~SCU_CLK_OSCCSR_XOWDEN_Msk;
SCU_CLK->OSCCSR |= SCU_CLK_OSCCSR_XOWDEN_Msk;

/* Wait a few DCO2 cycles for the update of the clock detection result */
delay(2500);

/* check clock is ok */
}
while(SCU_INTERRUPT->SRRAW1 & SCU_INTERRUPT_SRRAW1_LOECI_Msk);



So i spent some time to crystal and capacitor sizing. But without effecet. Then I desoldered a µC from a board with 14ms boot time and solderd it on a board which had a boot time of about 50ms before.
Boot time was then exactly 14ms.

EDIT:
I tried if i can find out more by toggling a port pin during oscillator init. For that i modified XMC_SCU_CLOCK_Init a little bit:

if (config->oschp_mode != XMC_SCU_CLOCK_OSCHP_MODE_DISABLED)
{
if (OSCHP_GetFrequency() > 20000000U)
{
SCU_ANALOG->ANAOSCHPCTRL |= (uint16_t)SCU_ANALOG_ANAOSCHPCTRL_HYSCTRL_Msk;
}

SCU_ANALOG->ANAOSCHPCTRL = (uint16_t)(SCU_ANALOG->ANAOSCHPCTRL & ~(SCU_ANALOG_ANAOSCHPCTRL_SHBY_Msk | SCU_ANALOG_ANAOSCHPCTRL_MODE_Msk)) |
config->oschp_mode;

const XMC_GPIO_CONFIG_t GPIO_Test =
{
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL,
.output_level = XMC_GPIO_OUTPUT_LEVEL_LOW,
};
XMC_GPIO_Init(XMC_GPIO_PORT0, 5U, &GPIO_Test);




do
{
/* Restart OSC_HP oscillator watchdog */
SCU_INTERRUPT->SRCLR1 = SCU_INTERRUPT_SRCLR1_LOECI_Msk;

/* Enable OSC_HP oscillator watchdog*/
SCU_CLK->OSCCSR &= ~SCU_CLK_OSCCSR_XOWDEN_Msk;
SCU_CLK->OSCCSR |= SCU_CLK_OSCCSR_XOWDEN_Msk;

/* Lindermayr 22.10.2017 Reset Watchdog*/
SCU_CLK->OSCCSR |= SCU_CLK_OSCCSR_XOWDRES_Msk;

//XMC_GPIO_SetOutputHigh(XMC_GPIO_PORT0,5U);
/* Wait a few DCO2 cycles for the update of the clock detection result */
delay(2500);
//XMC_GPIO_SetOutputLow(XMC_GPIO_PORT0,5U);
/* check clock is ok */

}
while(SCU_INTERRUPT->SRRAW1 & SCU_INTERRUPT_SRRAW1_LOECI_Msk);


Now i have a constant startup time of 14ms!
But why? I removed the lines with SetOutputHigh and SetOutputLow and it also worked.
So my idea was, some delay after writing SCU_ANALOG->ANAOSCHPCTRL may help instead of writing Digital IO configuration. But this didn't work.

In my application startup time is not critical. But i think that i'm somewhere out of spec and it may happen that µC won't start anymore (never happend up to now).
At the moment i'm testing the 20 first series PCB's. Same problem. About the half have a higher startup time.

Does anybody know what can cause this phenomena?

My setup:
3076.attach
3077.attach
3078.attach
3079.attach
3080.attach
0 Likes
0 Replies