5v-3v3 bidirectional buffer

For discussing the 65xx hardware itself or electronics projects.
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: 5v-3v3 bidirectional buffer

Post by gfoot »

It's an open-drain interface so you're meant to pull it to your power rail with resistors. Are you seeing the keyboard pulling up to 5V itself? I'd imagine this is harmless, and it'd be fine for you to connect that down to your 3V3 rail with diodes, clamping it at that level - the keyboard's end should be very high impedance so not much current should flow through the diodes.

Edit: It sounds like keyboards may well have their own pull-ups, e.g. about 2K. It is possible that the keyboard also requires the line to reach close to 5V at the bottom of that pull-up resistor. So the diode solution might not be good, you might need more active level conversion, either an open-drain level converting IC or a couple of transistor-inverters, one for each direction, like this: https://www.falstad.com/circuit/circuit ... geCCnlUJAA

In that example the left portion represents what's in the device, and the right is what's in your host; and I've rigged it so that the device and host both periodically pull the signal line low, so you can see that they then both see a good voltage swing at their inputs when the other device does this to the signal line. You can try removing the device's pull-up resistor and see that the circuit works fine whether it has one or not.
Attachments
circuit-20231121-1205.png
Last edited by gfoot on Tue Nov 21, 2023 12:06 pm, edited 2 times in total.
User avatar
AndrewP
Posts: 368
Joined: 30 Aug 2021
Location: South Africa

Re: 5v-3v3 bidirectional buffer

Post by AndrewP »

gfoot wrote:
It's an open-drain interface so you're meant to pull it to your power rail with resistors. Are you seeing the keyboard pulling up to 5V itself?
I can't speak for Neil but I saw both keyboards pulling all the way up to 5V. I didn't use pull up resistors.
PS2 Keyboard.pdf.png
Above is what I want to build. And basically what I have built on a breadboard without the 10KΩ pull-ups on the clock and data lines. I'm not sure the 100Ω current limiting resistors are necessary but if not I'll jumper them with 0Ω resistors.

As a bit of an aside the (poorly named) /CODE PULSE signal goes high only after all the packets for a key-press have been sent (that's why I have two 10KΩs in parallel so I can play with RC timing values if I turn up a keyboard that is very different). That allows me to feed the '595 shift register (not in the schematic) into a '40105 FIFO (also not in the schematic) and that means that I only have to service an interrupt once per key-press. Overkill? Absolutely. Fun? Yes!
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: 5v-3v3 bidirectional buffer

Post by BigEd »

Just to note, some PS/2 keyboards, but not all, can run with 3V3 supply and signalling.
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: 5v-3v3 bidirectional buffer

Post by gfoot »

Yes, I'm not sure how much you can rely on the keyboard being 3V3-tolerant but YMMV. Note I edited my post to include a link to a possible circuit in falstad, using two transistors per signal line, that allows connection to a 3V3 host but still gives good voltage swing at the device regardless of its own pull-up capability.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: 5v-3v3 bidirectional buffer

Post by barnacle »

Hmm. I've seen comments on t'net that suggest they will work on 3v3, but that's almost certainly going to be keyboard dependent :mrgreen:
sburrow
Posts: 833
Joined: 09 Oct 2021
Location: Texas

Re: 5v-3v3 bidirectional buffer

Post by sburrow »

speculatrix wrote:
But all the TXB family are a little limited on power output, I think.
Perhaps this is a newbie-style question but, where would you find that in the datasheet?

Attached is what I see on the datasheet, am I looking in the wrong place?

Thank you!

Chad
Attachments
TXB-mA.png
John West
Posts: 383
Joined: 03 Sep 2002

Re: 5v-3v3 bidirectional buffer

Post by John West »

sburrow wrote:
speculatrix wrote:
But all the TXB family are a little limited on power output, I think.
Perhaps this is a newbie-style question but, where would you find that in the datasheet?

Attached is what I see on the datasheet, am I looking in the wrong place?
Those are the Absolute Maximum Ratings, which are the "don't go over these or you'll break it" limits. You wouldn't get close to them in normal operation (and note (1) makes that explicit: "These are stress ratings only, and functional operation of the device at these or any other conditions beyond those indicated under Section 6.3 is not implied.").

You'd normally find the output current under Electrical Characteristics, but I can't see anything there. That suggests to me that these chips aren't intended to supply any meaningful current - they're expecting to drive high impedance CMOS inputs.

And looking at the block diagram in section 8.2, that's confirmed: ignoring the driver that's controlled by the one-shot (used to get outputs to their final voltage quickly, then disengaged), in the steady state the output is in series with a 4K resistor. Drawing 50mA will give you a 200mV drop - assuming zero output impedance and full voltage swing on the driver, which isn't guaranteed.

It makes sense. There's no direction control, so the outputs have to be weak enough to be over-ridden by anything they're connected to.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: 5v-3v3 bidirectional buffer

Post by barnacle »

I was more concerned with the statement from the datasheet for the 104:

8.3.2 Input Driver Requirements
Typical IIN vs VIN characteristics of the device are shown in Figure 8-2. For proper operation, the device driving
the data I/Os of the TXB0104 device must have drive strength of at least ±2 mA.

Which if I'm driving sixteen address and eight data and a handful of other pins, is likely over 50mA. And I like micropower devices :mrgreen:

Neil
sburrow
Posts: 833
Joined: 09 Oct 2021
Location: Texas

Re: 5v-3v3 bidirectional buffer

Post by sburrow »

Ah ok, so the TXB0104 is made for chip-to-chip communication, not necessarily peripherals (such as a PS/2 Keyboard).

And I see what you mean about the 2 mA adding up for you. You are running a couple of buses through these things, not just a couple of signal lines.

Thanks for informing me more on this!

Chad
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: 5v-3v3 bidirectional buffer

Post by Dr Jefyll »

gfoot wrote:
or a couple of transistor-inverters, one for each direction, like this:
Ouch! Oh, man, do I hate that color scheme! :roll: I find black on white to be a big improvement:
circuit (edited) 1.png
And what's shown below is, in most circumstances, an improvement to the circuit itself.

-- Jeff
Attachments
circuit (edited) 2.png
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
kakemoms
Posts: 349
Joined: 02 Mar 2016

Re: 5v-3v3 bidirectional buffer

Post by kakemoms »

I have been using the https://www.ti.com/lit/ds/symlink/txb0108.pdf for some years and haven't had much problems. I even used it to interface a NMOS 6502 some years back(!). The address bus don't need it.. I used the 245 there.

Anyone tried to overclock the 65C02? E.g. driving it at higher voltage to get a few more MHz.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: 5v-3v3 bidirectional buffer

Post by barnacle »

For this proto board I've decided to stick with 3.3v throughout and see what's still unhappy. The board is already complex and four extra chips really don't help it.

Neil
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: 5v-3v3 bidirectional buffer

Post by GARTHWILSON »

kakemoms wrote:
Anyone tried to overclock the 65C02? E.g. driving it at higher voltage to get a few more MHz.
Forum member "Plasmo" got one running at 40MHz @ 5.3V: viewtopic.php?p=85784#p85784 (see the edit).
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
BruceRMcF
Posts: 388
Joined: 21 Aug 2019

Re: 5v-3v3 bidirectional buffer

Post by BruceRMcF »

sburrow wrote:
Don't know if this is closer to what you are wanting or not, but I'll be using the TXB0104D:

https://www.ti.com/lit/ds/symlink/txb0104.pdf

It doesn't have 8 bits, but it is bi-directional and super flexible.

Thanks!

Chad
Looks like a interesting part to think about for connecting to a 3.3v serial flash ... MOSI, SCLK and /SELECT, with an additional bit available for a second /SELECT for an SPI block pin header for another 3.3v SPI bus part.
Post Reply