So, I want to hook up the two ports on a 6522 VIA to GPIO pins on a Raspberry Pi. Obviously, this is going to need some level shifting as the 6522 is running at 5V and the RPI's pins are 3V3.
I decided to use a couple of
TXB0108 chips, which are bidirectional. But I ran into a snag.
Long story short, when an output pin on the RPi wants to bring a signal low, the TXB0108 seems to have trouble pulling down the 5V side of the chip. It pulls the level down to about 2.5V. This results in unreliable behaviour, as you'd expect.
I've been poring over the 6522 datasheet, and my limited skills suggest to me that pins set as inputs (or outputs, for that matter) have pullup resistors. Is that right?
The TXB0108 doesn't always play well with pullups because it relies on overwhelming whatever else is going on on a signal line to determine in which direction it's translating. The datasheet suggests that any pullups, for example, should be no stronger than 50KΩ.
I would just like a sanity check here. I tested the circuit with the VIA disconnected, and applying a low signal from the RPi's GPIO pin to the 3V3 side did, indeed, cause the corresponding 5V pin to go to 0V. It's only when the VIA is connected that the signal won't go below 2.5V (and with a lot of noise, to boot). I tried using pulldowns on the line, but no joy.
Is there anything else I could do to counter this, or is the 6522 just too strong?
I'm contemplating switching from the TXB0108 to something like the
SN74LVCC4245. This would involve using another line from the 6522 to switch which direction it's translating in, but that's okay. My main concern is my need to be able to have a bidirectional 8-bit data bus between RPi and 6522, and programmatically determining direction is not a problem.
Signals on the other port will be permanently either input or output. For signals going from the 6522 to the RPi, I can use some simple level shifter or even just resistor dividers. Those going the other way won't need translation.
_________________
I like it when things smoke.
Blog –
Zolatron 64 project