How to wire inputs to TTL

Thread Starter

gfmoore

Joined May 24, 2023
16
So, I'm teaching myself electronics, though I thought I new a bit from when I was a youth, but apparently not :(

I am attempting to build an 8 bit TTL computer following the ideas of Ben Eater. This is for teaching purposes - basic computer operation.

I have built a front panel using mainly dpdt switches and some 3mm panel leds with a built in resistor (200 ohm). The following diagram shows how I have wired it up and how it would output onto a bus. (Apologies for poor quality diagram, I am learning how to use tinyCAD at moment)

In my naivete I thought that TTL simply wanted either 0V or +5V and so I connected my switches accordingly.

I am noticing a rather alarming voltage drop when I start turning on the switches. This is affecting other parts of the machine (though I have disconnected that for testing).

I am using a bench power supply (cheap Chinese thing, but it shows voltage and current draw)

So no switches on my multimeter shows 5.01x volts current draw (from bench ps is 0.02 amps
With 1 switch turned on, green led lights (Data 0) and voltage drops to 4.77x volts and current draw is 0.05 amps)

I expect the current draw to go up because the green LED wants say 20-30mA, but I cannot understand why the voltage is going down. The power supply is showing 5V as before but the multimeter is showing 4.77xV

If I turn on 2 LEDs, voltage drops to 4.67V and current is 0.07A
7 LEDs voltage drops to 4.1x volts and current is 0.5A

If I switch on 8 LEDs the LEDs mostly go out (or are very dim).

If I now turn off the LEDs the voltage is still 3.8V and current is 0.8A

I turn off the power supply and turn all switches off and everything is okay.

Something is very wrong. I suspect I am blowing up the LS245 - and from answers to a previous post I think I am drawing too much current through it.

Can anyone please explain and perhaps suggest a fix. :)

Thanks.

1685978996520.png
 

Thread Starter

gfmoore

Joined May 24, 2023
16
I feel somewhat foolish as I have solved one of the issues. When looking closely at my breadboard I noticed a bit of shiny metal, it was a bent pin (actually two) on the 8th data line. Carefully straightened them out and re-seated and now 8th LED works fine.

Voltage drop though is 5V to 4.8V current draw 0.09A with all LEDs on. I still don't understand the (slight) voltage drop.
 

WBahn

Joined Mar 31, 2012
29,978
What current is your bench supply rated for?

First thing is to see if it is your supply. Disconnect everything and set the voltage for 5 V. Then, while monitoring the voltage, put a 100 Ω resistor across it and see how much the voltage drops. Don't keep it there very long, just a second or two, as this will be dumping about a quarter watt of power into that resistor and it will heat up quickly. This should draw about 50 mA, which you indicated is causing the voltage to drop to about 4.8 V.

If you want to test at higher currents, use a power resistor rated for at least twice the power you will be asking it to dissipate. If you don't have one, then you can make a quickie by taking a bunch of 100 Ω resistors (or any value, really) and putting them in series/parallel combinations. For instance, if your resistors are 1/4 W, you want to run them at no more than about 1/8 W, which means you want no more than about 35 mA. If you put two 100 Ω resistors in series, that will give you about 25 mA and will only dissipate about 62 mW in each (meaning that you could use 1/8 W resistors, if that's what you've got).

To get 200 mA, just put eight of these pairs in parallel. Because each resistor is well within it's power handling range, you can add one pairs at a time and plot the voltage as a function of current. This curve will be useful for you in the future -- and it may motivate you to get a better supply.
 

schmitt trigger

Joined Jul 12, 2010
871
Legacy TTL ICs don’t source current very well, but sink current easily.
In other words, the LEDs go from 5v to the gate output. The state will be inverted.

This likely not related to the issue you describe, but can affect you later
 

Jon Chandler

Joined Jun 12, 2008
1,029
From the datasheet features for this IC:

SmartSelect_20230605_103359_Edge.jpg

As you have the LEDs wired, from output pin to ground via a 200 ohm series resistor, depending on the LED color, you're pushing the 15mA limit pretty hard. Try changing the series resistors to 1k and see what happens.
 

boostbuck

Joined Oct 5, 2017
501
It's curious that, as current load increases, the supply meter shows steady 5v while your multimeter shows a dropping voltage.

Where is your multimeter connected with respect to the supply?
 

MrChips

Joined Oct 2, 2009
30,712
Yes, it depends on where you connect your DMM in an attempt to measure supply voltage. Expect to find a voltage drop across any wire supplying current to your circuit board.
 

MrChips

Joined Oct 2, 2009
30,712
I also said in your other thread, don’t drive LEDs directly from a logic source. Use an inverting buffer such as 7404 or 74LS04.

Don’t try to drive HI logic level to the LED. Let the 7404 inverter sink current. In other words, connect the series resistor and LED from Vcc to the output of the 7404 gate.

Something like the upper NOT gate in the circuit diagram shown below.
Do not use the output of the NOT gate for any other logic function. It might not be at an acceptable logic level voltage. It is for driving the LED only.

1686110168347.png
 

Thread Starter

gfmoore

Joined May 24, 2023
16
Thankyou for this advice.
The multimeter is connected to the breadboard at the points where the wires from my power supply connects to the breadboard. (I've tried a different multimeter just to check.)


Edit: @WBahn Power supply is 0-30V at 5A. I shall carry out your suggestion as soon as I can as that is an interesting experiment. :)
1686127083644.png

I am going to try the 1k resistor to the LEDs next. I had hoped that the 74LS245 octal bus transceiver would suffice for driving the LEDs (as in Ben Eater's videos), but (@MrChips) I shall certainly try some invertors/buffers if the 1k resistor doesn't suffice. I accept your solution is probably best, but I'm running out of space on my breadboard. Thankyou for the clear circuit as well.

I appreciate all your suggestions it is very much appreciated and is helping me gain a lot of insight into what I thought would be quite straightforward. :)
 
Last edited:

boostbuck

Joined Oct 5, 2017
501
If the supply voltmeter remains at 5V then it won't be the CC limit reducing the voltage at the board. Either the wires to the board are poorly connected at one or the other, or they are very thin.

Getting a reliable power supply to the board is a first step.
 

Thread Starter

gfmoore

Joined May 24, 2023
16
Well I tried putting 1k resistors in front of all LEDs, they are plenty bright enough as someone said. I connected 1k resistors from the centre (common) output of my switches that fed the address and data buses and I'm pretty sure I have no tied all control inputs high or low through 1K resistors. So nothing is directly connected to +5v or gnd apart from the supply pins of course.

My device works, but I am still getting a very substantial voltage drop from the supplied 5V to 4.6V or even less. So much so that the RAM won't write or drive enough to the data bus.

In answer to other questions, the C.C light remains off so I assume that I am able to supply enough current and the C.V. light is lit, which I assume means that the PS is providing what it thinks is a constant voltage.

To test whether the Power Supply was not the culprit I have put the power through one of these: https://www.ebay.co.uk/itm/166046676818 Buck convertor and adjusted to get 5V. I have had to turn up the supply voltage (via the trimpot) to 5.6V or more volts to get the circuitry to operate correctly and then it is is fine.

I guess? that is fine as long as what the meter reads on the power lines is about 5V yes?

I did the first part of the experiment that W Bahn suggested and here are the results:

5V from regulator -> 4.94V om digital multimeter at 2mA (as read on a clamp meter)
Added 100R and got 4.92V on digital multimeter, still 5V on buck convertor display and 5mA as measured on a clamp meter

(I don't know if the figures on a clamp meter are accurate at such low current, but they match up with the what the main power supply says.)


See, what I cannot get my head around is why would the voltage decrease at all? I thought the whole point of a regulated power supply was to provide a constant voltage and draw as much current as needed (to maintain that voltage). So, if I set the supply to 5V everything should get 5V and unless I draw more than the supply can provide then 5V everywhere???

Am I missing something conceptually. Ben Eater doesn't seem to have these issues and he hardly even uses any resistors for his LEDs and ics.

Sorry :(

I keep looking at my circuits, disconnecting things as required and I still keep getting voltage drops.
 

MrChips

Joined Oct 2, 2009
30,712
Don't daisy-chain your Vcc and GND connections on your breadboard.
Run separate Vcc and GND connections from the PSU to different parts of the breadboard, like this:

1686231745270.png
 
Top