PWM LEDS - FPGA Altera DE0

Thread Starter

omerysmi

Joined Oct 10, 2014
55
Hello everyone,
I want to make PWM LEDS, i mean that pwm signal will control the intensity/brightness of the leds, such as this video:

But how it could be possible when we have only '1' state which is 100% of brightness and '0' state which is 0% of brightness..?
With pwm I can only change the frequency of the led but not the brightness, am I right?

By the way I use FPGA Altera DE0 and I want to implement it in VHDL.
 

tshuck

Joined Oct 18, 2012
3,534
With pwm I can only change the frequency of the led but not the brightness, am I right?
No. With PWM, frequency is constant and you control the duty cycle ( Ton/(Ton+Toff) * 100%, where Ton is the amount of time the signal is active and Toff is the time it is inactive) of the signal.

One way to implement it is to create a free-running counter. When the count is less than the set value, the output is high (or low, depending on how you want to do it) and is the opposite state otherwise.
 

fabxy1

Joined Oct 3, 2014
11
Indeed you're able to control the "brightness" - at least practically.
As tshuck mentioned, by modifying TON/TOFF you're able to controll the brightness by tricking the human eyes.
This technique is very common in controlling LED's.
 
Top