User`s manual
RabbitFLEX User’s Manual www.rabbit.com 61
5.5 DACs
To produce an analog signal for the DAC channel outputs, the Rabbit generates precisely timed pulses
using PWM (pulse width modulation). The digital signal, which is either 0 V or 5 V, is a train of pulses.
This means that if the signal is taken to be usually at 0 V (or ground), there will be 5 V pulses. The voltage
will be 0 V for a given time, then jump to 5 V for a given time, then back to ground for a given time, then
back to 5 V, and so on. The digital signal is a value between 0 and 1024. This value is used to set the duty
cycle of the PWM channel by passing it to the function pwm_set().
Figure 5.3 Duty Cycle Examples
Thus, the software only needs to vary the time the signal is at 5 V with respect to the time the signal is at 0
V to achieve any desired voltage between 0 V and 5 V.
The quality of the analog signal is determined largely by the settling time, the slew rate and the output res-
olution of the DAC channel.
• Settling Time – This is the time it takes for the analog signal to achieve a full-scale change in volt-
age.
• Slew Rate – This is the maximum rate at which the DAC channel can change the voltage level of
the analog signal.
• Output Resolution – This is the number of bits in the digital input that results in the analog output.
OUT
OUT
OUT
TIME
30%
50%
100%