6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 6:20 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: 74HC138 enable problem
PostPosted: Fri Jul 22, 2022 7:23 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
I have implemented a fairly standard glue logic incorporating a 74HC138 decoder. It works fine as long as I add a pull down resistor on the chip enable. All items are HC series.

See extract from my schematic. The hand drawn resistor is the one I have to add. Without it the 74HC138 never produces any output.

Why do I need the resistor? (Go easy on me, I'm not an electronics expert!)

Attachment:
GlueSnip.png
GlueSnip.png [ 10.73 KiB | Viewed 1000 times ]


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 22, 2022 7:51 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
adrianhudson wrote:
It works fine as long as I add a pull down resistor on the chip enable.
It's probably not working as "fine" as you think it is. Adding a resistor there shouldn't make any difference.

It's hard to guess the exact cause, but here's one possible scenario. Wiring errors are a common cause of trouble, so maybe pin 5 of the '138 actually doesn't connect to the NAND's output as shown in the schematic. Instead, pin 5 of the '138 connects to nothing, and has floated high (as unconnected CMOS inputs can easily do -- they can also float low), and adding the resistor is what pulls it low, enabling the '138. But it's enabled regardless of what the NAND says -- did you check this? The result would be having I/O appearing at several inappropriate addresses as well as appearing at the correct address. That's what I mean by not working fine.

Hard to be more specific, but that's my initial advice. Check the wiring, and be on the lookout for other symptoms.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 22, 2022 7:57 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
DCwise, you don't need the resistor; but I wonder if you're on the raggedy edge of it working timingwise, and the resistor helps the 'HC30 pull the line down just a hair faster. The whole cascade of logic there has a typical propagation delay of about 53ns, and a maximum of about 80ns, according to the data book. That may be an awful lot, depending on your clock speed. That's why we don't encourage very fine-grained address decoding. To save some delay, it looks like you could take U7A's output to the 138's E3 instead, and connect that input of U8A to +5V.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 22, 2022 8:50 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Dr Jefyll,
Thanks for your thoughts! However, I have checked both the connection between the 8input nand's output and the '138's input, It is good. The '138 is being selected correctly - all outputs go high when E2 is high. So, that's not the problem.

Garth,
Thank you for your thoughts too. I am running the thing at 1 mHz so I think timings are okay but its a good theory. Actually, I found the resistor "fix" whilst running it at 1Hz 50% duty cycle. I can't work out whether timing can still be a problem at that speed but I am guessing it might be (??).
I will try your suggestion of rewiring U7A output to the 138's input etc and report back.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 22, 2022 9:48 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
adrianhudson wrote:
The '138 is being selected correctly - all outputs go high when E2 is high.
E2 is an active-low input, which means E2 high causes the '138 to be de-selected. When de-selected, all eight of the 138's outputs will go high -- they too are active-low.

It would be good to verify what happens when E2 does go low (which the added resistor encourages it to do).

Quote:
So, that's not the problem.
Troubleshooting is tricky. But one of the rules is, don't be too quick to rule things out. Of course, you do need to make conclusions, but you also need to take those conclusions with a grain of salt!

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 22, 2022 10:40 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Are you building this on a solderless breadboard?

They are not all created equal and even the best can be sketchy.

The very worst I have had the displeasure of defeating myself with were from ELEGOO. Sold all over Amazon. Even when brand new, connections could have as bad as a 2V drop across them with just 1 mA of current. Connections could even act like leaky diodes. Add to that all the other deleterious effects of solderless breadboards.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 8:46 am 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Haha, yes, I know all about Elegoo. Total cr*p. A warning to anyone out there: You WILL regret buying breadboard on Ebay. It is impossible (at least on ebay uk) to buy any good breadboard. The trouble with, it seems, all online marketplace sites - Amazon included, that commodities - like breadboard - are a race to the lowest price. If you can be a penny cheaper than all the rest then your listing bubbles to the top. This means that as a seller, you have to buy cheap. If you source a slightly better product you have to sell it for a few pennies more. It therefore disappears out of view down the listing and never gets bought.

The 18th century English writer and philosopher John Ruskin had (amongst many others) a saying (some dispute it was actually by him but that is another subject):
"There is hardly anything in the world that cannot be made a little worse and sell a little cheaper, and those who consider price alone are that man's lawful prey. It's unwise to pay too much, but it's worse to pay too little. When you pay too much, you lose a little money – that is all. When you pay too little, you sometimes lose everything, because the thing you bought was incapable of doing the thing it was bought to do. The common law of business balance prohibits paying a little and getting a lot – it can't be done. If you deal with the lowest bidder, it is well to add something for the risk you run, and if you do that you will have enough to pay for something better."

He might well have been saying that because he bought breadboard on Ebay!

I have it framed on my wall.

(Oh, and don't get me started on Ebay breadboard power supplies!!!)

Having said all that, yes, I am on breadboard. Its not Elegoo or its ilk. I have selected only the best pieces - you get the odd piece that has whole areas of poor connections - and literally checked resistance on every - EVERY - connection - that is a real time consuming thing to do, I can tell you. I have done everything I can to minimise breadboard issues - no power cul-de-sacs, extra power connections everywhere, capacitors everywhere etc etc.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 9:00 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I take it you don't have an oscilloscope? (Maybe you could borrow one?)

Possibly, you could get somewhere with a multimeter, if you tie off inputs and check outputs - check both the pin that produces a signal and the pin which receives it.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 9:46 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Regarding showing the differences in quality between different brands of solderless breadboards, this is not the video I was looking for, but it seems to be good:
https://www.youtube.com/watch?v=XKQJhe9n_ug
BPS is good stuff. I think Jameco's are made by Global Specialties which is also good. I've only ever bought the American ones with a lifetime warranty, and have never had any trouble at all with them. (I still don't encourage their use for fast digital though, or for switching power supplies. I use them a lot for lower-frequency analog stuff.)

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 12:37 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
I never used breadboards, I was always soldering on perfboards(is that the name?). With the prices of pcbs so low these days I even stopped doing this except for the smallest I circuits I maybe need very quickly. I draw my schematics in Eagle from the start anyway, so it's easy to make a board then too.

If I have to experiment onnsuch a board, e.g. with a new chip I'm not accustomed too, I just add some opetions, jumpers, and the occasional perfboard area even.

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 4:20 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Thanks Garth for the video, very useful. Unfortunately, the Jameco breadboard here in UK is £18.95 which is $22.62. eyewatering!

BigEd, I do have an oscilloscope - 2 channel - not the best in the world but using it is how I found I needed the pulldown resistor. When I probed the input to the '138 the damned thing started working, lifted the probe off and it stopped!


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 4:42 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Ah, that's good news: you can for example see the signal's levels and edge rates.

Sometimes, if you probe a signal and it makes a difference, it's because you have a bad connection - it's the physical probing rather than the electrical nature of the probe which has had an effect.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 5:04 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
It might also be an idea to swap out the 74HC30 and/or 74HC138.

Also, you probably already checked this, but some breadboards out there do not continue the power rails all the way down the board. I know for sure of those that are split in two and I 've heard rumors of some with 3 segments.

$23 is nothing for a good breadboard, Have a look at this: https://www.digikey.ca/en/products/detail/3m/922354/180283

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 5:18 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
BigEd wrote:

Sometimes, if you probe a signal and it makes a difference, it's because you have a bad connection - it's the physical probing rather than the electrical nature of the probe which has had an effect.


Interesting. I'm pretty sure the connections are okay but I will triple check

BillO wrote:
It might also be an idea to swap out the 74HC30 and/or 74HC138.

Also, you probably already checked this, but some breadboards out there do not continue the power rails all the way down the board. I know for sure of those that are split in two and I 've heard rumors of some with 3 segments.

$23 is nothing for a good breadboard, Have a look at this: https://www.digikey.ca/en/products/detail/3m/922354/180283


Already swapped both of those. Fist thing I chacked. I tested them both (albeit static) on the bench and at least in DC they are working.

and {{cough}} $457!!! Blimey! Bet they don't sell a lot of those.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 23, 2022 5:24 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Okay, in line with Garth's original suggestion, first I tried this:
Attachment:
GlueSnip2.png
GlueSnip2.png [ 12.95 KiB | Viewed 871 times ]

but still needed the resistore

then I tried this:
Attachment:
GlueSnip3.png
GlueSnip3.png [ 12.38 KiB | Viewed 871 times ]

And STILL need the resistor to make it run. It does run perfectly though seems very stable. Off to do some more wire checking


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: