6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 8:37 pm

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Nov 21, 2023 11:05 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
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
circuit-20231121-1205.png [ 123.59 KiB | Viewed 3620 times ]


Last edited by gfoot on Tue Nov 21, 2023 12:06 pm, edited 2 times in total.
Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 11:20 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
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.

Attachment:
PS2 Keyboard.pdf.png
PS2 Keyboard.pdf.png [ 89.28 KiB | Viewed 3624 times ]
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!


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 11:49 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Just to note, some PS/2 keyboards, but not all, can run with 3V3 supply and signalling.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 12:10 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 2:27 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 983
Location: Potsdam, DE
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:


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 3:09 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
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
TXB-mA.png [ 13.37 KiB | Viewed 3603 times ]
Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 3:29 pm 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 336
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 3:59 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 983
Location: Potsdam, DE
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 21, 2023 5:19 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 22, 2023 2:54 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
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:

Attachment:
circuit (edited) 1.png
circuit (edited) 1.png [ 30.78 KiB | Viewed 3536 times ]

And what's shown below is, in most circumstances, an improvement to the circuit itself.

-- Jeff


Attachments:
circuit (edited) 2.png
circuit (edited) 2.png [ 30.47 KiB | Viewed 3536 times ]

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 01, 2023 4:30 am 
Offline

Joined: Wed Mar 02, 2016 12:00 pm
Posts: 343
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.


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 01, 2023 5:13 am 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 983
Location: Potsdam, DE
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


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 01, 2023 5:15 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 01, 2023 5:36 am 
Offline

Joined: Wed Aug 21, 2019 6:10 pm
Posts: 217
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: