-2
\$\begingroup\$

Is there a way to have bidirectional ttl logic levels to cmos logic levels conversion in a unique IC. Because right know im trying to create a z80 computer but using a avr as a peripheral as serial port, spi, screen ..., but the z80 considers logic true to be from 2.0V (usually outputs 2.4V) and avr considers logic true to be approximately 4V. My idea was using a CD4504B for the ttl to cmos, but then should I add a tri state buffer between it and the avr?

\$\endgroup\$
  • \$\begingroup\$ The name is "level shifter". \$\endgroup\$ – Eugene Sh. Jan 8 '18 at 20:49
  • \$\begingroup\$ thanks, but could you give an example? \$\endgroup\$ – Thomas Jan 8 '18 at 20:53
  • 2
    \$\begingroup\$ Googling "bidirectional level shifter" will give you plenty of these. \$\endgroup\$ – Eugene Sh. Jan 8 '18 at 20:59
1
\$\begingroup\$

If both are running off 5V then all you need is a 2.2k pullup resistor to 5V or similar.

TTL threshold is 1.5V with safe levels defined by <0.8 and >2.0V while CMOS is Vss/2 with safe levels defined by <1/4 to >3/4 Vss roughly.

\$\endgroup\$
1
\$\begingroup\$

You're in the ballpark. The key issue is "bidirectional" - you haven't explained HOW the direction is chosen.

For example, an SPI bus typically has 3 lines in one direction (MOSI,CLK,CS) and 1 line in the other direction (MISO). It provide bidirectional communication, but none of the lines are bidirectional. So you could use one CD4504B in the low-to-high direction and one in the high-to-low direction.

If, instead, you're using something like I2C, the actual wires are bidirectional. Then you could use something like the MAX14611 which has open drain outputs.

If you have a wire indicating which direction the data is going, you can use a direction-selectable level shifter such as SN74LVC2T45.

TI has a nice overview of the different types: http://www.ti.com/logic-circuit/voltage-level-translation/overview.html

\$\endgroup\$
  • \$\begingroup\$ The avr is supposed to read the z80 address bus, data bus and some other control pins like IORQ and MREQ and being capable of writing to the address and data buses. \$\endgroup\$ – Thomas Jan 8 '18 at 21:17
  • \$\begingroup\$ You will need to research each of those buses and control pins and figure out how their directions are defined - e.g. is there a read/write line? Are the bidirectional lines open drain or are they tri-stated (high-z) when in "input" mode? \$\endgroup\$ – Selvek Jan 8 '18 at 21:31
  • \$\begingroup\$ yes there is a read/write line, but I just realized that instead of buying so much **** for level shifting I should just buy a cmos Z80 ..., I feel so st**** now XD, Thanks anyways. \$\endgroup\$ – Thomas Jan 8 '18 at 22:07
  • \$\begingroup\$ Yeah I was thinking it should also be possible to get an AVR that runs at a lower voltage. Just comes down to what other interfaces and requirements you've got. Glad you found an easy solution. \$\endgroup\$ – Selvek Jan 8 '18 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.