3.3V kindof 74LS166? (Parallel-In Serial-Out shift-register)
jmspaggi
Posts: 629
Hi,
I want to reduce the number of used pins for the switchs I have (5 pos switch and rotary switch). I looked at a 74LS166 register which seems to do the job, but it's a 5V component. Is there any component like this one, but working at 3.3V? Or can I plug it at 5V, and add few diodes at the output to get the voltage down to 3.3V?
Thanks,
JM
I want to reduce the number of used pins for the switchs I have (5 pos switch and rotary switch). I looked at a 74LS166 register which seems to do the job, but it's a 5V component. Is there any component like this one, but working at 3.3V? Or can I plug it at 5V, and add few diodes at the output to get the voltage down to 3.3V?
Thanks,
JM
Comments
Lawson
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Thanks for your prompt reply.
I looked on internet and found the datasheet for this one, but it says 5V on the first page http://www.datasheetcatalog.org/datasheet/philips/74HC_HCT166_CNV_2.pdf . Does it mean it can take up to 5V but will work with 3.3V too? Or it's because it's not the right one?
Thanks,
JM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Linux? There is worst, but it's more expensive.
Thanks for the confirmation regarding the 3.3V.
The switch are already all connected to the 3.3V so I will "just" have to add the 74HC166 between the two.
Now I know that I will always have to look at HC instead of LS (Which was working fine with the Javelin).
Thanks,
JM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Linux? There is worst, but it's more expensive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nathan
"Free as in freedom, beer gratefully accepted though."
JM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Linux? There is worst, but it's more expensive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why did I think a new, more challenging, job was a good idea ??
So I bought some SN74HC166N... But I'm having troubles with them.
I connected D0, D1, D2, D3 to 3.3V, D4, D5, D6 and D7 to 0V that way I should get something like 00001111 or 11110000.
__
PE is connected to 3.3V with a 220Ohm resistor, and to a switch to connect it to gnd when I press it.
Q7 is connected to a LED to a 220Ohm resistor to gnd, so I can see when the output is 1 or 0.
__
MR is connected to 3.3V with a 220Ohm resistor.
Ds is connected to 3.3V.
CP is connected to GND with a 220Ohm resistor, and to a switch to connect it to 3.3V when I press it.
__
MR is connected to gnd.
So I have one switch connected to PE, and one to CP. If I put the power on, press PE, release it, then each time I press CP I should see the next bit. However, what I get is 11111111. Like if nothing is happening. I can press the switch 20 times, I will always get 1.
Any idea what's wrong?
Where should I connect Ds if I don't use it? I will chain the HC166 later, but so far, should it be to gnd? Or 3.3V? I don't think this should change anything for the 8 first bits.
I can send a picture of my demo board if it helps.
Thanks,
JM
-Phil
Thanks for helping!
/MR (Or /CLR) is now connected to +3.3V.
I have also connected CP to the prop (P17) and a LED to P18 to see if it's working.
Here is the code
Seems that code is working fine since I can see my control led blinking, but the output of the HC166 stay always high
What's about pin6? It's CLK INH in the datasheet. Should I connect it to 3.3? Or gnd? So far it's to gnd.
I also tried fews differents HC166 just in case, same result.
Thanks,
JM
Look like it's not
Set PE Low
Set PE High
Clock
But
Set PE Low
Clock
Set PE High
Continue to clock.
I will continue to investigate.
What should be done is:
Set clock low
Set PE low
Set clock high
Set clock low => Q receive the first bit
Set PE high
repeat 7
Set clock high
Set clock low => Q receive the next bit
This process can be interrupted and restarted from the beginning at any time.
JM
Do you need the reset on the 166?
Try using a 165, Parallax sells the 165, I use these exclusively with their SIPO HC595 chip to expand I/O indefinitely on the propeller and isolate the pins. With 2 x 3 = 6 pins you can send/recieve an unlimited number of signals.
http://www.parallax.com/Store/Components/AllIntegratedCircuits/tabid/154/CategoryID/31/List/0/SortField/0/catpageindex/2/Level/a/ProductID/230/Default.aspx
I also sadly no longer use my collection of LS chips anymore in favor of HC which also uses a lot less power.
thank you
/michael
serial Data-input Ds = high
this means every time you switch the clock with PE high,
a high-bit is shifted in into the shiftregister. So you will get
all bits high.
Ds has to be tied to 0V.
You have to put the PE-input to low to load the parallel 8 bitpattern
into the shiftregister. Then switch PE to high to keep the loaded bitpattern
consistant.
Then start to clock out the bitpattern. As PE is high and Ds is low
while clocking out the bitpattern low-bits are shifted in into the shiftregister as Ds is tied to low.
You have to repeat this for continuosly reading in the inputs.
Me personally I prefer the 74HC597-chip because this chip has a an inputlatch.
This means you can send a pulse to transfer the bit-states of the parallel-input into the input-stage of the chip. You make a snapshot of all 8 pin-states. After the snapshot is done the input-pins can toggle-around in any manner it will no longer disturb the bitpattern present
at the time the snapshot has been taken. The bitpattern will stay consistant.
After that the pin-states can be transferred into the shiftregister
Then you clock-out the bits to the serial output.
best regards
Stefan
All this time I didn't know about the 597 PISO complement to the latched 595 - thank you very much I will switch to 595/597 pairs.
/michael
Can we chain the HC597 the same way we are chaining the HC166? Between the 3 (165, 166, 597), which one should I prefer?
Thanks,
JM
-Phil
Vcc=3.3 input pin 5V related output pin 3.3V or 5V