Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LM339 to TTL interface?

Status
Not open for further replies.

ClydeCrashKop

Well-Known Member
Most Helpful Member
I am having trouble getting TTL chips to accurately accept LM339 comparator output, especially at their clock pin. A faster pulse seems to work better. I have used 10K and 1K pull up resistors and the scope pattern looks nice and square 5v 50% but a little bit rounded at the top of the rising edge. Right now I am working with a 74LS74 flip flop. I have had this problem with other TTL chips. Any ideas?
 
The output of the comparator seems to be active low, does that change anything? Can you post your entire schematic?
 
I expected the 10K or 1K pull up resistor on the 339 output pin to give me a good +5v when it is not low. It looks right on the scope and seems to work above about 5Hz but I need the 74LS74 to clock on every pulse even if sent once per minute. I am depending on it to clock on the rising edge like the data sheet promises.
 
You need a pulldown, not a pullup resistor on a TTL output to get a voltage out. Active low, or active high it's just a matter of logic consideration, if it's required, just pass the output through an inverter.
 
Sceadwian said:
You need a pulldown, not a pullup resistor on a TTL output to get a voltage out.
What? TTL outputs are push-pull.
LM339 should drive TTL just fine with a pullup of 10k, up to a few hundred kHz, so long as you have plenty of input overdrive. A 1k pullup will have a faster rise time, but the logic low is not guaranteed to be below the TTL threshold.
 
Do you have a hysteresys (sp) feedback on the LM339? If not, the waveform is probably bouncing when the comparator switches states. It may be bouncing too fast for your scope to detect depending on the scope & probes bandwidth but the TTL chip will pick it up.
 
Sceadwian said:
You need a pulldown, not a pullup resistor on a TTL output to get a voltage out. Active low, or active high it's just a matter of logic consideration, if it's required, just pass the output through an inverter.
The comparator has an open collector output. A pulldown alone will result in the output being always low. If it has both a pullup and a pulldown then I believe that it will go low but it will be unable to go high. In fact it will go to the voltage specified by the voltage divider theorem.
 
I think hysteresis might be the answer. I think digital and I like the 339 because it acts digital so I was treating it like digital. If it looks like a duck, walks like a duck and quacks like a duck I shouldn’t forget that it is an analog chip.
I will try that tomorrow.
Thanks a lot. I really appreciate it.
Clyde
 
ClydeCrashKop said:
I think hysteresis might be the answer. I think digital and I like the 339 because it acts digital so I was treating it like digital. If it looks like a duck, walks like a duck and quacks like a duck I shouldn’t forget that it is an analog chip.
I will try that tomorrow.
Thanks a lot. I really appreciate it.
Clyde
What sort of signals are you applying to the 339?
 
I am just sending ons and offs from photo transistors to the LM339. I realized last night that maybe I don’t need the comparator at all and was just using it because I am a pain in the butt Virgo and wanted a nice square signal.
 
ClydeCrashKop said:
I am just sending ons and offs from photo transistors to the LM339. I realized last night that maybe I don’t need the comparator at all and was just using it because I am a pain in the butt Virgo and wanted a nice square signal.
What is the voltage swing of your phototransistor outputs, and what threshold voltage are you using on the other input of the comparator?
 
Just 0 to 5 volts from the transistors with a 50K pull down resistors to the + input and 2.5 volts to the – from 2 50K resistors as a voltage divider.
 
Without the "snap-action" of hysteresis, your LM339 comparators are amplifying their own noise and any noise picked up by your wiring and the phototransistors when the input of the comparator is near its threshold voltage.
Then your 74LS74 is clocked with each tick of noise and produces an erratic output.
 
I think you are right. I will try that now.
 
A Schmitt trigger can be also be made with discrete parts. You need another transistor that shares the emitter resistor with the first one.
 
The emitter resistor of a 2-transistor Schmitt trigger might create a logic low voltage that is too high to be a valid TTL low.
 
no need to build a discrete ST, just use a feedback resistor on the 339.

also, make sure you bypass the comparator and TTL. if it's real TTL (like you might have gotten in the mail...) they definitely need bypass caps.
 
philba said:
if it's real TTL (like you might have gotten in the mail...)
Is somebody mailing old power-hungry TTL? I gave away all my old TTL about 30 years ago when I discovered Cmos logic.
 
Yes!
We tamed the beast! Hysteresis solved the problem and it clocks every single pulse at any speed without missing a beat.
Philba was nice enough to send me a plethora of TTL chips a few months ago. I have been getting very creative since then.
Thanks guys :D
And thanks again Philba. :)
Clyde
 
Yeah, I'd saved the sweepings from an assembly line at Intel where I worked during the 80s. Long ago, I knew I'd never use them but just couldn't bear to toss them. Glad they are being used!

congrats on the solution.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top