AnsweredAssumed Answered

Using CLKOUT Pin

Question asked by Jonas Bard on Mar 1, 2017
Latest reply on Mar 3, 2017 by Daniel Martynek

Hey,

 

I am trying to get my internal clock to the CLKOUT Pin.

I enabled the pin:

 

PCC-> PCCn[PCC_PORTB_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT B */

PTB->PDDR |= (1<<5); /* Port B5: Data Direction = output */

PORTB->PCR[5] = (0b101 << 8) | (1 << 6); /* Port D15: MUX = ALT5 (CLKOUT), high drive strength */

 

and connected the FLASH_CLK via SCG_CLKOUTCNFG and SIM_CHIPSEL to the Pin.

 

SCG->CLKOUTCNFG = SCG_CLKOUTCNFG_CLKOUTSEL(0); // SLOW_CLK to CLK_OUT

SIM->CHIPCTL |= SIM_CHIPCTL_CLKOUTEN(1)

                       | SIM_CHIPCTL_CLKOUTDIV(0)

                       | SIM_CHIPCTL_CLKOUTSEL(0);

 

But I cannot seee any clock signal on the pin.

I checked the Registers with S32 Design Studios debugger. There I see, that the CLKOUTEN Bit in SIM->CHIPCTL is cleared. If I am trying to set the bit with the debugger, it doesn't work.

Downloading 4 bytes @ address 0x40048004 - Verify failed

Read 4 bytes @ address 0x40048004 (Data = 0x00000000)

 

What is the problem? Do I have to enable a further clock?

Outcomes