Hello, I want to clock the LPTMR using the internal reference clock, but this does not work unless the internal reference clock is enabled, so I need to call CLOCK_SetInternalRefClkConfig(), per the SDK 2.0 API reference. But I cannot find CLOCK_SetInternalRefClkConfig anywhere in the 2.0 SDK.
Thanks
解決済! 解決策の投稿を見る。
I see what you mean. The code should work as intended if you use one of the predefined masks, such as kMCGLITE_IrclkEnable. On that note, however, I see that there is a 0U in BOARD_BootClockRUN's .irclkEnableMode, which is not a predefined mask and will have the affect you described.
To fix this, make sure you put one of the predefined masks (kMCGLITE_IrclkEnable or kMCGLITE_IrclkEnableInStop) into .irclkEnableMode and everything should work as intended. I will send this to the right people to get the 0U replaced with a mask, and see about getting the API reference manual updated.
With this in mind, I do believe that the steps outlined in my first reply should hold.
Best regards,
Charles
Hi Chuck,
assuming you've filled out configuration structures already, then all you should have to do in terms of API is:
1. Call CLOCK_SetSimSafeDivs()
2. Call CLOCK_SetMcgliteConfig(...)
3. Call CLOCK_SetSimConfig(...)
Is this not the case?
Charles
After poking around a bit, I did find CLOCK_SetMcgliteConfig(), and that does the job. However, I am still surprised the API reference document for the SDK refers to a function, CLOCK_SetInternalRefClkConfig() that apparently does not exist.
Also, I believe there is an issue in CLOCK_SetMcgliteConfig(), in the following line of code:
MCG->C1 = MCG_C1_CLKS(targetConfig->outSrc) | targetConfig->irclkEnableMode;
If irclkEnableMode is just a 0 or a 1, then the C1 bit this is loaded into is incorrect...it needs to be shifted into bit 1.
Thanks,
Chuck
I see what you mean. The code should work as intended if you use one of the predefined masks, such as kMCGLITE_IrclkEnable. On that note, however, I see that there is a 0U in BOARD_BootClockRUN's .irclkEnableMode, which is not a predefined mask and will have the affect you described.
To fix this, make sure you put one of the predefined masks (kMCGLITE_IrclkEnable or kMCGLITE_IrclkEnableInStop) into .irclkEnableMode and everything should work as intended. I will send this to the right people to get the 0U replaced with a mask, and see about getting the API reference manual updated.
With this in mind, I do believe that the steps outlined in my first reply should hold.
Best regards,
Charles
Agreed - thanks.