LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM with Duty Ration on three LED’s - driven in sequence

Hello

 

I write an example of fade-out and fade-in for single LED. A hardware clock which is routed to DO is used. The Diode will constantly fade-out and fade–in where steps and times can be adjusted. For single LED this works perfect. An M or X series DAQ is predicted (USB M 6251 or USB X 6351)

The problem is that in real application (User Interface (UI) with LCD) a three LED’s will be used, which are connected on three lines and only one LED is active at a time (to reduce the cables two LED’s are connected in opposite direction).  PWM frequency will be 1 kHz and each 10 ms next LED is active (cyclic trough LED each 10 ms:  LED1, LED2, LED3, LED1, LED2, ………….    ……). Schematic is attached and is fixed (also some pushbuttons are connected but they are not relevant at the moment).

Could you give me some hint or similar example how to transform/multiply this functionality (PWM with Duty ration) to three LED’s (which are works in sequence) with hardware clock of 1 kHz. Timing must be precise, since user should not detect any flickering on UI.

Download All
0 Kudos
Message 1 of 2
(2,619 Views)

Dear RomanP,

 

I'd recomend using the X series device for this application, since the STC-3 timing chip enables you to use buffered pulse trains. The idea is that you can use a FIFOto store duty cycle information for every single PWM pulse. The device will use one sample to generate one pulse, then continue on to the next one. This allows you to have three counters working at the sae time with the same clock source, but with a different pwm data (one will always do the fade-in, fade-out routine, the other two can generate a 0 duty cycle signal).

 

Here's a community example you can start to work with. Let me know if you have something else in mind.

 

Kind regards:

Andrew Valko
National Instruments Hungary
0 Kudos
Message 2 of 2
(2,377 Views)