High-side switching 5V devices with a 3V device (in my case an RP2040) is a proper pig.
-
@philpem Use a TTL inverter as a buffer. Make sure that it accepts 3.3V digital input voltages in accordanc to RP2040's specified outputs as valid inputs. This is usually the case with modern chips, which may be CMOS inside even if they speak TTL to the outside world, but I think there's a couple of now-mostly-obsolete logic families that can have problems.
The tradeoff is, you'll need a bit of extra power to feed the buffer, you'll lose a little bit of reaction time; if you don't have a spare gate around, you might have to put in an extra component, and lose a little bit more of PCB real estate.
-
@riley I thought of that one - but this is 0.1in padboard and I don't have space for a 14-pin DIP chip. I'm thinking about hooking in another transistor and a resistor to work as a level shifter.
-
@philpem Is your system battery-powered?
-
@riley No, 5V DC from an ATX power supply. The board hosts an RP2040 which talks I2C to an Acorn A4000 motherboard, parallel 8080-style to a VFD display, and watches what the switch is doing.
-
@philpem Then, you can make a simple inverter out of a BJT and two resistors.
-
@philpem Hey, if you use a VFD, you might have a convenient negative voltage around that you can use to stretch the switched voltage a bit.
-
@riley Sadly not, or at least "I probably do but I don't have a schematic and don't want to make everything else depend on the VFD"
-
@philpem It's probably overkill, but an optical switch would get the job done, and modern ones are pretty small.
-
@philpem Or, you could cheat, get one of these AliExpress-style 'driver boards', and call it a component. You should be able to mount it vertically, so it'll take only 3 or 4 adjacent holes in your perfboard, at the cost of the 'height' being somewhat higher than most (modern) components.
-
@philpem ATX should give you −12V. Depending on how your layout works, dividing it up to get something around −2V might be easier to fit than a full inverter.