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

cross mob
Siamak
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

Hi,

I hope you guys are doing well,
I had two questions about PWM on the CY8CPROTO-062-4343W board.  
1. How can I set the PWM output to LOW when I stop that using cyhal stop funtion? 

2. I have broken all the peripherals  from the board except for debugger so my understanding is all GPIOs should be accessible. Now when I initiate PWM programmatically,  some of the pins give no output and some others doesn't. for example P10.0,P10.3,P10.4 has the output but P10.2 and P10.1 gives no output. Any suggestions here?

Thanks,


0 Likes
1 Solution
Ekta
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @Siamak 

1. I tried using the cyhal_pwm_stop API and noticed that the pwm_out line is always high. I guess you have made the same observation.

You can try calling the cyhal_pwm_free API which will deinitialize the PWM and then try initializing the GPIO (which was used as PWM_out) to a low state by using the cyhal_gpio_init function. I tried this and this worked for me.

2. I guess you have kept the kitprog debugger board and broken the other parts from the main board. In this case  you are correct all the GPIOs should be accessible when used normally. But when used with a pwm not all the pins have connection to the PWM block therefore on some you see the output while on other you don't.

Can you confirm if any of your init functions are failing when using P10.2 and P10.1 as output?

Best Regards
Ekta

 

View solution in original post

3 Replies
Ekta
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @Siamak 

1. I tried using the cyhal_pwm_stop API and noticed that the pwm_out line is always high. I guess you have made the same observation.

You can try calling the cyhal_pwm_free API which will deinitialize the PWM and then try initializing the GPIO (which was used as PWM_out) to a low state by using the cyhal_gpio_init function. I tried this and this worked for me.

2. I guess you have kept the kitprog debugger board and broken the other parts from the main board. In this case  you are correct all the GPIOs should be accessible when used normally. But when used with a pwm not all the pins have connection to the PWM block therefore on some you see the output while on other you don't.

Can you confirm if any of your init functions are failing when using P10.2 and P10.1 as output?

Best Regards
Ekta

 

Siamak
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

Hi @Ekta 
1. I will try your solution and let you know

2. functions do not fail but there is no output.
Thanks,

0 Likes
Ekta
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello @Siamak 

for 2 in case the initialization function does not fail, this should suggest that the pin sued for the TCPWM are correctly assigned.

In this case can you please attach your project so that I can try it at my end?

Best Regards
Ekta