Unable to generate PWM of 6kHz or below

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

cross mob
Sneha24
Level 1
Level 1
25 sign-ins 5 replies posted 5 questions asked

Hi, I've just recently started working with Infineon's Aurix controllers. I'm trying to generate a 3-phase PWM with complementary signals on the Aurix TC375 lite kit v2.

I used the example CCU6_PWM_Generation_1_KIT_TC375_LK and the example code worked well for frequencies from 20kHz to 6kHz. However, when I set the frequency as 6kHz, there was no output appearing. I understood from going through IfxCcu6_TimerWithTrigger.c, that it has to do with a prescaling issue.

As far as I know, IfxCcu6_TimerWithTrigger_init() is causing the problem. On Debug, the prescaling happens and the corresponding registers (T12PV) but when I run it, it won't generate any output.

Please help.

0 Likes
1 Solution
gecmar
Employee
Employee
5 solutions authored 10 replies posted 10 sign-ins

Hello @Sneha24 ,

Add additional macro, PRE and modify PWM_PERIOD as follows:

#define PRE                                    2
#define PWM_PERIOD               (CCU6_BASE_FREQUENCY / PRE / PWM_FREQUENCY) /* PWM signal period, in ticks */

Best regards

Gecmar

View solution in original post

2 Replies
gecmar
Employee
Employee
5 solutions authored 10 replies posted 10 sign-ins

Hello @Sneha24 ,

Add additional macro, PRE and modify PWM_PERIOD as follows:

#define PRE                                    2
#define PWM_PERIOD               (CCU6_BASE_FREQUENCY / PRE / PWM_FREQUENCY) /* PWM signal period, in ticks */

Best regards

Gecmar

Sneha24
Level 1
Level 1
25 sign-ins 5 replies posted 5 questions asked

Thanks, it worked!

0 Likes