Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Using 8 IO pins from CPU to control 16 outputs with 74373 chip

Status
Not open for further replies.

Nora

Advanced Member level 4
Joined
Mar 31, 2006
Messages
115
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Location
My garage, USA
Activity points
2,292
This was posted already in the wrong forum, so it's repeat.

I need to use 8 IO pins from my CPU to control 16 outputs.
I'm thinking about using a 74__373 type chip to do this.
I've never used this type chip before so would appreciate any experienced knowledge...
Is this a good way to do what I need to do or are there any other suggestions?
Thanks in advance!
N_N
 

74hc574 i/o

there are lots of ways to achieve this. You can use a shift register in which case you only need 2 pins (3 pins if your shift register has an output latch) and do it with software. Use a 74HC595 for this.

If you want to use 8 pins the 74HC373 is good. If you are making your own board you can also try the 74HC574, same as 373 but the input is directly opposite the output (easier for running tracks on your board).

If the data is bi-directional you can use the 74HC245.

What micro controller are you using, PIC, AVR, 8051?
 

latch 74373 schematic

I'm using a Motorola DSP.
Can you explain a little more the first version?
Yes, I am making my own board so the suggestion of the tracks directly opposite is very helpful!

edit* The data is not bidirectional, but I will repeat the same with 8 pins and 16 inputs.
Thanks!
N_N
 

d latch use?

This should help you out.

If you use two 74HC164's you need 2 pins to make 16 output pins.
If you use two 74HC595's you need 3 pins to make 16 output pins.

A 74HC595 is often used for displays or some other device that might flicker while the data is being shifted. This way the data is not sent until the latch is pulsed. If this is not an issue for you, then keep it simple and use two 74HC164's. I have done this many times without problems even with seven segment displays or LCD displays.

Look at the two schematics.

The code is easily done. All you do is set up the data on the data input, then pulse the clock line high. Do it 16 times to shift the all the bits. If you are using a 74HC595, you will have to pulse the latch to send the data once all of the bits have been shifted in.

I don't know motorola code. I can give you avr code or 8051 code only in assembly.

Download both data sheets and look them over.

If the data you want to send is not 16 bit (two separate 8 bit bytes) then you do not have to cascade both shift registers. What I do is use a different clock line for each shift register (when using a 74HC164) and share the data line.

OR

use a 74HC595 and use a separate latch line for each shift register.

For receiving 16 bit data (if you only have 8 pins or less) you would need something like a 74HC166 which is a parallel to serial shift register. Have a look a the datasheet for more info.

Good Luck
 

74hc573

Thanks for the detailed response ct,
I've attached pix of what I'm trying to do.
I want to make IO boards, 5 in all, each board containing 8 inputs and 8 outputs (2 chips).
I will use 16 pins on the CPU for the IO.

I would address each board separately, using 3 addressing pins, and use one pin to choose Input (Read) or Output (Write).

I'd like to use tristate to say "board is present" or "board is not present".
Can I do this just with the R/W pin?

I've been recommended to use the 74373 chip for both input and output, but also been told it can be glitchy, and sometimes latching incorrectly.

Thanks in advance,
N_N
 

other uses of d latch

You would need a separate I/O line from the CPU for the Latch Enable on each 74HC373 device. ( I am assuming that the pin coming from the CPU being shared by all of the 74HC's is the latch enable, because it is not labeled in your schematic)

For the 74HC's used for input, you may need to use an additional I/O line from the CPU for the Output control pin. Hold this pin high to disable the 74HC373 (outputs high Z). (I really didn't understand your schematic fully since some of the pins were not labeled)

Is this board being manufactured from a professional board house, or is it a home made single sided board?

I would go with 74HC574's instead. It will be easier to run the tracks which may/may not make the board less troublesome. (less via's, more straightforward track runs)

Best of Luck
 

74hc373 can use as shift register

Thanks CTownsend,
I'm looking at the 74HC573 datasheet since it doesn't need a clock signal.
It will be manufactured by a PCB house, and you have a good suggestion about the easier layout.

You would need a separate I/O line from the CPU for the Latch Enable on each 74HC373 device. ( I am assuming that the pin coming from the CPU being shared by all of the 74HC's is the latch enable, because it is not labeled in your schematic)

The separate IO line shown in my schematic (labeled both I/O and R/W) is for the Latch enable.
It looks like I'll need the Output Enable for both Inputs and Outputs, can I just attach it to ground to and not to the CPU?

N_N
 

16bit shift register with 74hc595

Nora said:
It looks like I'll need the Output Enable for both Inputs and Outputs, can I just attach it to ground to and not to the CPU?
N_N

You cannot just attach the OC line to GND for your inputs. The output from both 74HC573's is fed to an 8 bit port on your CPU. One of them must be disabled or tri-stated when not in use in order for the CPU to correctly recognize the bits from the other 74HC573. This way your CPU will read only one of them at one time (whichever one that the OC line = low, and the LE line was pulsed high)

On the two 74HC573's used for output, you can tie the Output Control PIN LOW. When you want to send a byte, just pulse the LE line high for the corresponding 74HC573. IF you share one LE line for both 74HC573's, you will be sending the same data to both 74HC573's, at the same time. This is the reason for a separate LE line coming from your CPU.

Out of curiosity what is the CPU you are using? Is it a micro controller?
Hope it helps.

Good Luck
 

    Nora

    Points: 2
    Helpful Answer Positive Rating
d-latch + output control

Hi-
I'm using a Motorola DSP.

I think what you are saying is that I'd need a separate OE line for each board containing 8 inputs and 8 outputs. :idea:
Just addressing the board is not going to be enough for the CPU to know where to read from.

The code goes something like this:
Match needed card address (shown 001)
OE = 0 //contents of 8 latches are available at outputs)
LE = 1 //data enters latches and output side is equivalent to the input side
Process data in CPU
Pause if needed
Repeat //next card address 010

Unfortunately, I don't have enough pins. 5 boards- 3 address pins + one LE and I have only 2 pins left over (6 pins altogether).
I redid the schematic leaving out the OE for clarity. TB = terminal block, and each I/O is processed as a separate bit.

Thanks in advance!
N_N
 

74hc574 data sheet portugues

You still need to control the OC or OE line on the latch that provides input to your CPU. The outputs don't matter, only the input latches.

Have a look at this:
https://en.wikipedia.org/wiki/Bus_contention

it might explain things a little better than I can.

If you still don't have enough pins, then maybe you should try some serial to parallel (74HC164) and parallel to serial (74HC166) devices? A lot less tracks to run on your board, and in my opinion, less headache!

Best Of Luck!
 

why do you use a d latch

OK makes sense-
Thanks!
N_N
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top