high level IF to hardware PWM? #5399
Replies: 1 comment
-
Posted at 2016-08-11 by ClearMemory041063 This covers experiments with the espruino board. Pins that can connect to the timer circuits can generate PWM without running code other that the setup. Posted at 2016-08-11 by DrAzzy Pins marked PWM capable on the pinout chart have hardware pwm Using analogWrite will use the appropriate timer and do hardware pwm if you use it on a pin that has one. You can also have it do software pwm on any pin, but obviously you want to stick with hardware pwm pins if possible, for the reasons you described in op Posted at 2016-08-15 by @gfwilliams Just to add - yes, You can use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-08-11 by dwallersv
Reading through the "PWM how to do it yourself" page, what is described is a software approach.
Is analogWrite(pin, level, {freq:}) the high-level interface to STM32 hardware PWM? I.e., control of frequency via the options parameter, and duty cycle via the level/value parameter?
So, a 1000Hz, 25% duty-cycle waveform is produced, entirely without any code running but simply via the hardware (after Espruino sets it up from the analogWrite call) with analogWrite(pin, 0.25, {freq:1000})? Once done on a board that supports hardware PWM, like the Pico, the MCU is generating that waveform all on its own, the Espruino main loop just idling, right?
Beta Was this translation helpful? Give feedback.
All reactions