S32K142 High frequency generation

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

S32K142 High frequency generation

Jump to solution
1,004 Views
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

 

Labels (1)
Tags (2)
0 Kudos
1 Solution
921 Views
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.

View solution in original post

10 Replies
978 Views
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

 

 

945 Views
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 Kudos
941 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Mohit_Manvar

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

Senlent_0-1702273598021.png

 

938 Views
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 Kudos
932 Views
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.

 

927 Views
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 Kudos
922 Views
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.

916 Views
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 Kudos
908 Views
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 Kudos
906 Views
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 Kudos