Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hi,
is there a callback function to check if the low frequency crystal is stable?
How to configure the sysctl DL_SYSCTL_IIDX_LFXT_GOOD interrupt?
Regards, Holger
Tool/software:
Hi,
is there a callback function to check if the low frequency crystal is stable?
How to configure the sysctl DL_SYSCTL_IIDX_LFXT_GOOD interrupt?
Regards, Holger
Hi Holger,
There is a CLK_OUT function could be configured in sysconfig, you could enable it and select the CLK_OUT pin. Then you could observed the clock waveform on this pin by scope or by logic analyzer.
Best Regards,
Pengfei
Hi Pengfei,
that would be perfect for evaluation and development.
I need something for series code to monitor stable clock. Is there an example code which uses SYSCTL interrupt handler for LFXTGOOD?
Regards, Holger
Hi Holger,
Sorry for late reply. We do not have the example for monitoring clock by interrupt. But if you configure LFXT in Sysconfig, the generated code will include the function to monitor external LFXT status by polling.
For example, in SDK sysctl_lfxt_standby example, if you import and build the project, you could see below code in DL_SYSCTL_setLFCLKSourceLFXT() API. The LFXT status is monitored after LFXT get enabled. After LFXT get stable, the LFXTGOOD bit is set and program will move forward. You could use similar code to check crystal status.
Best Regards,
Pengfei
Hi Holger,
Yes. There are interrupts that could indicate the ready status of clock such as LFXT, LFOSC, HFCLK. They are parts of SYSCTL interrupt and need to be enabled before you want to use by DL_SYSCTL_enableInterrupt().
But in our SDK examples, it uses polling way to check clock status, to make sure the clock is ready before program go forward to application program.
Hi Pengfei,
customer don't want to poll. He was looking for the interrupt handler. There is not handler in the startup_mspm0l222x_ticlang.c listed for SYSCTL:
Regards, Holger
Hi Holger,
The SYSCTL interrupt is belong to INT_GROUP0. You could refer nvic_interrupt_grouping example in SDK to see how to handle GROUP interrupt.
Hi Pengfei,
the GROUP0 handler seems correct but it will not be executed with LFXT_GOOD.
This is the customer code:
It will executed if he set the bit manual:
Is there something missing in the configuration?
Regards, Holger
Hi Holger,
If customer want to configure LFXT GOOD interrupt, they could follow below steps:
1. Enable LFXT in sysconfig clock tree.
2. Enable SYSCTL IRQ and LFXT_GOOD interrupt before system init.
3. Achieve GROUP0 interrupt handler in below way:
Best Regards,
Pengfei