1. Is it possible to test and trace K64 clocks using oscilloscope connected to test point?
2. What are the default clocks values for bare-metal MCU after the power up?
Solved! Go to Solution.
Hi,
Of course, you can route the FlexBus clock to a pin so that you can test it with scope.You can deduce the core/cyctem clock from FlexBus clock frequency by checking the SIM_CLKDIV1 reg.
The FRDM-K64F uses MK64FN1M0VLL12 chip with 100 pin LQFP, the PTC3 is the CLKOUT pin.
This is the PTC3 function:PTC3/LLWU_P7/CMP1_IN1/SPI0_PCS1/UART1_RX/FTM0_CH2/CLKOUT/I2S0_TX_BCLK, the PTC3 is connected to pin16 of J1 connector on FRDM-K64F
I suppose you can use the code to configure the PTC3 as CLKOUT function:
SIM_SCGC5|=0x800; //enable GORTC gated clock
PORTC_PCR3&=~(0x700);
PORTC_PCR3|=0x500; //select ALT5
You can write the CLKOUTSEL bits to select the CLKOUT in SIM_SOPT2
SIM_SOPT2&=0xE0; //select FlexBus clock
Hope it can help you
BR
XiangJun Rong
CLKOUT select in section 12.2.3 System Options Register 2 (SIM_SOPT2) in RM of K64.
Selects the clock to output on the CLKOUT pin.
000 FlexBus CLKOUT
001 Reserved
010 Flash clock
011 LPO clock (1 kHz)
100 MCGIRCLK
101 RTC 32.768kHz clock
110 OSCERCLK0
111 IRC 48 MHz clock
Hello Rong
Thanks :smileyhappy: !!!
Hi,
Of course, you can route the FlexBus clock to a pin so that you can test it with scope.You can deduce the core/cyctem clock from FlexBus clock frequency by checking the SIM_CLKDIV1 reg.
The FRDM-K64F uses MK64FN1M0VLL12 chip with 100 pin LQFP, the PTC3 is the CLKOUT pin.
This is the PTC3 function:PTC3/LLWU_P7/CMP1_IN1/SPI0_PCS1/UART1_RX/FTM0_CH2/CLKOUT/I2S0_TX_BCLK, the PTC3 is connected to pin16 of J1 connector on FRDM-K64F
I suppose you can use the code to configure the PTC3 as CLKOUT function:
SIM_SCGC5|=0x800; //enable GORTC gated clock
PORTC_PCR3&=~(0x700);
PORTC_PCR3|=0x500; //select ALT5
You can write the CLKOUTSEL bits to select the CLKOUT in SIM_SOPT2
SIM_SOPT2&=0xE0; //select FlexBus clock
Hope it can help you
BR
XiangJun Rong
CLKOUT select in section 12.2.3 System Options Register 2 (SIM_SOPT2) in RM of K64.
Selects the clock to output on the CLKOUT pin.
000 FlexBus CLKOUT
001 Reserved
010 Flash clock
011 LPO clock (1 kHz)
100 MCGIRCLK
101 RTC 32.768kHz clock
110 OSCERCLK0
111 IRC 48 MHz clock