PDA

View Full Version : Bi-directional i/f to 5v logic

Harley
02-12-2007, 08:59 AM
I just realized I can't use the usual single resistor to i/f with a 74LS245 on 5v.

I've looked through the HOW TO SAFELY INTERFACE A 5V SIGNAL TO THE PROPELLER? forum. Wow, Beau's approach uses 2 transistors and 4 resistors per line. http://forums.parallax.com/images/smilies/cry.gif http://forums.parallax.com/images/smilies/shocked.gif For a 8-bit i/f this is horribly bulky (16 Qs and 32 Rs)!!

Is there no other way?

To me it appears the 'culprit' is driving the -245 input low. One data sheet shows -0.2 ma @ 0.4v on the -245 input for the LO state and 20 ľa @ 2.7v for HI. That LO low input state drive from the Prop means the resistor is fairly low; 2K if the Prop could output 0v at 0.2 ma). Has anyone found a better solution for this tri-state interfacing?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
h.a.s. designn

Forrest
02-12-2007, 09:16 AM
Here's another method that uses a diode and a resistor http://forums.parallax.com/showthread.php?p=622466

Also, I believe other users have mentioned using a 74HC245

Phil Pilgrim (PhiPi)
02-12-2007, 09:19 AM
Harley,

-Phil

Dennis Ferron
02-12-2007, 09:30 AM
I'm using the single-resistor method to interface a Propeller to 74LS245, 74LS374, and a 5 volt static RAM chip all on the same data bus and haven't had a problem. Why are people saying that wouldn't work? Am I missing something here?

Phil Pilgrim (PhiPi)
02-12-2007, 10:00 AM
Dennis,

Harley was concerned about the bidirectional lines. To protect the Propeller when they're outputting, you need a series resistor. But this same resistor limits the drive current available from the Propeller to pull the TTL line low, when it's being used as as an input. While you may indeed have a working system, it's possible that you're operating closer to the margins than Harley is comfortable with. I suggested HCT logic instead, since the input currrent requirements are virtually nil, and the inputs are compatible with TTL voltage levels. By contrast, with HC logic running at 5V, a 3.3V input barely qualifies, if at all, as a "high".

If what you have works, by all means, use it. But next time 'round, you might want to give HCT devices some consideration. For me, at least, they've been the most compatible with 3.3V logic levels when they have to run at 5 volts.

-Phil

Dennis Ferron
02-12-2007, 12:17 PM
Good point. I chose 1K resistors because they were the lowest value recommended for protecting the Prop's input diodes, so I'm operating close to the Prop's limits in order to get the most possible sink current to the TTL inputs. I realize I will also be stressing the current-sourcing limits of the TTL gates, but in that case the current through the resistors is not five volts to ground, it is five volts to 3.3, minus .6 for the diode drop. So I'm not worried too much about it.

Hopefully it all continues to work with the 6502 accessing memory at high speed as well. At least the 6502 is not "seeing" the Propeller current sink directly; it's acting through the transceiver.

I've used HCT before and have no problem with them; I just like to build with LS because it's more "old school". I even buy plain regular TTL over LS when I can find it.

Dennis Ferron
02-12-2007, 12:20 PM
I'll probably get lambasted for suggesting this, but: A real quick and dirty way around the problem is to just run the Propeller at 5 volts! This is totally outside spec and the chip is not designed to work at this voltage, but the Propeller is also so well designed that it can "survive" it. I accidently ran my Propeller at 5 volts instead of 3.3 for several hours without even a software glitch.

David B
02-12-2007, 12:20 PM
I got a 16 bit bidirectional data bus working on the propeller on a breadboard by wiring the 16 propeller lines to the inputs of two 74LS244 buffers, with 16 2.2K resistors connected from the inputs to the outputs of the 244 buffers. The LS244 outputs go to the bidirectional data bus of an IDE hard drive I've been getting running off the propeller.

When the propeller lines are set to be outputs and the 244 tristates are gated on, the Schmidt inputs on the 244s translate the 3.3V propeller to 5V on the 244 outputs (the 244 inputs are supposed to be switching high at about 1.6V, then low at about 1.2V, so the propeller should be switching the 244 with plenty of margin). The 2.2k resistors play no role in this mode.

When the propeller lines are set to inputs and the 244 tristate outputs are set to high-impedance, the external 5V HD logic drives the propeller inputs thru the 2.2k resistors. The 244s play no role in this mode.

The only reason I used 74LS logic was because I had them in the junkbox, and they worked. I don't know any reason why any 5V Schmidt-input 3-state logic, like maybe HCT, would not work with this same configuration, but I haven't tried them.

It seems to work fine. It does take an additional propeller output pin to operate the 244 tristate gates, so it's not ideal, but since it only needs 2 chips and 16 resistors (which can just straddle the chips), it's not too hard to work with.

Harley
02-13-2007, 12:03 AM
Phil Pilgrim said...
Harley,
-Phil

Thanks. Yes, that should simplify that i/f to just the 'series resistor' only scheme. Very good call.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
h.a.s. designn

QuattroRS4
02-13-2007, 12:38 AM
Dennis Ferron said...
I'll probably get lambasted for suggesting this, but: A real quick and dirty way around the problem is to just run the Propeller at 5 volts! This is totally outside spec and the chip is not designed to work at this voltage, but the Propeller is also so well designed that it can "survive" it. I accidently ran my Propeller at 5 volts instead of 3.3 for several hours without even a software glitch.

I say:

No no no no no........
The prop is well designed - Yes. Well tested - Yes. But to knowingly operate it outside its absolutesˇ- I disagree completely. Under your condition @5v it survived - great -ˇI'd be thankful and ensure that I didn't try that one again.

Phils approach is the way here .....

Post Edited (QuattroRS4) : 2/12/2007 5:45:25 PM GMT

Paul Baker
02-13-2007, 02:21 AM
Our Absolute Maximum Voltage for the Propeller (ie operate beyond this and you may damage the chip) is 4V, while your Propeller may be able to tolerate 5V, this is dependent on what you are doing with it (number of cogs running, how fast they execute, etc etc) and some Propellers may not be as robust as others due to natural variations in the fabrication process. So operate the Propeller at 5V at your own risk.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)