在线时间2 小时
UID410263
注册时间2013-1-4
NXP金币0
该用户从未签到
新手上路

- 积分
- 28
- 最后登录
- 1970-1-1
|
我的CPU是K21系列的
在sysinit代码中发现
void trace_clk_init(void)
{
/* Set the trace clock to the core clock frequency */
SIM_SOPT2 |= SIM_SOPT2_TRACECLKSEL_MASK;
/* Enable the TRACE_CLKOUT pin function on PTA6 (alt7 function) */
PORTA_PCR6 = ( PORT_PCR_MUX(0x7)
| PORT_PCR_DSE_MASK); // enable high drive strength to support high toggle rate
}
void clkout_init(void)
{
#if (defined(MCU_MK21FZ50)) // MK21F has FlexBus, MK21D does not
/* Enable the clock to the FlexBus module */
SIM_SCGC7 |= SIM_SCGC7_FLEXBUS_MASK;
/* Enable the FB_CLKOUT function on PTC3 (alt5 function) */
PORTC_PCR3 = ( PORT_PCR_MUX(0x5)
| PORT_PCR_DSE_MASK); // enable high drive strength to support high toggle rate
#elif (defined(MCU_MK21DZ50)) // MK21D does not have FlexBus, so output another clock instead
/* Enable the FB_CLKOUT function on PTC3 (alt5 function) */
SIM_SOPT2 &= ~SIM_SOPT2_CLKOUTSEL_MASK; // clear clkoout field
SIM_SOPT2 |= SIM_SOPT2_CLKOUTSEL(2); // select flash clock
PORTC_PCR3 = ( PORT_PCR_MUX(0x5) | PORT_PCR_DSE_MASK );
#endif
}
在dryice_init()里也发现
/* Enable the CLKOUT function on PTC3 (alt5 function)*/
PORTC_PCR3 = (PORT_PCR_MUX(0x5));
/* Drive RTC oscillator out on PTC3 */
SIM_SOPT2 |= SIM_SOPT2_CLKOUTSEL(5);
我注释掉一样可以正常工作
请问它有啥功能 没看明白
|
|