Pwm: examples in practice – ALLIED Vision Technologies Stingray F-504 User Manual

Page 110

Advertising
background image

Camera interfaces

STINGRAY Technical Manual V4.4.4

108

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

=

=

=

Advertising