Kinetis KV4x - enabling clock output on the CLKOUT pin

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Kinetis KV4x - enabling clock output on the CLKOUT pin

1,445件の閲覧回数
nariane
Contributor I

I'm trying to enable clock output on the CLKOUT pin while running the microcontroller in "High-Frequency, High-Gain" mode.

To enable this output, I configured the microcontroller as follows:

1) I enabled the CLKOUT pin

 

// enables CLKOUT alternate function on pin PTC3
CLOCK_EnableClock(kCLOCK_PortC);
PORT_SetPinMux(PORTC, 3U, kPORT_MuxAlt5);

 

2) I enabled the external reference clock on the CLKOUT pin

 

OSC->CR |= OSC_CR_ERCLKEN(1); // enables OSCERCLK)
SIM->SOPT2 |= SIM_SOPT2_CLKOUTSEL(6); // CLKOUTSEL = OSCERCLK

 

I'm not able to measure anything on the CLKOUT pin, am I missing something? The same configuration shown above works if I configure the microcontroller in "High-Frequency, Low-Power Mode": in this case I'm able to measure the clock waveform on CLKOUT pin.

(my application works without problems in both "low power" and "high gain" modes)

Thanks for your help.

 

ラベル(1)
0 件の賞賛
返信
1 返信

1,402件の閲覧回数
nariane
Contributor I

I managed to solve my problem by dividing the frequency of OSCERCLK by 2

// Divide OSCERCLK clock frequency by 2
OSC->DIV &= ~(OSC_DIV_ERPS_MASK);
OSC->DIV |= OSC_DIV_ERPS(1);

Apparently the clock frequency was too high (10Mhz); if I lower it to 5Mhz it works even in high gain mode.

0 件の賞賛
返信