The code example at he end of this post is generated by the clocks tool. (It includes details about the clocks version and processor / package.)
I have no questions about the code itself, but I have failed to find documentation on what number corresponds with what clock source. More specifically, I am asking about the three last lines defined as 2U, 0U and 2U respectively.
Thanks in advance! (And I hope I did not miss something obvious. )
----- code example below -----
/* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* !!GlobalInfo product: Clocks v4.0 processor: MKW41Z512xxx4 package_id: MKW41Z512VHT4 mcu_data: ksdk2_0 processor_version: 3.0.1 board: FRDM-KW41Z * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /* clang-format on */ #include "fsl_smc.h" #include "fsl_rtc.h" #include "clock_config.h" /******************************************************************************* * Definitions ******************************************************************************/ #define RTC_OSC_CAP_LOAD_0PF 0x0U /*!< RTC oscillator capacity load: 0pF */ #define SIM_LPUART_CLK_SEL_OSCERCLK_CLK 2U /*!< LPUART clock select: OSCERCLK clock */ #define SIM_OSC32KSEL_OSC32KCLK_CLK 0U /*!< OSC32KSEL select: OSC32KCLK clock */ #define SIM_TPM_CLK_SEL_OSCERCLK_CLK 2U /*!< TPM clock select: OSCERCLK clock */
Solved! Go to Solution.
Hello Robrecht,
You can find description of clock selectors and other information in the reference manual, see for example the https://www.nxp.com/docs/en/reference-manual/MKW41Z512RM.pdf reference manual.
The SIM clock selector values are described in the Chapter 11 System Integration Module (SIM), register definition:
Best Regards,
Marek Neuzil
Hello,
The comments of these definition contains the name of the clock selector and the selected value, see for example the SIM_LPUART_CLK_SEL_OSCERCLK_CLK definition. It is LPUART0SRCSEL clock selector (in the SIM device) that selects the OSCERCLK clock signal, see the following screenshot of the diagram:
Best Regards,
Marek Neuzil
Hello Marek,
Thanks for responding to my question. However, your screenshot does not answer, but does further illustrate what my question is about. I encountered this screen and I noticed that the application knows what numbers correspond with what clock source.
However my question is, how can I know. Is the application the only source of this information? I suspect there are some technical specifications describing this? It just seems a bit weird that you'd need this application to figure out what bits correspond with what clock source.
Hello Robrecht,
You can find description of clock selectors and other information in the reference manual, see for example the https://www.nxp.com/docs/en/reference-manual/MKW41Z512RM.pdf reference manual.
The SIM clock selector values are described in the Chapter 11 System Integration Module (SIM), register definition:
Best Regards,
Marek Neuzil