Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NABICHAN
Level 2
Level 2
25 sign-ins 10 questions asked 5 replies posted

Hi,

I am trying to generate a PWM via GTM TOM Module. I need the PWM at higher Frequencies say around 200KHz. However while going more than 2KHz the frequency is achieved but it's not consistent. PWM is randomly turning off for a particular period of time. This behavior is not periodic, hence not predictable. For example in below screenshot I am trying to achieve 20KHz, but there is a certain of time in between

NABICHAN_0-1664901267839.png

 

Please let me know if GTM TOM is a correct method to achieve PWM of higher frequencies or am I doing some mistake in code. I have taken below example code and modified.

NABICHAN_1-1664901367419.png

 

In case there is a place where I can find calculations for Period Vs Frequency, limitations wrt achievable frequency etc Please let me know.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Nambi
Moderator
Moderator
Moderator
5 likes given 100 solutions authored 250 replies posted

Hi,

1. I made the following changes to the project and tested it.

i) #define PWM_PERIOD 5000 // 20KHz frequency
ii)#define LED IfxGtm_TOM2_6N_TOUT86_P14_6_OUT // Changed the pin to be able to monitor it on the connector in  the TFT kit
iii) Added "g_tomConfig.dutyCycle = PWM_PERIOD/2; // 50% duty cycle"

after "g_tomConfig.synchronousUpdateEnabled = TRUE;"
iv) Commented fadeLED();

I checked several sections of this waveform by zooming in. I observe the waveform to be proper. I have attached it with this comment.

GTM ATOM can generate PWM properly for high frequencies also.

2. I think your observation is either a limitation of the Oscilloscope sampling frequency at your end or an optical illusion.

3. You can also check if the pin you are testing is connected to any other component affecting it.

Best Regards.

View solution in original post

0 Likes
4 Replies
Nambi
Moderator
Moderator
Moderator
5 likes given 100 solutions authored 250 replies posted

Hi,

You can find the details about the example you chose in the link below.

https://www.infineon.com/dgdl/Infineon-AURIX_GTM_TOM_PWM_1_KIT_TC387_TFT-Training-v01_00-EN.pdf?file...

In this example, the duty cycle keeps varying using the fadeLED() function. It is possible that you are observing the effect of this at your end.

You can test by commenting on the fadeLED() function to check the behavior with a constant duty cycle.

Best Regards.

0 Likes
NABICHAN
Level 2
Level 2
25 sign-ins 10 questions asked 5 replies posted

Hi Nambi,

Actually, I commented and gave fixed 50% duty cycle. Still the PWMs are only ON for 15 ms and OFF for 15 ms. Somehow the PWMs at higher frequency generated are corrected but only ON for some time and other time they are OFF.

0 Likes
lock attach
Attachments are accessible only for community members.
Nambi
Moderator
Moderator
Moderator
5 likes given 100 solutions authored 250 replies posted

Hi,

1. I made the following changes to the project and tested it.

i) #define PWM_PERIOD 5000 // 20KHz frequency
ii)#define LED IfxGtm_TOM2_6N_TOUT86_P14_6_OUT // Changed the pin to be able to monitor it on the connector in  the TFT kit
iii) Added "g_tomConfig.dutyCycle = PWM_PERIOD/2; // 50% duty cycle"

after "g_tomConfig.synchronousUpdateEnabled = TRUE;"
iv) Commented fadeLED();

I checked several sections of this waveform by zooming in. I observe the waveform to be proper. I have attached it with this comment.

GTM ATOM can generate PWM properly for high frequencies also.

2. I think your observation is either a limitation of the Oscilloscope sampling frequency at your end or an optical illusion.

3. You can also check if the pin you are testing is connected to any other component affecting it.

Best Regards.

0 Likes
FD_aurix
Level 5
Level 5
100 sign-ins 100 replies posted 5 solutions authored

99% is a problem with the oscilloscope sampling. 

0 Likes