S32K142 High frequency generation

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

S32K142 High frequency generation

跳至解决方案
3,023 次查看
Mohit_Manvar
Contributor III

Hello experts,

Device: S32K142 eval board

 

I want to generate frequency of 6.144MHz with 50% duty cycle. For that I tried using FTM_PWM but it is giving delta on output. I entered 6.144MHz in configurator but output side it is giving 6.4MHz.I want to over come this delta and need pure frequency.

Please share sample code or configured code for this requirement.

I don't want to generate frequency on CLKOUT pin.I attached configuration and output screenshot.

Mohit_Manvar_0-1702017838622.pngMohit_Manvar_1-1702017922095.png

 

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
2,940 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Mohit_Manvar

1. The tick value is the value that needs to be written to the register, but this value must be an integer, it cannot be a floating point number.

2. Theoretically, the larger the tick value, the higher the accuracy of the output waveform, and the corresponding waveform frequency will also decrease.

在原帖中查看解决方案

10 回复数
2,997 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Mohit_Manvar

This is expected and this is not a problem with your software.

For example, if the FTM module clock is 80MHz, you can see that if you need to output 6.14Mhz PWM, you need to set it to 13.029315960912tick, but in fact you can only set it to 13 ticks

Senlent_0-1702026589187.png

 

 

2,964 次查看
Mohit_Manvar
Contributor III

Hello @Senlent 

Thanks for reply but can you also confirm for 4.096MHz frequency?

and which tool are you using? I'm using S32design studio 3.4

 

Regards,
Mohit

0 项奖励
回复
2,960 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Mohit_Manvar

The picture comes from S32 Design Studio For Arm V2.2.

Senlent_0-1702273598021.png

 

2,957 次查看
Mohit_Manvar
Contributor III

How to get this tick value and validate with frequency with peripheral clock?
How to find threshold of tick counts?

0 项奖励
回复
2,951 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Mohit_Manvar

ticks = FTM_SOURCE_CLOCK / Expected output frequency

for example:FTM SOURCE CLOCK is 80MHz, expected output frequency is 4.096Mhz

ticks = 80Mhz / 4.096Mhz = 19.53125 ticks.

 

2,946 次查看
Mohit_Manvar
Contributor III

my FTM source clock is 48MHz and required freq is 6.144 then tick is calculated as 7.8125.

but is there any limit that calculated tick should not cross specific level?

 

0 项奖励
回复
2,941 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Mohit_Manvar

1. The tick value is the value that needs to be written to the register, but this value must be an integer, it cannot be a floating point number.

2. Theoretically, the larger the tick value, the higher the accuracy of the output waveform, and the corresponding waveform frequency will also decrease.

2,935 次查看
Mohit_Manvar
Contributor III

Hello,

Thanks for quick and fruitful replies.

in last, can you suggest any other method or option to achieve this requirement?

 

Regards,
Mohit Manvar

0 项奖励
回复
2,927 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Mohit_Manvar

Usually FTM modules are used for motor control, and motor applications don't actually require such high PWM frequencies.
Through the above formula, I think you already know the disadvantage of its high output frequency.
Simply put, it is unable to accurately output 6.144MHz and 4.096MHz.

0 项奖励
回复
2,925 次查看
Mohit_Manvar
Contributor III
Hi,
We are using controller for sound application. Frequency is required to provide clock which drives whole amplifier IC(MCLK).
0 项奖励
回复