That family of level shifters do work well under the right circumstances, but they are prone to oscillation (which is what you are seeing), particularly with long wires/tracks. If you are working on breadboard, it might well work OK when you transition to a dedicated PCB, and you could try improving the breadboard by having short connections, twisting a ground wire with each sensitive data wire etc.At any rate some progress has been made. I realise that the problem with the level shifters is not specifically a Pico problem so may be OT, but I would be interested in knowing what level shifter devices others have used successfully to connect a Pico to a 5V environment or device. I do need to shift 16 pins, hence my trying out the LXS0108E chips.
The reason that they oscillate is that they start with an open-drain style pass-through with pull-up resistors (as commonly used for I2C level shifting), which works but is rather slow, and then speed it up by adding edge-boosting circuits. Unfortunately those edge-boosters can be triggered by noise and signal reflections, boosting edges that weren't supposed to be there. I've been bitten by this in the past, and nowadays would only consider them for fairly short and well-controlled connections.
For alternatives, the classic option is something like 74LVC245 (powered from 3V3) - these have 5V-tolerant inputs and when powered from 3V3 their (CMOS) input thresholds are about right for TTL-level 5V signals. But that requires you to provide a direction control if any of the signals are bidirectional.
If you want something closer to the 'magic' bidirectional support of the LXS0108, my favourite is the 74CB3T family - available with up to 20 level-shifters per chip in a tiny TVSOP package that gets you a lot of level shifting in a small space, (or also with 8-way or even 1-way in more conventional packages). They are almost infinitely fast (because they provide a straight-through path, the source - the Pico in this case - is providing the current into the 5V circuit, and the 5V circuit is providing the current into the Pico, with the level-shifter just clipping the voltage).
The 16- or 20-way ones can also be used as multiplexors, handy if you are short of pins on the Pico. Again, the level shifter to be powered from the lower of the two voltages (3V3 in this case) and relying on the fact that 3V3 CMOS outputs meet the requirements of 5V inputs designed for TTL.
For example:
https://www.ti.com/product/SN74CB3T16210-Q1
https://www.ti.com/product/SN74CB3T3245
Of course if you don't need the bidirectional capability, ordinary 74LVC buffers are probably the way to go.
Or if you need a real 5V signal (as opposed to 5V TTL compatible) then 74HCT buffers powered from 5V for the outward direction and 74LVC in the inward direction.
Statistics: Posted by arg001 — Sat Oct 26, 2024 1:21 pm