What is the clock source for TSTMR in the K32L2A?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

What is the clock source for TSTMR in the K32L2A?

跳至解决方案
1,214 次查看
bobpaddock
Senior Contributor III

The data sheet for the K32L never gives a clear source for where the TSTMR clock comes from.
What follows are the various reference related to TSTMR scattered through the Reference Manual.

Anyone have answer?


" The TSTMR runs off the 1 MHz clock and resets on every system reset."

TSTMRSIRCLK @ 1 MHz
Chip Reset DIVSLOW_CLK


" In addition to the run mode when the device resets, the DIVCORE_CLK divide ratio is
determined by the NVM (IFR) options. The IFR bits set the DIVCORE field in the
SCG’s Run Clock Control Register (SCG_RCCR). Similarly the DIVSLOW_CLK divide
ratio is also determined by the NVM (IFR) options.

Out of reset, the SIRC module is enabled and used as the main clock source out of reset.
This provides an 8MHz source clock
 "

By default DIVCORE_CLK is divide by 1, DIVSLOW_CLK is divide by 2, giving 4 MHz at reset.  Is there a divide by 4 in the TSTMR to get 1 MHz?


fsl_tstmr.h implies that the clock can be 1 MHz or 8 MHz:

/*!

* @brief Delays for a specified number of microseconds.
*
* This function repeatedly reads the timestamp register and waits for the user-specified
* delay value.
*
* @param base TSTMR peripheral base address.
* @param delayInUs Delay value in microseconds.
*/
static inline void TSTMR_DelayUs(TSTMR_Type *base, uint32_t delayInUs)
{
uint64_t startTime = TSTMR_ReadTimeStamp(base);

#if defined(FSL_FEATURE_TSTMR_CLOCK_FREQUENCY_1MHZ) && FSL_FEATURE_TSTMR_CLOCK_FREQUENCY_1MHZ

while (TSTMR_ReadTimeStamp(base) - startTime < delayInUs)

#elif defined(FSL_FEATURE_TSTMR_CLOCK_FREQUENCY_8MHZ) && FSL_FEATURE_TSTMR_CLOCK_FREQUENCY_8MHZ

while (TSTMR_ReadTimeStamp(base) - startTime < 8 * delayInUs)

#else

assert(0);

#endif
{
}
}

0 项奖励
回复
1 解答
1,161 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi bobpaddock,

Sorry for the inconvenience we bring you!

It is confirmed that there is a 1MHz output from the SIRC that runs whenever the SIRC is enabled and is used to clock the TSTMR.

Best Regards,
Robin

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,162 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi bobpaddock,

Sorry for the inconvenience we bring you!

It is confirmed that there is a 1MHz output from the SIRC that runs whenever the SIRC is enabled and is used to clock the TSTMR.

Best Regards,
Robin

0 项奖励
回复
1,157 次查看
bobpaddock
Senior Contributor III

Thank you.

 

0 项奖励
回复