Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)
User avatar
By eriksl
#67346 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. The ESP8266 does NOT have hardware PWM support. Don't get fooled by the marketing speak of Espressif.

The ESP8266 can be made running at 160 Mhz, btw, with no side-effects. In this high frequency mode, you can achive PWM using software at ~8 Mhz in total, so 120 Hz @ 16 bits, 240 Hz @ 15 bits etc, 30 kHz @ 8 bits, 2 MHz @ 2 bits.

So yes, it can be done. If you use a good software PWM implementation (not the one from Espressif).

Also the ESP8266 does have hardware sigma-delta support, which works at 8 bits, you may want to try that.

Most ATmel's can run at 16 MHz, some even at 20 MHz. The I/O clock can be divided by "1", so it runs also on 20 MHz. If you have a 16 bits PWM counter, you could reah a refresh of ~300 Hz, on an bits PWM counter you could reach ~80 kHz. So no 1 MHz there, either.

You can make the PWM timer wrap around early, though, reducing the number of effective bits, then you could go to a 4 bits PWM (16 values) and reach 1.25 MHz. But then you'd only have 16 values, that's all.
User avatar
By schufti
#67351 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"
User avatar
By btidey
#67367
Dakota wrote:I need a 77.5 khz for a DCF77 atomic clock transmitter, but I don't find any info :-(

viewtopic.php?f=13&t=15225


DCF77, as I understand it is primarily a 77.5Khz carrier with slow on/off amplitude keying. One may be able to use the same technique as used for Infra red modulation for this. I.e generate a 77.5KHz carrier with i2S interface on the ESP8266 and just turn this on and off at the very slow amplitude modulation rate. I think the nearest frequency you can get from i2S is 77.150KHz. I don't know whether that is close enough. This obviously gives a square wave carrier but the transmitter can be used to filter that.