Author Topic: Not measuring 0v/gnd through ground resistor  (Read 1478 times)

0 Members and 1 Guest are viewing this topic.

Offline bitmanTopic starter

  • Supporter
  • ****
  • Posts: 299
  • Country: us
  • Open Source Guy jabbing with Electronics
Not measuring 0v/gnd through ground resistor
« on: October 13, 2019, 09:48:39 pm »
On the attached schematic (part of a larger clock control circuit of pure 7400 chips) I have a strange issue. On the bread board this works - the selector switch changes the output selector but on the bread board, I measure 1.2v on pin 10 and 11 which means I'm in the bad TTL zone and the selector isn't working. This is a very basic setup - I'm pulling down the input lines to gnd through a 100K resistor - but still I get 1.2V when measuring on the two pins.

I would really like to understand why that is. I'm thinking a smaller resistor is needed but I am not sure I understand the reason for it.  Note the LEDs that shows selected settings work as expected. When the switch is pulled high I do get 5v on the two pins. It's just not going to gnd as I expected.
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: gb
    • Electronic controls
Re: Not measuring 0v/gnd through ground resistor
« Reply #1 on: October 13, 2019, 09:50:47 pm »
100k is far too big.
 

Offline bitmanTopic starter

  • Supporter
  • ****
  • Posts: 299
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Not measuring 0v/gnd through ground resistor
« Reply #2 on: October 13, 2019, 09:52:49 pm »
100k is far too big.


Ok - but why? I'm trying to understand the principle (it's simply picked to make the number of different resister sizes as low as possible).
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: Not measuring 0v/gnd through ground resistor
« Reply #3 on: October 13, 2019, 10:05:39 pm »
Ohm's Law and the datasheet

Grabbing a 74xx datasheet:
https://www.jameco.com/jameco/products/prodds/910901.pdf

IIH is 40 uA max so there is a current flowing into the pin when high.
VIH is as low as 2.0V - this is the minimum voltage on the pin that represents a logic 1
So, the 40 uA flowing through the pull-up resistor can't drop more than 5.0V - 2.0 or 3.0V

3.0V = 40 uA * R or R = 75K Ohms.  This is NOT a good value to use even though it meets the specs

I use 4.7K or even as low as 1K because I need enough current flow through the mechanical contacts of a switch to keep the circuit controlled.  Contacts tend to have some amount of oxidation and it takes voltage to poke through it.  It takes current flow to keep the connection 'made'.  That's why they invented switches with bifurcated gold plated contacts for low level switching.

« Last Edit: October 13, 2019, 10:14:45 pm by rstofer »
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7681
  • Country: ca
Re: Not measuring 0v/gnd through ground resistor
« Reply #4 on: October 13, 2019, 10:20:41 pm »
Always remember TTL gate inputs float high, you have to sink current (~0.4mA) to take them low.
So your DIP switches are best going to ground, or the 100k should be much lower value.
 
The following users thanked this post: tooki, bitman

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: Not measuring 0v/gnd through ground resistor
« Reply #5 on: October 13, 2019, 10:26:43 pm »
OOPS!  I worked the case for pull-up resistors!  Pull-down is far worse:

VIL is 0.8V and IL is 1 mA so R = 0.8V / 1 mA or 800 Ohms.

In other words, to get an input down to logic 0, you have to flow 1 mA out of the pin and this can't result in a voltage higher than 0.8V across the resistor.  Again, a value half that is probably recommended.

In fact, I never use pull-down resistors for TTL...  Among other things, when it comes time to pull the pin high, like to 5V and given a 470 Ohm resistor, I would need to flow 10 mA through the switch.  This might be an issue.

« Last Edit: October 13, 2019, 10:28:32 pm by rstofer »
 
The following users thanked this post: bitman

Offline Audioguru again

  • Regular Contributor
  • *
  • Posts: 115
  • Country: ca
Re: Not measuring 0v/gnd through ground resistor
« Reply #6 on: October 13, 2019, 10:36:11 pm »
It is shown on the datasheet.
For an old-fashioned 74xxx the input low voltage should be 0.4V and the datasheet says the maximum input low current low is 1.6mA so a pull-down resistor value is 0.4V/1.6mA= 250 ohms.
For an old fashioned 74LSxxx the input low voltage should also be 0.4V but the maximum input low current is only 0.4mA so the pull-down resistor should be 1k ohms.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Not measuring 0v/gnd through ground resistor
« Reply #7 on: October 13, 2019, 11:09:02 pm »
Always use pull-ups.
Some logic gates do not like their inputs tied directly to Vcc.

 
The following users thanked this post: bitman

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline bitmanTopic starter

  • Supporter
  • ****
  • Posts: 299
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Not measuring 0v/gnd through ground resistor
« Reply #9 on: October 27, 2019, 07:49:36 pm »
I again have a lessons learned here. I didn't even bread-board this before just changing the schematic to force a high default. Only to realize post putting it together that nothing works.
First, I do appreciate the input - it was exactly what I asked for - learning why things didn't work as I expected. And yes, this is old 7400 series stuff - it still shows huge holes in what I thought I knew, so I'll keep on "hacking" on my simple 7400 CPU until I get all the basics down.

Of course the issue here is, the the 74151 is a multiplexer - based on a selector a given input signal is selected and send to the output. The way your quickie diagram shows it, the LED now shows the negative (complementary) of the signal going into the selector - that's definitely not what I wanted. The LED is the indicator of what the selector is set to - and us humans like counting the "on" vs. the "off" to see if things are active.

It's not a problem if the switch is "turned on" when you actually break a circuit - as long as the LED follows.

Another issue that I'm now hunting on bread-boards is that regardless of throwing the switch, I still get almost 5V on the selector signals. The LED turns on/off just fine, but the signal that controls what happens doesn't change to low. When I measure the pins with the volt-meter it keeps showing a 4.7v potential on the selector leg, even though it should be forced to ground.  I wonder if connected the 330ohm resistor the the 4.7k ohm that gets pulled to ground would make the LED follow the input signal. Well, time to test ...

So lesson learned, don't just change the diagram with out testing it first. Or rather, even if the change seems simple you should still test. I do that for software - no clue why I didn't apply that for hardware too.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: Not measuring 0v/gnd through ground resistor
« Reply #10 on: October 27, 2019, 09:00:34 pm »
You can turn the switch around (metaphorically) and for each specific LED pattern, you wire the input to the proper pin.  They won't be in the order they are now but so what?  When both LEDs are lit, you are apparently selecting input 3.  Fine, whatever signal should be active as input 3 should be connected to the chip input IN0.

SW                  LEDs
Closed Closed   ON  ON   Looks like selection 3 so connect 3rd signal to  IN0
Closed Open     ON  OFF  Looks like selection 2 so connect 2d signal to IN1
Open   Closed   OFF ON   Looks like selection 1 so connect 1st signal to IN2
Open   Open     OFF OFF  Looks like selection 0 so connect 0th signal to IN3
 

Offline bitmanTopic starter

  • Supporter
  • ****
  • Posts: 299
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Not measuring 0v/gnd through ground resistor
« Reply #11 on: October 27, 2019, 10:54:43 pm »
I did a breadboard using the original design but using resistors to connect ground and high directly to the chip as indicated here. This works - my original design did not use resistors between ground and the entry point, so I guess that's the problem and I'll have to revisit the calculations shown here to get the proper values. This is my guestimate that looks like it works when isolated:
862340-0

And the breadboard if anyone is interested looks like this - this behaves as expected. When the two selectors are low, the "LowBit" switch is connected to out. When the first switch is high, the "HiBit" works (yeah, bad name). And when the second dip switch is high and the first is low I get a constant high. This is for proof of concept only - there are 3 input signals in the real circuit - it's not using push switches.

862344-1

So I'm not getting the "default to high" - if I did that, I would have S2 high and give me the wrong result (or I would of course have to use different output pins). I've always pulled unused pins to low and it's never caused an issue - but reading between the lines here, it seems to be more efficient to tie them high. I'll have to experiment some more here to understand it more.

But it looks like that when I need signals to toggle, using a resistor via gnd or +5v results in more reliable results for me. 

So yes - still a confused newbie but on the right track (I think). Thanks again for the posts. While this may be basic for some of us - it is really helpful to me.
 

Offline bitmanTopic starter

  • Supporter
  • ****
  • Posts: 299
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Not measuring 0v/gnd through ground resistor
« Reply #12 on: October 27, 2019, 11:06:57 pm »
You can turn the switch around (metaphorically) and for each specific LED pattern, you wire the input to the proper pin.  They won't be in the order they are now but so what?  When both LEDs are lit, you are apparently selecting input 3.  Fine, whatever signal should be active as input 3 should be connected to the chip input IN0.

That's how I implemented going from the original "gnd" when closed to "+5v" when closed. I can move things like led positions easily - that's not the challenge. The problem I had was that the switch position didn't matter. I kept measuring either +5v or gnd regardless of switch position.  Now that I have the resisters between +5v and the switch, and the resister array between the switch and ground. While I still need to get the exact reason for this, it solves the problem.

But you're right - I could use different output lines - I would just have to redesign the PCB and get new ones made. Adding a resistor or two is something I can do without getting a complete new PCB.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf