Page 2 of 2

Re: MCPWM

Posted: Mon Jun 20, 2022 4:34 am
by morris
i have saw that the mcpwm module can't perceive the DFS.
i need to call the function of esp_pm_lock_acquire(ESP_PM_APB_FREQ_MAX) when i use the mcpwm module, and need to call the function of esp_pm_lock_release(ESP_PM_APB_FREQ_MAX) when i stop the pwm.
is it right?
yes, the application can create a pm lock, and acquire/release the lock when we start/stop the mcpwm timer.

Re: MCPWM

Posted: Mon Jun 20, 2022 5:45 am
by chenyananee
another question about the capture, see the picture for more details.

1.
how can i fix this issue with picture 1
2.
and i don't know the means about the value 10000,10000000000, this is from the example code.
i want to calculate the frequence about the input signal. i need the max value of the timer count and the clock frequence.

Re: MCPWM

Posted: Mon Jun 20, 2022 7:44 am
by chenyananee
when i call the api(current_cap_val = mcpwm_capture_signal_get_value(MCPWM_UNIT_0, MCPWM_SELECT_CAP0);) from the capture interrupt function, thie issue will appear by high frequence.

Re: MCPWM

Posted: Tue Jun 21, 2022 7:26 am
by chenyananee
i have find the reason of the interrupt error.
and i don't call the api from the flash this issue can be fixed.such like this picture ...

just for the calculation of the frequency, the input signal is 1kHz but we can see the result is 875 form the terminal log. so there is something wrong with this formula.

Re: MCPWM

Posted: Tue Jun 21, 2022 7:47 am
by chenyananee
maybe we can close this issue.

Re: MCPWM

Posted: Tue Jun 21, 2022 9:45 am
by chenyananee
clock is the apb clock,and there is no prescale.
so the input frequency is apb_clk/Δ.
test is ok for 1k,500Hz and so on.