PWM Outputs
PWM_Write_Latch
ADwin
144
ADwin-Gold II
, Manual February 2013
PWM_Write_Latch
PWM_Write_Latch
writes frequency and duty cycle into the latch register.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
PWM_Write_Latch
(
pwm_output
,
dutycycle
,
frequency
)
Parameters
Notes
PWM_Write_Latch
writes frequency and duty cycle into the latch regi-
ster only. The values are enabled for PWM output with
PWM_Latch
only.
The value of
dutycycle
depends on the setting of the parameter
startvalue
from the instruction
PWM_Init:
•
startvalue
= 1: Set
dutycycle
to the value of the duty cycle.
•
startvalue
= 0: Set
dutycycle
to the "inverse duty cycle":
dutycycle
= 100% - duty cycle
The highest output frequency where the duty cycle can be still defined
in 1%-steps, is 500kHz.
See also
,
,
Valid for
Gold II-CNT
Example
T11 TiCo
p w m _
output
Number (1…6) of PWM output.
LONG
dutycycle
Duty cycle / inverse duty cycle in percent between
0.0 and 100.0 (do not use 0.0 or 100.0).
FLOAT
frequency
Frequency in Hertz: 0.05Hz …25000kHz.
FLOAT