EEVblog
Вставка
- Опубліковано 15 вер 2024
- Fundamentals Friday
Dave answers a beginner forum question of why their 74HC390 based breadboard counter circuit does not work properly.
Let's get up to our armpits in datasheets and troubleshooting.
A two sentence forum response turned into a step-by-step 27min video investigation involving rise and fall times, setup and hold times, metatability, optocouplers, bypassing, open collectors, and breadboard connector traps for young players.
Power your chips through power pins: • EEVblog #831 - Power A...
Schmitt Trigger Tutorial: • EEVblog #941 - Schmitt...
Forum: www.eevblog.com...
#CircuitDesign #Analysis #Debugging
Bitcoin Donations: 38y7DE8HEHNj8fGDtUr4PkCn9nWxiorvvy
Litecoin: ML7oQokTwB38bgzzjLDbRV97HKAHuwRfHA
Ethereum: 0x11AceA38DCA9DbFfB4F35f3F746af65F9dED28ce
EEVblog Main Web Site: www.eevblog.com
The 2nd EEVblog Channel: / eevblog2
Support the EEVblog through Patreon!
/ eevblog
AliExpress Affiliate: s.click.aliexpr...
Buy anything through that link and Dave gets a commission at no cost to you.
Stuff I recommend:
kit.com/EEVblog/
Donate With Bitcoin & Other Crypto Currencies!
www.eevblog.co...
T-Shirts: teespring.com/s...
Likecoin - Coins for Likes: likecoin.pro/@...
This video is why I genuinely hope your next beginner project FAILS. Because there is so much to be learned from troublehshooting problems like this.
Failed projects have taught me more than most of the books I have read. There's nothing like having that "perfect" circuit, only to apply power and either get nothing, or magic smoke :)
I miss the Friday videos, fundamental videos
can i use a 555 as a schmitt trigger
Experience is what happens when things don't turn out as you expect! :)
I have learned more by getting out of my comfort zone and failing than I ever did by getting walked through a lab syllabus. Half the battle is researching and learning how you accomplish the project, and the other half is fixing your own mistakes.
btw. since you mentioned the forum, i myst say that the EEVblog is one of best community forums in electronics that i know. So many times i got great tips and helps. Thank you all guys!
Indeed. There are many that have left other forums and come over.
@@EEVblog did you think of making slack# chat for eevblog or something like that?
Not slack, but have tried several chat system over the years, they just degenerate into vitriol. There is an IRC channel though with a bunch of core users.
@@EEVblog current forum software does all we expect, however, as everything is changing in the world, some refreshments would be nice. And maybe also attractive for younger, new users.
Badcaps.net forum is good too.
"I couldn't give a schmitt about the slew rate."
I'll pay that
Schmitt trigger output optos! They're honestly the only kind I use for digital stuff these days.
Currently working on a design that uses these 390 counters, and yes I've had this same problem when driving it with signals from an Opto-coupler. Once I put Schmitt trigger gate in front of the 390, it all works fine now!
Dave please do a video on how to use MOSFETs properly. I always get in to trouble in my projects because MOSFETs do not switch on property. Specialy on high side switching with n channel MOSFETs.
Read online
You most likely arent using a resistor on the gate.
Add a 1k to the gate if you dont have one.
You cannot simply use N transistor as high side switch.
To use an NMOS as a high side switch, the gate voltage needs to be above source voltage by the Vgs specified in the datasheet for the current/Rds(on) you wish to achieve.
I’ve used the 74HCT390 in several projects. But I always fed it with totem pole BJT’s drivers, and never had any issues with them counting reliably. I guess I’ve been darn lucky. I love the Schmitt trigger idea and might use it in the next project. Thanks Dave!!
Yup, I've experienced all the problems Dave mentioned: Glue on the resistor leads (I now ALWAYS cut my resistors off the tape) and slow rise time/fall time without a Schmitt Trigger is always a bit "how ya doin". Also violating the setup and hold times between a data line and a clock will yield all kinds of random problems. Gotta pay attention to all this stuff to get it to work right!
Many tjanks for all you do mate.
Love watching and learning.
Hate forgetting again, but I can always rewatch!
Love it. Keepem coming!!!!!
Chri from Lancaster, ENGLAND!!!
Dave, as always loved your video. You bring up some awesome points. I could be wrong, but I think in this particular case the 74390 is doing exactly what it's being asked to do. If the desired result is a true divide by 10 decade output then they are using the wrong configuration. If you go to the logic diagram of the data sheet it has a footnote that shows two diagrams, one with Qd tied to Ia and one with Qa tied to Ib. For a divide by 10. The first stage must always be the divide by 5, which then feeds the divide by 2 to clean up the signal. I think that is the issue with the logic output being displayed, its hooked up backwards. Which is valid, but does not yield a nice clean divide by 10 logic output.
It will be divide-by-ten either way. It's just in one configuration, with the divide-by-two second, you get a square output (ie: duty cycle of 50%), whereas in the opposite order you do not.
@@jim9930 How does a 393 solve either the rise/fall time problem which is the topic of the video, or Rob's issue of this not being "true divide by 10", (which I inferred meant Rob would want a duty-cycle 50% output)?
@@Graham_Wideman you are absolutely correct. Assuming that the output wave for the first tap is Q0, you would at least expect at x/2 signal rather than a 1:1 inverted signal, which is what it looks like we're seeing.
@@RobTaylor-HiTech Right.That's the topic of the video -- why is it doing that. Not because the divide-by-2 and 5 stages are connected in a particular order, but because of slow rise/fall time at the clock input, possibly permitting undue sensitivity to the downstream transitions.
@@jim9930 So, in short, a 393 doesn't address either of the problems addressed here, and can't even divide by 5 (or 10) without additional gates. And noting your twice-mentioned concern with speed, the 393 is still a ripple counter, so doesn't solve that either. And I'm hard pressed to see how your other statements have any bearing on the current topics. Even your possibly sensible comment about employing '14 as an inverter just so as to have spare schmidt inputs around is made dubious by suggesting AC14; AC is a much faster logic family with higher switching transients, requiring more attention to supply bypassing, and thus less suited to breadboard than HC. Young fella.
I'd like to see a video about logic thresholds, setup and hold time, and metastability, etc.
@@jim9930 I agree. I learned all about it in college, and continued reading about it for years. However, I'm still entertained hearing someone else teach it, and I always learn a new way to look at something.
In fact what Dave said is true as I faced a similar issue when designing my motion sensor using a digital pir sensor with a retriggerable monostable multivibrator and ended up going with 74hct123 as it has Schmitt-trigger inputs so that saves the hassle of adding a extra chip
I like that the user's name that posted before you on the forum is schmitt trigger
This is a very interesting kind of video. We (I and others below) want more of this debugging, troubleshooting "basic" component stuff, Dave :D
Loved this video. Was just mesmerized listening to it :) . Please do more such training videos, we can learn a lot from you.
Please do more of this type of content.
Do more of this Dave, this is amazing
THANK YOU DAVE!!!! For apologising about the audio! I have literally moved and just this arvo set up p.c. speakers which of course involved cutting some audio input leads and twisting shit up as a temporary measure. I was just about to jump up and start throwing my toys around as the apology came up on screen!!!
We ALL know where that could have ended :P
Awesome video! I once was struggling with a circuit and asked a 3rd year EE student if he'd help me. He replied "it's all in the data sheets" which I though at the time was an arrogant thing to say. In reality it was, as that's all he had to say to a hobbyist with no scope and no access to the intarwebs at the time. He was right though.
A lot of tech there but an excellent example of analysis. Thanks Dave
Come a gutser is my new favorite phrase.
I love following Dave's logic. Quite phenomenal.
*keeps trying to scroll in Dave's browser*
Hahaha I thought it was just me!
Would be a cool feature if you could. So many times i have wanted to and attempted to scroll
Yeah I keep moving my head to see around the edge of screen
Had this issue on my diy TTL computer. Turned out the pack of caps I got had a really large value and it happened to be decoupling the clock. DOH!!!
Dave, thank you! I love these sort of videos. Some theory, some breadboarding, BAM! Problem solved!
Thanks, Dave. Very informative, indeed.
(10:00) For an open collector output going high the saturation is absolutely critical for the transition time.
The LOW to HIGH transition of a BJT will happen at about 1 to 10 Volts per microsecond and volt of supply at best. There will also be a dead time of 100 to 500 ns before the BJT starts to transition.
I believe it is incorrect to refer to this as a metastability problem as this occurs when you have a clock and a data input to a flip-flop changing approximately simultaneously. Since it is only the clock input to the flip-flop is changing here there should be no opportunity for the classic metastability problem to occur.
It is more likely that we have a multiple clocking issue here - as the slow clock signal transitions through the threshold window of the clock input any noise on the clock signal can be seen as multiple clock transitions and the counter can increment several times for each apparent clock pulse input. Noise on the clock signal could be coupled across from a changing output through the relatively high stray capacitances inherent in breadboards. Even if the slow clock signal is quite clean and there is no coupling from stray capacitances you can get a similar effect from noise on the supply rails modifying the effective threshold voltage of the input stage of the counter so it is still essential to have good supply bypassing even for slow clock rates.
21:33 Yes, pull-up resistors do significantly affect rise and fall times in an I2C bus (and other open-drain/collector configs). We usually test such timing parameters with a data generator. There's also the nuance of shorting the data generator's output to ground when the driver goes 'low' and the output is set to 'high' (when we're expecting an ACK response from the D.U.T.) so they come equipped with inhibit features.
This was a great video, following your problem solving thought process is priceless, and something that can be taught in a class room! More like this! And, if I can request a video, one about how you safely probe/measure mains powered devices. I'm always paranoid about it, and would love some good tips!
Yes -- then at least the current won't go between your hands across your chest/heart.
Rubber-soled shoes can help with that too -- i.e. so if you do brush something live:
A. don't(!)
B. try not to give the current a good path out(through) your body, especially via any organs you really care a lot about.
the phone vibe at 2:58 got me good
As you state in a written addition note, the opto input drive has its effect and needs to be checked. It even is a known trick that a speed-up capacitor has been added over any input resistor.
I frequently have these problems, and usually discover it's an interface issue between my brain and reality.
Brilliant
I wish you'd posted this a couple weeks ago, I was having this same issue in a class and I wasn't able to figure it out
I find bread boards can cause many head aches with signals especially with clock feed through and cross talk . So I now tend to use a PSOC for glue logic. And if you I just want to test a simple concept.
Make sure the ground are not looped like a rat's nest. Keep them to a common point. Keep wires short twist cables use ferrite beeds.
When in doubt, vary the signal frequency to see if you are on the "edge" of the slew rate limitations. Even a low end ARB is invaluable in these situations...
I am sure you are right about the other side of the IC (independent of the side being used)... I had issue with SN74LVC1G74 when PRE and CLR (both active low) were NOT connected (to VCC in my case cause I was not using them). The datasheet does not explicitly say anything about PRE but says CLR needs to be connected to VCC if not being used. Example circuit shows PRE connected to VCC. One should always look at the database even though the database may not be correct :/... I used a TI part (TXS0102 - pins were not shown correctly), rest of the board was unusable because of this. I finally figured it out and sent them what the problem was. They updated the datasheet. Too bad, I cannot even use these boards for paper weight :(... PLEASE, always report the problems you find as this will help others!!! (unless you are a competitor hihi)
As a German I love hearing you say "Schmitt-Trigger" ;)
SN74HC14N I love this 14 pin gem i use a lot of opto's and the SN74HC14N has saved me many times
A larger maximum slew time can also be guessed at by taking the minimum propagation delay of any input signal to output. So one number I see is 17nS .You do not want the input slew to even be this slow since the number would be where it could use an output as a feedback signal.
Way back in high school there was a project to make a trolley that ran along a rope and dropped a bean bag at a specified point. We could use whatever skills we had, so I built a counter with a 4017 (decade counter with decoded outputs) and a reed switch and magnet on the pulley. It never worked right. I'm pretty sure I didn't have any pull-down on the input, just the reed switch tied to Vcc. It worked when I tested it slowly, but not when it was moving quickly when I took it to class. D'oh!
Never assume what you think is supposed to be happening is what is actually happening - make sure to actually check. Going just by what you think you know for sure invariably bites you in the ass. Any pin could have a bad connection, so measure the voltage on the ones that are supposed to be connected to a fixed voltage, directly on the IC's pins, and make sure to measure "0V" pins relative to "Vcc" so you actually see they're "Vcc volts" below it, not just reading "zero volts" relative to the ground while they might still be completely disconnected. Try powering your rig from a few batteries - this used to be a non-issue when everything was behind a 7805 linear regulator in the past and nobody had switching supplies, but these days it's the other way around and you never know how bad a ripple there could be, and what it could do to an insufficiently filtered logic IC; throwing some batteries at it is the fastest way to eliminate the possibility, instead of fumbling with how much filtering is enough and how low a ripple should be harmless. And yes, if it's none of these it could also be the clearly problematic clock slew rate.
that was great! you should do more of this kind!
More please.
TLDR: put an inverting schmitt trigger buffer after the optocoupler ? :)
Dave, this would be a neat topic! You could have rebuilt it locally and tested it with scope etc.
I hope a video about how choosing your pcb manufacturer for mass production product Thx and good job :)
Super 👍
I would start at the opto, almost certainly the problem. Not only is the slew rate of the output questionable, if the AC signal driving the opto has a low slew rate it could add to the problem.
The sticky resistors from the tray are really anoying but scrapping glue with xacto knife works good as well .
21:30 Dave the Picasso of EE. If only it was worth mega millions.
Only when I'm dead
@@EEVblog Watch out for the missus taking out a new life insurance policy.
Remember "Bobs your uncle" Well at my local club one day my buddy Dave said in passing "Bobs your uncle" and I just lost it out loud. "So what is wrong with you" he said and I had to explain. Much fun, Dave in Va.
But the datasheet of the HPLC3700 states clearly on the first page under "Feature": "Logic Level Compatibility" ;-) And still on the first page under "Description": "The output is TTL and CMOS compatible." :-) Though, that's kind of a bold claim with an open collector output :-))
Don't you need to invert the output of /2 before feeding it to the /5 in order for both to trigger on the "same" falling edge?
Lots of nice tips. The glue on resistor leads thing isn't a joke. Actually screwed me up once. Noticed that the optocoupler data sheet says "A 0.1μF bypass capacitor must be connected between pins 8 and 5" (aka Vcc and GND). Doesn't appear to be one on the breadboard.
Googling the HP3700 produces the original date sheet dated ©2005 Fairchild Semiconductor Corporation, which might explain the poor output specs, and that was Rev. 1.0.3 so there may have been even earlier versions?
Use a CD4017 (Texas In). It has a schmitt trigger input and count up ot 10
what about increasing the pull up resistor value
Could you just put n-ch mosfet between optocoupler and divider? Mosfets switch decently fast.
Decoded the phone interference. Said "Dave, please do more videos like these"
Weird, that's what I was going to write.
The oscillations are visible on input 3 (the magenta one) as extremely thin spikes. This line seems to have gone positive, as and when desired, but then immediately back to negative, indicating that it assumed two clock pulses when only one was present. It seems like the Schmitt trigger would sort this out, as Dave suggested.
Didn't notice that, I don't usually edit in a full HD window so often miss fine detail
@@EEVblog Had you not suggested that this was a likely case, I wouldn't have looked so closely. It's only 'half a bee's dick' on my screen, if that.
It's quite possible that the positive edges of the signals that transition at the time of the thin spikes that you noticed are coupling back to the clock input that is s-l-o-w-l-y transitioning high-to-low, sending it briefly back across the L-to-H threshold, setting up a second increment of the counter.
#easylab4kidslearnt a lot about chips, Schmidt triggers from watching Dave' vids.
I have question, i have applied to join the forum and I was told I would receive an email to confirm, this was 4 days ago and I am patient but I am thinking it may be a problem
It doesn't work because it is upside down! - 0:59 ;-)
But seriously, help the people you are asking for help from a little by making sure your posts are as readable as possible (clear and right side up). _Then_ add a bunch of bypass caps as that's likely to be many people's first guess (mine).
And looking at the posted scope view you can see the glitches on channel 3 where there is a very short high pulse that isn't _latching in_ like the rest of the pulses on that channel. The OP needs to notice this and zoom in to see and show what is happening there.
And why put a 270 ohm resistor in series going to the counter? That's not exactly going to speed up the transitions.
You're damn right! Even if the chip remains stable, that slow input is triggering an extra pulse.
@@userPrehistoricman - Well something is happening there and it isn't consistent. Could be any odd (1, 3, 5) number of extra pulses that shouldn't be there. But in the end you need to see and not ignore those glitches that your scope is showing you. Zoom in as those glitches are likely very short (in the ns to us ranges) but at least the scope is showing them even at 50ms/div. Also, notice that they are right on the edges of the other signals. You can't just ignore those because they are "short".
Obviously. The scope's timebase is actually very slow.
I would Take out the 270 Ohm(??) resistor if that is 2,7k or even 27k that would explain the "soft" rise and fall time, why drive the capasistance of the breadboard and input of the 74 counter ic, with a 270 ohm resistor, I can't really see why you need a resistor in series with the output of the optocoupler..
@@jim9930 OP isn't talking about the pullup resistor, but the useless resistor connected between opto output and counter input. It will worsen specially problematic t_f a lot.
I now want to enter the German clubbing scene just to be able to call myself "DJ Schmittrigga" for no particular reason.
My eyes are not good enough to read the scope dispaly so I can't comment on clock glitching. However when the device is used as shown the output is not going to be a square wave. To get a square wave you need to divide by 5 then divide by 2.
Yup, that’s a well-known trap for young players. Not an issue if you’re single edge sensitive and need only to divide the frequency of the input, but otherwise it might be a pain.
Dave, tks for the lesson! Like it just like your tutorion on removing ripples in power supply.
I hope to learn about the various digital to analog converter configurations if you cud go thru.
I hope to learn about if one dac chip cud replace another one with better spec, if the connection of various pins are correct. Also how to configure the various inputs for SD cards, spdif, optical etc. I just can't get it from the internet...
Tks!
Very informative ... hope you find out what’s wrong with the mic too :D
Stupid me put the phone near the mic cable
4:45 the glue acts as a resistance multiplier ;)
What is the rule of thumb multiplier value?
cutting off one nanometer of the ends will divide the multiplier by 10 starting with 1 million perhaps :)
It's certainly an annoyance multiplier!
Its almost always signal integrity these days. Wasn't a problem with the old 74xx parts. I spend 95% of my time working on predicting signal integrity issues instead of functionality, kind of annoying.
21:03 that is a very beautiful wall *cough* I mean falling edge. just make sure that the electrons pay for it!
At around 3:00 you hear a nasty noise and a "pling". That noise is 3G/4G data getting into the microphone circuit. Whenever you record something make sure the phone is far away enough
I was cleaning the speaker grille on my phone with a sewing needle at that moment and thought at first I had gone too deep. Whew
Did you feel the earthquake in Papua its 5-6-2019 here in Murika.
ive come a guts-er from the adhesive on the resistor leads... ripped the whole breadboard down and rebuilt it twice before i realized what was going on :/
It's nasty stuff!
Sounds about right.
UA-cam put your message in the Spam folder!
EEVblog - really... how odd.
@@TheDefpom Yup, why can't they check the validity of the channel before marking it spam? Obviously a reputable channel is almost certainly not going to be spamming.
EEVblog - Because that would be a sensible thing to do, I’m not convinced sensible and UA-cam belong in the same sentence sometimes.
Wow! No wonder why half my home-brew electronics don;t work.
Moral of the story:read the data sheet…CAREFULLY.
20:57 That's very lewd, Dave. You have a dirty mind.
uselessly slow optocouplers....gets me every time
I know why it wouldn't work, it's upside down so all the electrons have fallen out!
Hearing a lot of "static" in this video. Several spots. ie. 11:50
I comment that in an overlay, I had my phone near the microphone cable
@@EEVblog - Ya, I saw your comment just after posting. I normally wait until the end of a video to comment but I wanted to write down the exact time of at least one of static bursts as I had heard several up to that point.
Interesting how your phone has that effect on the mic cable. Wonder if it is wifi data or cellular data. Hmm...
@@ElmerFuddGun I've done a whole video on that: ua-cam.com/video/bKQ4yaTlsIA/v-deo.html
@@EEVblog - Oh that's an oldy! Thanks for looking that up... I'll watch it now.
I wouldn´t even schmitt trigger you... with a lot of pressure, I might compare you with hysteresis. But maybe there´s not enough beer on the breadboard for that.... X-D
I thought it was my own phone messing with the audion before the text popped up. Damn poorly shielded audio electronics.
Garbage in, garbage out.
All this stuff is cool n all Dave, but I think he just asked why it didn't work LoL
Bad hair day Dave ???? ;-)
Half a pufftinth.
Dave, why do you keep hoarding all that equipment, parts, modules, tools, when you are hardly using them.
No comments,jet?!? and below 100 views :) better be quick posting this :)
Huh? There are comments from 10-12 hours ago.
@@ElmerFuddGun patreons are always first ;)
Please! in the furure note the time code of the moral of the story of your video in the description so i don't have to watch ~28m of video for a _probably_ valuable hint.
There are many valuable hints throughout the video. I suspect the video format may not be your thing.
Juergen, moral of the story is don't be a bludger :P
@@alakani I'm not a bludger (had to look up that word anyways). I just want information. Not 26m of blathering for a hint. If that will go on, and that is the general direction of this channel, I will simply unsubscribe. Maybe this comment will have an effect. If not, I'm not in any way pissed. Just not my content then. Watched this channel since years. Bit now I seem to get fed up. Too much blabla, too little information.
Would you like me to write you a written summary of the 20+ definitely valuable hints that I got out of this video? I can include application notes or just the executive summary, let me know. If you let me know what kind of projects you work on, I can tailor the hints to your needs. I assume you're not going to be paying for it and want it done yesterday, yes? No problem, I got you fam.
@@juergenherrmann949 This has been what my channel is like for 10 years now!
In case you don't get it, I basically explain what's going on here in the description. The "answer" is two sentences in my forum post, but I turned this into a 27 minute step-by-step journey looking at tracking down the problem. Why? Because there is a lot to learn in the process of tracking down an issue.
You don't have to like that or agree and that's fine, but this is what my channel has always been about, so I suggest you unsubscribe, honestly.