In CY8C6245LQI-S3D42 why PWM does not support P2_3 pin?

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

cross mob
MSS
Level 3
Level 3
5 likes given 50 sign-ins 10 replies posted

PWM does not work if I use the pin P0_0 in below code, it gives fault as soon as I start the timer. If I use pin P0_1 it works.

Any help will be appreciable.

cyhal_pwm_t pwm_obj;
rslt = cyhal_pwm_init(&pwm_obj, P2_3,NULL);
rslt = cyhal_pwm_set_duty_cycle(&pwm_obj,50,1000);

rslt = cyhal_pwm_start(&pwm_obj);

0 Likes
2 Replies
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @MSS ,

Can you please let us know, what your application is? Can you please share the error log which you are seeing?
Also, which Modustoolbox version are you currently using?

Best Regards,

Aashita

0 Likes
MSS
Level 3
Level 3
5 likes given 50 sign-ins 10 replies posted

HI,

Sorry for delay.

Note: The pin is p2_3 not P0_0 which is problematic in pwm use.

Actually we have  our own board using CY8C6245LQI-S3D42 .

I created a application and select bsp CY8CPROTO-062S3-4343W.

My requirement was to generate the following signal on 2 pin W0 and W1.

MSS_0-1676012968961.png

 I have following code

result = cyhal_pwm_init_adv(&pwm_obj2, P2_2, NC, CYHAL_PWM_LEFT_ALIGN, false, 0, true, NULL);
result = cyhal_pwm_set_duty_cycle(&pwm_obj2,50,10000);
result = cyhal_pwm_init_adv(&pwm_obj3, P2_3, NC, CYHAL_PWM_LEFT_ALIGN, false, 0, true, NULL);
result = cyhal_pwm_set_duty_cycle(&pwm_obj3,50,10000); 

When I use a P2_3 it gives an error as I start the pwm.

But when I use any other flag the code works.

I want to know what is wrong in whole process and how to use P2_3 with PWM.

Note:

As a GPIO I can use the pin P2_3 but not as a pwm pin.

 

0 Likes