I am a new user to the Arduino Platform and one of my first projects will be building a MIDI controller. For the controller, I need to be able to buffer the user's keypresses until I fetch the keypress value via multiplexing later. So I read quite a few forums and some guy said that I could use a 74HC573 to buffer the keypresses. I've had some problems because the IC did not work as expected, and so I decided to wire up a simple test circuit:
(due to the strange setup, I am not allowed to post images in my first post. Please see my self-reply for the image).
My expectation was that the circuit "remembers" my keypress and then I could reset the keypress, but no matter which combination I tried for OE and LE (see datasheet below), the circuit didn't remember anything. Probably this has to do with the Tri-State design, but I'm not sure what's meant with that.
Any pointers or alternative ICs would help me lots!
"When LE is HIGH, data at the Dn inputs enter the latches. In this condition the latches are
transparent, i.e. a latch output will change state each time its corresponding D input
changes.
When LE is LOW the latches store the information that was present at the D-inputs a
set-up time preceding the HIGH-to-LOW transition of LE. When OE is LOW, the contents
of the 8 latches are available at the outputs. When OE is HIGH, the outputs go to the
high-impedance OFF-state. Operation of the OE input does not affect the state of the latches"
LE high then low to latch. OE can be low all the time.
The LED polarity was correct (on the board at least). I noticed that some of them were flickering and when i moved my finger above the chip, they changed their flickering frequency. When I pressed the one button I also did achieve the transparent mode, but I was not able to make the IC output the state.
I am not sure what you are expecting but I don't think the chip will do what you think it will. It is basically 8 latches. That is it will remember what is on all of the 8 inputs when the latch enable makes a transition. It will not remember individual key presses.
The output enable should be low, then with the latch enable high what ever state is on the D input will appear on the corresponding Q output. When the latch enable is low the Q output will remain at the value it was when the latch enable was last high irrespective of the logic level on the D inputs.
This is not suitable to remember key presses.
In reality you don't need to remember key presses on a MIDI interface as everything happens so fast.
I put inputs 1,2 and 3 to high. Then I put "Latch Enable" to high (or low?), and I expect that the latch remembers that state. Once I put OE to high, the previously remembered state is mirrored to the outputs.
Do I have some basic misunderstanding on how a latch works?
I put inputs 1,2 and 3 to high. Then I put "Latch Enable" to high (or low?), and I expect that the latch remembers that state. Once I put OE to high, the previously remembered state is mirrored to the outputs.
The 573 is a "transparent" latch, and "level triggered" which means that while LE is high, data flows THROUGH the latch portion of the chip from inputs to outputs (the data may or may not appear on the output pins, depending on the state of OE.) When LE is brought low, the output of the latch is "frozen" at the current state, but ONLY while LE stays low. If you were to "pulse" LE from high to low to high again, you would end up seeing the current states rather than the captures states. (OTOH, if you pulse LE from LOW to HIGH to LOW again, you should capture a snapshot of the inputs in the latch.)
Is this what you were expecting? Does it match what you're seeing?
An xx574 is vaguely similar, but is edge triggered.
I have to admit that this IC still confuses me. I will need to setup another experiment.
I can confirm from memory that the data went through the latch (I believe that it was when OE was low, because it is inverted?) but again, no matter which combination I tried (and I tried all 4 possible variations of OE and LE), the IC either mirrored the inputs to the outputs or did not mirror anything (i.e. kept all outputs at LO). One thing which comes into my mind is that when I press the buttons I had attached to LE and OE it might not be a single press but multiple presses from the IC's point of view - need to test that out later.
So what I'm expecting from the specification and your description is if I put input 1 to HI and then pulse LE to LO, then put input 1 to LO and put OE on HI (or LO, depending on if you take the inverted state into account by description), I would see output 1 at HI. Is that correct or is that incorrect?