Datasheet
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com
PWMs
Flyport provides up to 9 PWMs using remappable pin function.
QUESTION: What is a PWM signal?
PWM, Pulse Width Modulation, is a digital periodic signal. It is like a square wave, but the duty cycle
is variable. The duty cycle is the ratio between the high level period duration and the low level period
duration, often expressed in %.
A duty cycle of 100% is a signal that is always high, a duty cycle of 0% is always low, and 50% is a
perfect square wave where the high and low durations are the same.
There are 2 main parameters of a PWM signal: the duty cycle discussed above, and the frequency of
the signal, which represents the repetitions per second of our signal.
For example, a PWM with a frequency of 200Hz will have the period:
T = 1/f = 1/200 = 5ms
So every 5ms the period will be repeated. Using a PWM with 25% of duty there will be:
• Total period: 5ms
• High duration: (5ms*25/100) = 1.25 ms
• Low duration: 5ms – 1.25ms = 3.75 ms
QUESTION: How can I use PWM signals?
Normally PWM signal is used to drive a Led or a DC motor. It's possible also to create “virtual” analog
output signal. Note that PWM is not a DAC (digital to analog converter), but a simple way to generate
an analog signal adding some R-C filtering. The R-C filter design is a relatively complex operation that
depends on the frequency of the PWM and on the load at the output pin.
19










