ADwin-Gold II
, Manual February 2013
139
PWM Outputs
PWM_Init
ADwin
PWM_Init
PWM_Init
sets the defaults for one PWM output.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
PWM_Init
(
pwm_
output
,
startdelay
,
startvalue
,
mode
,
count
)
Parameters
Notes
The defaults get active as soon as the PWM outputs are enabled with
PWM_Enable
.
A change of defaults during PWM output is not possible. Instead, the
PWM outputs must be stopped with
PWM_Reset
or disabled with
PWM_
Enable
in order to change defaults. Afterwards the PWM outputs are
enabled again.
See also
,
Valid for
Gold II-CNT
T11 TiCo
p w m _
output
Number (1…6) of PWM output.
LONG
startd ela
y
Start delay in units of 20ns.
LONG
startv alu
e
Start level of PWM output:
0: TTL-level low.
1: TTL-level high.
LONG
mode
Operating mode of PWM outputs as bit pattern
(bits 0…2 only).
Bit 0: Moment to take over a new PW frequency:
Bit = 0: Take over at end of period.
Bit = 1: Take over immediately.
Bit 1: Number of pulses:
Bit = 0: infinite number of pulses.
Bit = 1: number of pulses is
count
.
Bit 2: Moment to stop after stop instruction:
Bit = 0: Stop at end of period.
Bit = 1: Stop immediately.
LONG
count
Number of periods (1…32 768), which are pro-
cessed during an output cycle.
LONG