Using CLKOUT Pin

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Using CLKOUT Pin

3,129 次查看
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?

标记 (4)
4 回复数

2,273 次查看
liulei1
Contributor II

Hi

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

0 项奖励
回复

2,273 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi

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

Regards

Daniel

0 项奖励
回复

2,273 次查看
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 项奖励
回复

2,273 次查看
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 项奖励
回复