Creating LED Breathing

Creating LED Breathing

Pulse-based Control Technique

This technique can be used within any GreenPAK. The quantity of independent Soft ON/OFF channels depends on the number of counters available within the particular part.

Figure 1 LED Breathing Implementation

An LED breathing pattern can be generated through a basic PWM implementation that utilizes a constant change between two counters. Each counter outputs a high pulse for one clock cycle of their programmed period. Two CNT/DLY blocks are programmed with different counter data settings to provide a small offset between their outputs. These output signals are used to set and reset a flip-flop within the device. Figure 1 depicts a basic implementation, wherein CNT2/DLY2 sets the ON period and CNT3/DLY3 sets the duty cycle.

In the implementation within Figure 1 the frequency of the PWM is set by CNT2 and can be calculated with the equation:

The effect of the small offset is shown through the waveforms of Figure 2. The PWM cycle ends when the counters’ outputs coincide. This causes a short high impulse on AND gate and DFF flops. The NXOR gate makes the inversion of the PWM, which provides a soft OFF. PIN2 is the enable signal and while it is HIGH the counters are in high level reset.

Resources

GreenPAK Designer files