In the way we can increase the amount of outputs with things like 595 shift registers, what is an equivalent that increases inputs?

It is obvious that we can increase outputs by the use of 595 shift registers. What is the equivalent in regards to inputs?

In other words:

If using the single Arduino, what increases its ability to increase inputs, in the same way as 595s increase the output?

Use shift registers like the 165, perhaps

3 Likes

Does this work on an equivalent concept to the 595, but instead of outputs, it just makes use of inputs instead? I presume it could be used on the same Arduino board right?

The 165 and others like it are parallel to serial converters, ie the inverse of the 595 serial to parallel shift register. They work with Arduino boards

2 Likes

OK, UKHeliBob, this may be one of the quickest solutions that I have seen. I will look into this immediately. I can probably close this as solved quicker than anything yet :rofl:

I just hope they are as easy as the 595s I have used so far.

Port expanders provide both input and output capability.

4 Likes

A sketch I modified to add 74xx165 function.

1 Like

There is also the 74HC597, which has a latched input register separate from the shift register. It's pretty much the opposite of the 595.

Interesting. What are the advantages of this chip over 74hc165?

Functionally they look very similar:


See also the library manager in the IDE for @robtillaart 's libraries - fast shift in, fast shift out, and fast shift inout.

And, there's always the immortal Gammon. See the shift in and shift out sections indexed here:

3 Likes

I think that diagram of the 165 is a bit misleading. There's only one register in the 165. It is loaded parallel, then shifted out. The 597 has two registers, one to latch the parallel input, and the other to shift the output. Transfer between the two is controled by you. So you could, for example, latch in new input while the output is being shifted out. The TI datasheet makes this clear:

https://www.ti.com/lit/ds/symlink/sn74hc165.pdf

Whether the 595 offers any practical advantage depends on what you need to do.

2 Likes

Perhaps a little. Although the upper rectangle in the '165 diagram isn't labelled as a 'register' like the left-hand rectangle is for the '159.

That upper rectangle is just a bunch of gates that set or reset the bits in the flip-flops that make the lower rectangle a true 'register'.

I can easily see the advantage of having 2 registers in the '595: the outputs can be kept constant while the next set of data is shifted in. The external circuit never sees a half-shifted-in set of data.

But the double-register advantage of the '597 over the '165 is less clear. In what scenario would it be an advantage to capture the inputs while the data is being shifted out...? I'll keep half an eye out for such a scenario!

@extant4life apologies for the slightly off-topic discussion. For your use cases I suspect the '165 and '597 are both equally suitable.

1 Like

That is cool Paul. I was hoping to experiment with the actual chips anyway, as opposed to an inbuilt unit, with other things attached (like expander units). I want to experiment with a bunch of chips as well, so I might go for one of the Amazon project packs, which have multiple chips like 165, and 595 included. I have a couple of 595s due to packs (often with a breadboard, and other items to boot), but a few extra does not hurt.

I am aware you have to check the real price of the items, but it seems to work out ok if you want a load of new items that can be experimented with, e.g. nand/ nor/ gates etc. I know you pay an overhead (which is the reason they sell them as “project packs“), but a nice selection is handy for budding enthusiasts who want to experiment.

For example, if you go wholesale, you can maybe buy a big pack of 50+ etc. For an experimenter, the “multi“ packs do not dent your wallet too much. I presume the companies that create the packs make money due to the fact that they purchase whole loads of the chips, and then pack them into a “project pack“.

Ok, don't forget to add a bypass capacitor for each chip in your circuits. 0.1uF ceramic, as close as you can get them to the Vcc and GND pins of each chip. On breadboards, I normally place these across the +/- power bus lines, adjacent to each chip, and that works well.

1 Like