EmbeddedRelated.com
Forums

Latches: What Are They For?

Started by Fao, Sean October 24, 2005
Fao, Sean <enceladus311@yahoo.comi-want-no-spam> wrote:

> I was with you up until the last sentence. By "active state", do you > mean that I wire the output enable pin to be at a constant high?
Yes. If you have no particular reason for the latch output ever *not* to provide data to the 7-segment display, you don't need the output enable signal controlled by the MCU --- so tie it to the 'enabled' state, which in your case is equivalent to one. Figuratively speaking: if you have no intention ever to use the brake on your car, you might as well get rid of the brake pedal to save some precious legroom. ;-) -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
Hans-Bernhard Broeker wrote:
> Fao, Sean <enceladus311@yahoo.comi-want-no-spam> wrote: > >> I was with you up until the last sentence. By "active state", do you >> mean that I wire the output enable pin to be at a constant high? > > Yes. If you have no particular reason for the latch output ever *not* > to provide data to the 7-segment display, you don't need the output > enable signal controlled by the MCU --- so tie it to the 'enabled' > state, which in your case is equivalent to one.
Well that's almost too simple! And as long as there are no adverse affects, I don't believe I currently have any reason not to have the signal sent as soon as I set the input pin high. Although, I must admit that I can think of at least one example where it would come in handy to have the choice.
> Figuratively speaking: if you have no intention ever to use the brake > on your car, you might as well get rid of the brake pedal to save some > precious legroom. ;-)
With gas prices the way they are, I might as well take off the brake pads, too...it'll cut back on friction and improve fuel economy. Got anything else I can take off? ;-) Thanks again for the help, -- Sean
Hans-Bernhard Broeker wrote:
> Yes. If you have no particular reason for the latch output ever *not* > to provide data to the 7-segment display, you don't need the output > enable signal controlled by the MCU --- so tie it to the 'enabled' > state, which in your case is equivalent to one.
Be very careful with this one! Check the data sheet for your latch and make sure the output enable is level sensitive and not edge sensitive. This is one of the major differences between a "latch" and a "flip-flop" and people often use the terms interchangably when they shouldn't. A D type flip-flop will not propogate the input signal to the output signal without seeing a clock edge! So if you are using a D flip-flop to latch your data you will need to strobe (send a pulse with a high and a low edge) the clock pin. Simply tying the line high or low will NOT work. If you are unsure what kind of hardware you're dealing with, post the part number or a link to the datasheet and we'll check it over. -Will