PLL Lock lost interrupt

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

cross mob
User10696
Level 4
Level 4
First solution authored
I am looking into the possibility to detect when the system clock PLL loses lock.
The reference manual states: "The PLL may become unlocked, caused by a break of the crystal or the external clock line. In such a case, an NMI trap is generated if it were enabled."

But where can this be enabled to generate the NMI? I have looked at all the SCU registers but have not been able to find an enable bit. This is also not set by default.

In the default configuration I end up with a Bus Error fault if I stop the external crystal. This is not described in the reference manual.

How can this safety feature be used?
0 Likes
2 Replies
User8819
Level 4
Level 4
Hi,

read chapter about trap generation, enable trap associated with oscillator and maybe VCO in TRAPDIS, write your own NMI handler.

rum
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Using XMCLib

XMC_SCU_TRAP_ClearStatus(XMC_SCU_TRAP_VCO_LOCK);
XMC_SCU_TRAP_Enable(XMC_SCU_TRAP_VCO_LOCK);

Regards,
Jesus
0 Likes