Camera interfaces
GUPPY Getting Started
V4.0.1
105
PWM: Examples in practice
In this chapter we give you two examples, how to write values in the PWM
registers. All values have to be written in microseconds (µs) in the PWM reg-
isters, therefore remember always the factor 10
-6
s.
Example 1:
Set PWM with 1kHz at 30% pulse width.
Example 2:
Set PWM with 250 Hz at 12% pulse width.
Formula 2: PWM example 1
Formula 3: PWM example 2
RegPeriod
1
frequency
6
–
×
10
s
-----------------------------------------
1
1kHz
6
–
×
10
s
-----------------------------
1000
=
=
=
RegPulseWidth
RegPeriod
30%
×
1000
30%
×
300
=
=
=
RegPeriod
1
frequency
6
–
×
10
s
-----------------------------------------
1
250Hz
6
–
×
10
s
--------------------------------
4000
=
=
=
RegPulseWidth
RegPeriod
12%
×
4000
12%
×
480
=
=
=