random and LEds question

Discussion in 'VHDL' started by Jowkar, Oct 10, 2008.

  1. Jowkar

    Jowkar

    Joined:
    Oct 10, 2008
    Messages:
    7
    how do i make LEDs less bright, i know that u need to do something with the PWM and how to generate a randon number in vhdl




    also how do i search in the newsgroup
    Jowkar, Oct 10, 2008
    #1
    1. Advertising

  2. Jowkar

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    jeppe, Oct 10, 2008
    #2
    1. Advertising

  3. Jowkar

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    One more

    1) Search for LFSR at the net - could be perfect for random numbers
    2) Use a fast running counter - the number will be random if you stop the counter with random intervals.
    jeppe, Oct 10, 2008
    #3
  4. Jowkar

    Jowkar

    Joined:
    Oct 10, 2008
    Messages:
    7
    thanks, i think i got the random numbers going, i did the counter thing, but the pwm thing im still not too sure, im using a spartan 3 and im kinda new to vhdl so i dont know where motors and stuff are located on spartan 3
    Jowkar, Oct 10, 2008
    #4
  5. Jowkar

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    Depend on your kit or hardware design
    Most pins on a Spartan 3 could act as output and hence should it be possible to drive with a PWM signal
    jeppe, Oct 10, 2008
    #5
  6. Jowkar

    Jowkar

    Joined:
    Oct 10, 2008
    Messages:
    7
    i figured most stuff out, what i still dont really quite understand is the PCM value, can anyone elaborate on that?
    Jowkar, Oct 11, 2008
    #6
  7. Jowkar

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    PCM = Pulse Code Modulated which means a number, value etc which gives the PWM percentance. If you a kit (BASYS, NEXYS etc) could you use the DIP switches to generate numbers like 00001100 = 12 or 10000001 = 129
    jeppe, Oct 11, 2008
    #7
  8. Jowkar

    Jowkar

    Joined:
    Oct 10, 2008
    Messages:
    7
    what i meant is, how does the pcm value affects it like the higher the what and stuff
    Jowkar, Oct 11, 2008
    #8
  9. Jowkar

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    Well if you watch the simulation (buttom of the page link) can you see the connection between PCM and PWM
    If you decide PCM=15 => 100% duty cycle (Full brightness) then PCM=7 should give say 50% duty cycle
    jeppe, Oct 11, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lars-Erik Aabech
    Replies:
    8
    Views:
    839
    Lars-Erik Aabech
    Apr 28, 2005
  2. Chris Lasher

    Interacting with keyboard LEDs

    Chris Lasher, Dec 9, 2006, in forum: Python
    Replies:
    4
    Views:
    436
    Hendrik van Rooyen
    Dec 10, 2006
  3. globalrev
    Replies:
    4
    Views:
    756
    Gabriel Genellina
    Apr 20, 2008
  4. sintral
    Replies:
    9
    Views:
    4,330
    Ben Bacarisse
    Dec 7, 2008
  5. VK
    Replies:
    15
    Views:
    1,161
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page