Digital Outputs
Put_PWM(2)
This function outputs an Pulse Width Modulated voltage on selected Output pin. This
function is used to control the state of the active low output FET drivers. A value of 0 is Off (the
output is open). A value of 32767 (the output is fully on, closed to ground). Intermediate values
provide a pulse train. A value of 16383 provide a 50% outputs (square wave). This can be useful
to provide “average” voltages and regulate current in an inductive load. A constant or a variable
may be used as the output Value
Parameters
PWM# Identifies which DAC channel is to be read
• can be PWM1 through PWM16
Value The digital value of the output voltage
• The scale is 0-32767 = 0 to 100% ON (switched to ground).
Returns
0 – new value did not go out.
1 – new value output.
Error Codes
Bad_ID = incorrect PWM ID was used.
Auto_Run = Trying to access a Automated PWM is not allowed.
Examples
Put_PWM(PWM1, 16383) ; a 50% pulse wave is output on Output 1
or
User1=16383
Put_PWM(PWM1, User1) ; a 50% pulse wave is output on Output 1
1310 Vehicle Control System Users Manual Release Rev B Page 32 of 51