PWM LEDS - FPGA Altera DE0

Discussion in 'Embedded Systems and Microcontrollers' started by omerysmi, Jul 20, 2015.

  1. omerysmi

    Thread Starter Member

    Oct 10, 2014
    44
    0
    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.
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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.
     
  3. fabxy1

    New Member

    Oct 3, 2014
    11
    0
    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.
     
Loading...