the PWM output frequency issue on S32K3

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

the PWM output frequency issue on S32K3

ソリューションへジャンプ
2,674件の閲覧回数
zp001
Contributor III

Hello,

There is a problem about PWM output frequency, the configuration of PWM is as below:

eMIOS_Mcl configuration:

  1. eMIOS_0 source clock is 160Mhz
  2. eMIOS_0 clock divider is 200 and the default period is 65535

PWM channel configuration:

  1. clock prescaler is DIV_1
  2. prescaler clock source is EMIOS_PWM_SRC_PRESCALED_CLOCK
  3. the period is 65534

the frequency of this channel should be calculated by below formula:

output frequency = 160000000 / 200 / 65534 = 12.2Hz

but I got a 3.67hz waveform.

zp001_0-1671187280380.jpeg

It looks like the source clock divided by 3 once again.

I have double checked the configurations and can't find any clue.

I'd like to know why this phenomenon should occur.

RTD is 2.0.1 

S32DS V3.5

Thanks!

 

タグ(1)
0 件の賞賛
返信
1 解決策
2,655件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

your calculation is correct, but in your project the core clock is running from FIRC, not the PLL. This makes that difference. 
For clock init use below function

/* Initialize clock */
Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);

BR, Petr

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,656件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

your calculation is correct, but in your project the core clock is running from FIRC, not the PLL. This makes that difference. 
For clock init use below function

/* Initialize clock */
Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);

BR, Petr

0 件の賞賛
返信
2,657件の閲覧回数
zp001
Contributor III

Hello,

I tried to read PLL clock via Clock_Ip_GetFreq(PLL_CLK);

The PLL clock is zero, that is inconsistent with the clock map.

タグ(1)
0 件の賞賛
返信