Using CLKOUT Pin

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using CLKOUT Pin

2,572 Views
jonasbard
Contributor II

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?

Tags (4)
4 Replies

1,716 Views
liulei1
Contributor II

Hi

I tried it in your way, but there was no CLKOUT output. Have you solved it now?

0 Kudos

1,716 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi

I cannot set it either using FRDMPK144 - Q100 (N77P). It works with the new board.

Regards

Daniel

0 Kudos

1,716 Views
jonasbard
Contributor II

Hi,

is there maybe a problem with the chip revision? As mentioned, I cannot set the CLKOUTEN Bit

in the SIM->CHIPCTR Register.

Regards,

Jonas

0 Kudos

1,716 Views
danielmartynek
NXP TechSupport
NXP TechSupport

It seems to be so. The N77P mask set is a prototype. I can set the CLKOUTEN bit using your code on the new board with N47T mask set.

Regards

Daniel

0 Kudos