TIA
For a simple on/off with a switch:
LedOut <= SwitchIn ;
Of course you probably should debounce the switch input
and register the LedOut output. For debounce,
do a search of the newsgroup. Assume that your
switch is bouncing if it has not been stable for
anywhere from 5 ms to 15 ms.
If you bought your board, there may be a test
code that your vendor provides that does this.
Cheers,
Jim
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training mailto:J...@SynthWorks.com
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787
Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Likewise, dipswitches used to set modes often do not require
debouncing. They can either be accepted as is, or in many cases
are read at one particular instant during some initialization, so
debounce is not needed. Only if the operation of the switch
causes an immediate action is the debounce needed.
Jim Lewis wrote:
--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
401/884-7930 Fax 401/884-7950
email r...@andraka.com
http://www.andraka.com
"They that give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety."
-Benjamin Franklin,
1759
Or save some fpga resources like this:
VCC____/.-----[>|-----/\/\/--- GND
http://home.comcast.net/~mike_treseler/rimshot.wav
-- Mike Treseler
I know in my house some light bulbs seem to burn out
faster than others and I have always wondered if it
was due to excessive noise from the switches (look
nice, but knowing the builder they are probably
low cost).
Cheers,
Jim
actually i think it's because of the light bulb being turned on when the
electric current sinus feeding it is not zero or near zero volts, which
causes stress on the bulb filament (the thin tunsgten wire that lights)
LEDs being solid state devices (and using a different light emitting
pheanomenon than bulbs), i dont think they have this problem
Light bulbs burn out faster on turn on/off cycles because the wire
resistance is lower when it is cold, and when turned on it has a surge
of current much higher than the on current. LEDs are a different
mechanism for producing the light. I doubt that noise on the switch is
going to alter incadesant lamp life much, the on-off cycles are way to
fast to get the shock heating that happens when you turn them on.
Jim Lewis wrote:
> My conservative suggestion to debounce is concern over
> noise causing the lifetime of the LED to be shorter.
> Perhaps this is not a concern?
>
> I know in my house some light bulbs seem to burn out
> faster than others and I have always wondered if it
> was due to excessive noise from the switches (look
> nice, but knowing the builder they are probably
> low cost).