Electronics > Beginners
Best way to drive a 5V TTL line with a 3v3 GPIO?
nick_d:
The problem with the 74LVC4245 would be that the DIR and /OE pins are ganged to all 8 of the transceivers. So if you already have it set up in the direction that the 3.3V side is an input and the 5V side is an output, and you're either going to keep it set up this way permanently, or else you can live with the /RESET only being driven at particular times, then of course you can use it drive /RESET (it need not be open collector). On the other hand, under these restrictive conditions you'd be better advised to swap out the 74LVC4245 for a simpler, one-way device anyway.
You mentioned that you have a 74HCT AND gate, if this is already present for some other reason, and is powered from 5V and you have spare gate(s) on it, then definitely it would be the preferred solution. Since its input threshold is about 1.2V, this will be approximately halfway between 0V and 3.3V, giving you fairly good noise immunity. It has been stated earlier that having a 75HCT input at 3.3V for extended periods of time might increase current draw. I don't think that's a problem. It will be more than 2V above threshold, so the gate won't be even partially on.
If you don't have the 74HCT AND gate available, and you don't want to add an extra package just for this, you still have some options. The transistor is a good option, you could use a 2N7002 FET, which would require zero extra components since you only want open-collector operation. The 3.3V might be a bit marginal to turn on the 2N7002, check the datasheet, but I think it would turn it on ENOUGH at any rate.
Another option would be simply to connect the 3.3V output directly to the 5V /RESET input. This might be slightly risky, but I believe it would work. When you're at 3.3V you'd be 0.8V above the nominal 2.5V threshold of the /RESET input. Although, you had better check if /RESET is a Schmitt trigger input. Often it is, so you can connect an RC network to it, instead of using a reset generator. This has a slow rise time requiring the Schmitt. If the /RESET input is Schmitt, then the high-going threshold might be around 3.3V which would be too marginal, so you'd need the HCT solution or the FET. Mind you, your actual "high" output would likely be 3.3V plus a diode drop, which may be just OK -- see next paragraph.
The risk you would have with the 3.3V driving the /RESET directly is that the /RESET is pulled up internally. So what would happen is either you'd have /RESET pulled low by your 3.3V device and all would be well. Or you'd have /RESET floating or pulled high (would not matter which) and the actual voltage on /RESET would be 3.3V plus a diode drop. Because the protection diode on your 3.3V /RESET output would prevent the voltage getting more than a diode drop above 3.3V, whereas the internal pull-up on /RESET in your 5V device would supply a trickle of current trying to make this happen. Since the internal pull-up would be about 50K in most 5V devices, this would not damage your 3.3V device at all.
A minor problem with this setup is that it will be difficult to power off the 3.3V device, since the 5V circuit will be trying to power it up through the /RESET output. If you weren't planning to power off the 3.3V device, then it could be OK. Anyway, it may be bad practice, even if it works.
cheers, Nick
Cervisia:
--- Quote from: nick_d on December 18, 2018, 12:44:28 am ---It has been stated earlier that having a 75HCT input at 3.3V for extended periods of time might increase current draw. I don't think that's a problem. It will be more than 2V above threshold, so the gate won't be even partially on.
--- End quote ---
TTL-compatible inputs are designed to handle a high level of about 3.5 V, but there is no guarantee that there are no cross currents. TI says:
--- Quote ---
In normal operation of a CMOS device, the effect previously described is not relevant, because the high and low logic levels supplied by the outputs of another CMOS device always ensure that the transistor in question turns off. However, if such devices are, for example, controlled by bipolar circuits, results are different. With a high logic level at the output, these supply a voltage that can only be >2.4 V. TTL-compatible CMOS devices, such as those from the SN74AHCT series, recognize such a level as being a high logic state. However, for previously stated reasons, under these conditions a supply current flows in the input stage (see Figure 6), which is significant, particularly with battery-operated equipment. To give system designers specific information about these phenomena, TTL-compatible CMOS-device data sheets have values for the ∆ICC parameter (see Table 1). ∆ICC specifies how much the supply current increases when the high logic level that is typically supplied by a TTL device is applied to one of its inputs. Data sheets show a considerably higher value than that given in Figure 6, but Figure 6 shows only the typical behavior of an AHC or AHCT device. As a result of process and parameter variations and to account for the worst case, values in the data sheets must be used.
--- End quote ---
nick_d:
--- Quote ---TTL-compatible inputs are designed to handle a high level of about 3.5 V, but there is no guarantee that there are no cross currents. TI says:
--- End quote ---
That is interesting. Thanks for the research. I didn't know that. I assumed that being 2V above the reduced threshold of a 74HCT device would have similar power consumption to being 2V above the normal threshold of a 74HC device, i.e. it would be fine, but I see now that that's not the case.
Having said that, bear in mind that 74A** devices are much more aggressive in this regard than 74HC devices. According to an NXP datasheet for a 74HCT00 device that I just looked at, the delta-Icc is only expected to be about 160uA at 25 deg C, it does increase significantly with temperature though. Interestingly there's no data for 74HC.
cheers, Nick
nockieboy:
--- Quote from: nick_d on December 18, 2018, 12:44:28 am ---The problem with the 74LVC4245 would be that the DIR and /OE pins are ganged to all 8 of the transceivers. So if you already have it set up in the direction that the 3.3V side is an input and the 5V side is an output, and you're either going to keep it set up this way permanently, or else you can live with the /RESET only being driven at particular times, then of course you can use it drive /RESET (it need not be open collector).
--- End quote ---
I actually have two 4245's - one permanently configured for input to the ESP32, the other for output to the relevant 5V devices it connects to. If I can drive /RESET, /INT and /IEO from these then that is preferable as it means I'm using the entire chip and can free up the inverters for some blinkenlights.
--- Quote from: nick_d on December 18, 2018, 12:44:28 am ---On the other hand, under these restrictive conditions you'd be better advised to swap out the 74LVC4245 for a simpler, one-way device anyway.
--- End quote ---
Oh okay - if there's a more appropriate (read: cheaper) device I can use, I'm all ears. This is a hobby project and I'm (at best) at hobby electronics level, so I'd appreciate any suggestions for suitable replacements. My system for finding parts to solve a problem are shaky - I tend to Google for solutions, hence how I ended up with 4245's.
--- Quote from: nick_d on December 18, 2018, 12:44:28 am ---You mentioned that you have a 74HCT AND gate, if this is already present for some other reason, and is powered from 5V and you have spare gate(s) on it, then definitely it would be the preferred solution.
--- End quote ---
I did have... All the gates are now used in glue logic for the WAIT generator and data buffer enable. I have got three spare inverters in a 74HCT04 though, but if I can use the remaining 4245 pins (or whatever replacement for it I find), then that frees up the inverters to drive a couple of LEDs, which I could do with.
I'm on a budget with this design - to a lesser degree, cost and PCB space (it has to fit an existing form factor) but most critically, pin count - I've reached the 500-pin maximum that my copy of DipTrace allows on its user licence. Whilst I'm in the process of familiarising myself with KiCAD, I haven't gotten any further than designing schematics on it - I know there's plenty of tutorials etc, but I don't want to have to invest hours of work learning how to design a specific PCB shape, size and component placement to meet the form factor I'm designing to for the sake of half a dozen pins, if that makes sense? I'd kick DipTrace into touch completely if it weren't for the fact I find it far more user-friendly than KiCAD, but that's a conversation for another post.
--- Quote from: nick_d on December 18, 2018, 12:44:28 am ---Another option would be simply to connect the 3.3V output directly to the 5V /RESET input. This might be slightly risky, but I believe it would work.
--- End quote ---
I originally went down the route of a transistor pulling /RESET low when switched on because there's a number of other devices on the /RESET line - not sure that would make any difference to be honest, as there's still only one 4K7 pull-up, but I felt the need for something with some chops actively pulling the line low and connecting a 5V line directly to a 3v3 GPIO pin violated some subconscious sensibilities... :o ;)
--- Quote from: nick_d on December 18, 2018, 12:44:28 am ---The risk you would have with the 3.3V driving the /RESET directly is that the /RESET is pulled up internally.
--- End quote ---
Is it? I have an external pull-up on the /RESET line, didn't know it had an internal pull-up? Have just checked the datasheet and can find no mention of one either. It's a Z84C0008, if that matters?
--- Quote from: nick_d on December 18, 2018, 09:02:29 am ---
--- Quote ---TTL-compatible inputs are designed to handle a high level of about 3.5 V, but there is no guarantee that there are no cross currents. TI says:
--- End quote ---
That is interesting. Thanks for the research. I didn't know that. I assumed that being 2V above the reduced threshold of a 74HCT device would have similar power consumption to being 2V above the normal threshold of a 74HC device, i.e. it would be fine, but I see now that that's not the case.
Having said that, bear in mind that 74A** devices are much more aggressive in this regard than 74HC devices. According to an NXP datasheet for a 74HCT00 device that I just looked at, the delta-Icc is only expected to be about 160uA at 25 deg C, it does increase significantly with temperature though. Interestingly there's no data for 74HC.
cheers, Nick
--- End quote ---
Thanks Cervisia - though I'm not sure I can read the implications as well as Nick has done?
I'm using 74HCT parts almost exclusively for the glue logic, with the exception of a 74F part in the /WAIT generator, but this is interfaced via a 4245 to the ESP32.
Cervisia:
--- Quote from: nick_d on December 18, 2018, 09:02:29 am ---According to an NXP datasheet for a 74HCT00 device that I just looked at, the delta-Icc is only expected to be about 160uA at 25 deg C
--- End quote ---
That 150 µA is a typical value. In the chart above, AHCT might be even lower at 2.9 V. But the worst-case maximum is indeed higher.
Anyway, even the worst-case *HCT cross currents are lower than what TTL devices would use during normal operation. ^-^
--- Quote ---74A** devices are much more aggressive in this regard than 74HC devices.
--- End quote ---
Please note that AC and AHC are quite different families: AC is as fast as possible, while AHC has deliberately weak output drivers to prevent the switching noise from being higher than HC.
--- Quote ---Interestingly there's no data for 74HC.
--- End quote ---
HC is not meant to be driven by TTL-level signals.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version