Can I use the 74HC299 for a simple shiftIn

Hi, I want to essentially do the arduino ShiftIn tutorial, daisy chain up two shift registers for parallel input. However when I started this foray into electronics in an effort to get bang for my "shipping buck" I ordered two off the shift registers at the top of the list which turn out to be 74HC299's.

Can I make use of this or do I need to get myself a more appropriate register? I think I can work out how I would connect this up, but for what would act as the latch pin?

Any help? Thanks

If i remember right, you get your Latch by the right combination of S1 and S0.

Can I use the 74HC299 for a simple shiftIn

Sorry no.

The M74HC299 is an high speed CMOS 8 BIT PIPO SHIFT REGISTER . That means parallel in parallel out. The one used in the shift in tutorial is a parallel in serial out shift register. These are by no means the same thing.

the xx299 claims to be a "universal" shift register, so it should be theoretically possible to use it for parallel to serial conversion. Even a parallel-out SR can be used as serial by only looking at the "last" bit.

However, the 299 operates differently than most of the SRs used to shiftIn. In particular, rather than having a separate "load" input, it uses a combination of of mode bits and the same "clock" signal that is used for shifting (when the mode bits are different.) It should be possible to write a version of shiftIn to work with this chip, but some effort would be required. More details later, if you're interested. It is probably easier to get the more "standard" shift registers.

Thanks for the replies,

I realize that the 74hc299 is a different animal altogether, but it was the "universal" that gave me some hope.

@westfw: I agree that it will be easier to just get the right thing, and probably also more within my abilities, though if you could elaborate a little on what the differences are I would like to see if I can work it out. After all I have nothing else to do with them.

Thanks for the replies

It is designed to deal with a parallel 8 bit data bus... as microprocessors common in the 70's and 80's were using... like the 8080 and the 6809, etc.

The 8-bit bus is assumed to be bi-directional and this device knows how to deal with the each of the 8 bits. It is like a bidirectional 8 bit wide data latch on steroids... having the ability to shift bits left and right... essentially giving it the ability to do binary math among other uses.

It really is not that useful to the arduino unless you use some 595's to create an old style Data and Address bus design. (which can be done, by the way)

so it should be theoretically possible to use it for parallel to serial conversion.

Yes but in this case the shift register would be only 1 bit wide which is not of much use. If you cascaded 8 of these together then one bit would look like a conventional shift register.

Yes but in this case the shift register would be only 1 bit wide which is not of much use.

Isn't this how shift registers are supposed to work? As far as I can see it can do anything a serial to parallell out AND a parallell to serial in shift register can do. In addition you have the option to shift left or right (2 bits for serial input, 2 bits for serial output).

The only thing missing from making it truly useful as a general port expander for the Arduino would be individual selection of input or output per I/O pin (and the fact that it requires about as many I/O's to control as it adds).

One application might be as a bi-directional interface to a graphics LCD controller (e.g. KS0108B). Two I/O's for mode selection, one for clock pin and another two for serial data in/out. That's 5 I/O's as opposed to 8 which would otherwise be required for the data lines.

Ok; I don't have a 299 handy so I can't test this, but it looks to me like:

OE1/ and OE2/ get tied to +5V; this causes the parallel data pins to NOT be outputs. MR/ gets connected to +5V (master reset; active low.) IO0 through IO7 get connected to whatever you're reading. Q0 gets connected to an Arduino input. This is the "Serial out" of the shift register. (shifting RIGHT: IO0, IO1, ... IO7) CP gets connected to an Arduino output. This is "Clock" for the SR. Connect S0 to +5V, and S1 to and Arduino output. These are "mode", which is somewhat different than "load" for most parallel-in SRs. DSR and/or DSL can be used for cascading.

So on most SRs, you'd load the SR by toggling the "Load" signal (from high to low and back, or vis-versa depending on the exact chip), and this would load the data into the SR, so that you could clock it out one bit at a time. On the 299, you have to set the "mode" signal HIGH, and toggle the "clock" signal (low to high and back), then set the mode to LOW again to start using "clock" to perform shifts. The clock signal has two separate functions depending on the S0/S1 bit settings (actually three, since you can get it to shift left instead of right.)

… and for a shift out (serial to parallel out) I read it as follows:

OE1 and OE2 get connected to Ground and MR to high. Dsr (Data shift right) goes to Arduino data out pin. S1 goes to ground and S0 to +5V. Then set up data on Arduino data out pin and pulse CP from low to high and repeat 7 times for the remaining bits.

The 74x595 (serial in parallel out) has a latch output, but 74HC299 doesn’t appear to have an equivalent function (limiting use for some applications). That is data will appear on the outputs as the bits get shifted through its intermediate positions.