beautypg.com

Pwm: examples in practice – ALLIED Vision Technologies Pike F-1600 User Manual

Page 127

background image

Camera interfaces

PIKE Technical Manual V5.1.2

127

PWM: Examples in practice

In this chapter we give you two examples, how to write values in the PWM regis-
ters. All values have to be written in microseconds (μs) in the PWM registers,
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

=

=

=

This manual is related to the following products: