Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By eriksl
#67483
schufti wrote:I wrote:
"The" arduino has hw timers that are specifically built to support pwm, that the esp does not have.


you worte:
It boils down to that the ATmel processors (... Arduino ...) have hardware support for PWM. It's not the hardware timer, it's the PWM hardware support that counts.


so where is the "plus" of information?

"support for PWM" will allways boil down to hw timers with compare registers --> hw timers with the "PWM specific extra"

Apparently you missed that ATmel microcontrollers can have the PWM subsystem control the designated I/O pins autonomously, the software doesn't have to do _anything_. If you don't have that, you still have software PWM, where you need find out which PWM channel is next to toggle, set up the compare register and wait for the interrupt, toggle the I/O pin and set up the next etc. If the timer is running fast compared to the speed of the execution of code (which often is the case), the software simply won't keep up. The hardware PWM of the ATmel processor will.
User avatar
By schufti
#67486 nope, I did miss nothing. It is still hw timers with additional hw that gives the extra pwm function.
Of course if someone implements hw compare registers he foresees to provide their "output" not only as internal interrupt source but also on a pin...
And this implies no other programatical action apart from setting up the hw (timers, compare registers and gpio) to work as pwm generator.

But thats way off topic and I think the TO got the hint so far ...
User avatar
By eriksl
#67492 Still you really don't see the issue here, were a fully automated PWM can reach MUCH higher frequencies than software emulation. And that IS on-topic.
User avatar
By schufti
#67497 why do you alledge me that I said or think something I don't?

from the beginning I stated that pwm on ATmegas is fully implemented in hw (timers and compare registers) and therefor it is faster. I never implied any interaction by sw. Why should it NOT be fully automatic? Of course hw timers that are speciffically built - and extended - for PWM will have a mode to run in loop mode.

In my 30+ years in hw and sw development I have seen lots of µCs but never one like you implied (hw compare register for pwm but having to react in sw for setting i/o or restart of timer).

If you wan't to additionally (unnecessarily) explain that a hw-pwm will allways be quicker than a partly/fully sw implementation, so be it.

but please stop alledging me of things you can't prove.