| Electronics > Beginners |
| Best way to drive a 5V TTL line with a 3v3 GPIO? |
| (1/6) > >> |
| nockieboy:
Hi, I'm working on an ESP32<->Z80 interface to IoT-enable the Z80 device. One of the issues I'm trying to resolve is the fact the ESP32 is a 3.3v device and the Z80 is 5v, causing a few contentions. This question, however, is specifically how best to drive several of the Z80's lines from the 3v3 GPIO pins on the ESP32. I need to be able to pull INT and RESET low according to the ESP32's desires. I also need to drive IEO, which should either be at 5V or 0V depending on what the ESP32 is doing. I have read comments previously about using a transistor (or pair of transistors to prevent the signal being inverted) to interface the 3v3 line with the 5v line, but that this may cause a lot of current draw through the GPIO. I have to admit I am not nearly knowledgeable enough in electronics to know why, or what issues this may cause, but it sounds bad. I have a rudimentary setup using a 2N3904 transistor to (I think) pull the relevant line low when the GPIO goes high (see below), but I'd appreciate the thoughts of people with far more experience in electronics than I'll ever have on this subject. I have three spare pins on a 74LVC4245AD which I could use, but would it be able to pull the lines low? Do I need some sort of open-collector setup to do that? The INT and RESET lines have 4K7 pullups. IEO may be connected to a maximum of one other device and, as its name suggests, it forms part of an interrupt daisy chain. Any thoughts or advice would be gratefully received. |
| perieanuo:
hi, the current trend is mosfet level converters imho like one attached |
| Cervisia:
Please note that "5V TTL" is not the same as "5V CMOS". TTL devices used only NPN transistors, which resulted in an output circuit that cannot drive higher than about 3.5 V, so TTL inputs were designed to accept anything above 2 V as high. This means that you can drive the Z80's TTL inputs directly from the ESP's 3.3 V CMOS outputs. |
| Zero999:
--- Quote from: Cervisia on December 17, 2018, 10:58:35 am ---Please note that "5V TTL" is not the same as "5V CMOS". TTL devices used only NPN transistors, which resulted in an output circuit that cannot drive higher than about 3.5 V, so TTL inputs were designed to accept anything above 2 V as high. This means that you can drive a TTL input directly from a 3.3 V CMOS output (such as the ESP's). --- End quote --- Yes, if it's TTL, it will work directly from a 3.3V CMOS output. If it's 5V CMOS, then use a 74HCT IC such as the 74HCT14, which can accept 3.3V inputs and shift it to 5V. https://assets.nexperia.com/documents/data-sheet/74HC_HCT14.pdf |
| mrpackethead:
Using HCT logic is a useful thing to do to go from 3.3 -> 5V. |
| Navigation |
| Message Index |
| Next page |