Page 1 of 1

MCPWM understanding

Posted: Fri Sep 25, 2020 10:28 am
by lharms
Hello everyone,
i am new to this forum and to the esp-idf. I am trying to understand the MCPWM basic config example.
The capturing with the demo is working on my ESP Board, but i can't find out how to set the APB clock speed.

And this leeds me to question what the magic behind this formula is:
current_cap_value[0] = (current_cap_value[0] / 10000) * (10000000000 / rtc_clk_apb_freq_get());

What i want to do is printing the values in ns and also capture signals which might be in 100ns distance.

Can someone give me a hint, where to search ? Might also be, that the problem is sitting in front of the PC. ;-)

best regards
Lars

Re: MCPWM understanding

Posted: Mon Sep 28, 2020 5:07 pm
by lharms
Short update: Meanwhile i figured out that the module is running at 80MHz.
But what i cannot find in the docs, what is the highest frequency to capture ? Actually the shortest time, which is displayed is around 1375us. I would expect much higher values, when running at 80MHz.

Re: MCPWM understanding

Posted: Mon Sep 28, 2020 8:24 pm
by WiFive
Apb clock is basically fixed to 80mhz. In the example the prescaler is set to 0 so each tick is 12.5ns.