Page 1 of 1

How to remove PWM signal from the pin?

Posted: Wed Apr 17, 2019 12:44 pm
by Dystman
Hello! I'm working with several digital servomotors and I need to deal with overload situation. In case when my servomotor stays in overload state for too long I need to turn off the servomotor. I don't want to power off them so I'm looking for a function to turn off PWM signal.

Currently, I'm using mcpwm_gpio_init() and mcpwm_init() functions. But i cant find deinit functions.

I've searched deeper and find out, that there are functions gpio_matrix_out and gpio_matrix_in which, on my thoughts, do the mapping of MCPWM unit to certain GPIO. But I've bumped into some signalIdx parameter which I do not understand.

Can you help me please not to burn all my servomotors? ))

Re: How to remove PWM signal from the pin?

Posted: Thu Apr 18, 2019 2:16 am
by username
you dont need to de-init the pin. just set the PWM to 0.

Re: How to remove PWM signal from the pin?

Posted: Thu Apr 18, 2019 10:57 am
by Dystman
username wrote:
Thu Apr 18, 2019 2:16 am
you dont need to de-init the pin. just set the PWM to 0.
Thanks for answering, username!

I was trying to do this also, but functions mcpwm_set_duty_in_us, mcpwm_set_signal_low and several others do not work properly. PWM signal still present on GPIO. Can you show me the function to switch it off?

Re: How to remove PWM signal from the pin?

Posted: Fri Apr 19, 2019 2:38 am
by ESP_Sprite
It may be useful to figure out why the mcpwm functions don't do what you expect, but to answer your initial question: you can use gpio_reset_pin() to disconnect a GPIO from a peripheral.

Re: How to remove PWM signal from the pin?

Posted: Mon Apr 22, 2019 3:14 pm
by Dystman
Thanx for helping!