Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:embeddedcommunicationprotocols2:pwm [2023/09/06 08:44] – external edit (Unknown date) 127.0.0.1en:iot-open:embeddedcommunicationprotocols2:pwm [2023/11/23 16:10] (current) pczekalski
Line 1: Line 1:
-===== PWM =====+====== PWM =====
 +{{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\
 The PWM signal controls the energy delivered to the device, usually a DC motor, LED light, bulb, etc.  The PWM signal controls the energy delivered to the device, usually a DC motor, LED light, bulb, etc. 
 To control voltage, instead of using inefficient resistance-based voltage dividers (where the remaining part of the voltage is distracted as heat), PWM is based on approximating the energy delivered to the device with periodical switching on and off (HIGH and LOW). Only two voltages are delivered to the device: low (0V) and HIGH (Vcc, e.g. +5V). One can easily observe how PWM works, e.g. when dimming the LED, if recorded with a high fps camera: the LED light flashes with the PWM signal frequency.\\ To control voltage, instead of using inefficient resistance-based voltage dividers (where the remaining part of the voltage is distracted as heat), PWM is based on approximating the energy delivered to the device with periodical switching on and off (HIGH and LOW). Only two voltages are delivered to the device: low (0V) and HIGH (Vcc, e.g. +5V). One can easily observe how PWM works, e.g. when dimming the LED, if recorded with a high fps camera: the LED light flashes with the PWM signal frequency.\\
Line 13: Line 14:
   * duty cycle.   * duty cycle.
  
-==== Generating PWM ====+=== Generating PWM ===
  
 In microcontrollers, PWM used to be generated with timers and interrupts to ensure asynchronous operation and stability of the operation. Due to the digital nature of the signal generation, a duty cycle generation precision is given by the PWM timer resolution. An 8-bit resolution splits a period into 256 chunks, and a single chunk defines the minimum time one can increment or decrement the duty cycle. Modern MCUs provide developers with much higher resolution, even up to 14-bit. In microcontrollers, PWM used to be generated with timers and interrupts to ensure asynchronous operation and stability of the operation. Due to the digital nature of the signal generation, a duty cycle generation precision is given by the PWM timer resolution. An 8-bit resolution splits a period into 256 chunks, and a single chunk defines the minimum time one can increment or decrement the duty cycle. Modern MCUs provide developers with much higher resolution, even up to 14-bit.
Line 23: Line 24:
   * 150/256->~117us (58.6%) in image {{ref>pwm3}},    * 150/256->~117us (58.6%) in image {{ref>pwm3}}, 
   * 200/256->~156us (78.1%) in image {{ref>pwm4}},   * 200/256->~156us (78.1%) in image {{ref>pwm4}},
-  * 250/255->~195us (98%) in image {{ref>pwm5}},.+  * 250/255->~195us (98%) in image {{ref>pwm5}}.
  
 <figure pwm1> <figure pwm1>
en/iot-open/embeddedcommunicationprotocols2/pwm.1693989866.txt.gz · Last modified: 2023/09/06 08:44 by 127.0.0.1
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0