Pwm Outputs - Z-World Fox LP3500 User Manual

C-programmable single-board computer
Table of Contents

Advertisement

4.5.7 PWM Outputs

The PWM functions in this section can be used to operate the analog outputs on the
LP3500 model.
int pwmOutConfig(unsigned long frequency);
Sets the base frequency for the PWM pulses and enables the PWM driver on all four channels. The base
frequency is the frequency without pulse spreading. Pulse spreading (see pwm_set) will increase the
frequency by a factor of 4.
PARAMETERS
frequency is the frequency (in Hz).
RETURN VALUE
Actual frequency set. This will be the closest possible match to the requested frequency.
SEE ALSO
pwmOut
int pwmOut(unsigned int channel, float dutycycle);
Sets a voltage (0 to VDD on an analog output channel according to the percent duty cycle of the 1024-
clock-count cycle.)
PARAMETERS
channel is the output channel to write to (0–3).
dutycycle is the percent duty (or on) cycle value of the 1024-clock-count cycle (i.e., 0.25).
RETURN VALUE
0 if successful
-1 if an invalid channel number is used
-2 if an invalid duty cycle was requested
SEE ALSO
pwmOutConfig
User's Manual
65

Advertisement

Table of Contents
loading

Table of Contents