Testing a level shifter at various frequencies - Page 1
Forum section: electronics / projects

author: chrisb741
author_rank: Regular Contributor
timestamp: December 16, 2023, 10:36:55 am
content: Hi,I am testing a level shifter at various frequencies with a bench waveform generator and oscilloscopeLets just start with 3v3 to 5v level shifting.So I set the generator to generate frequencies from 10Hz to 10MHz at 0-3v3 50% duty cycleWhen I plug it directly into the scope I get 3v3 across the entire frequency rangeWhen I plug it into the circuit and check the input with the scope the input signal starts to attenuate over 1MhzNothing is added except the level shifter moduleIs there something I'm missing, generator or scope setting. Should I be adding more components?

author: moffy
author_rank: Super Contributor
timestamp: December 16, 2023, 02:43:30 pm
content: The answer to your question depends upon the detail of your setup:1. Circuit diagram of level shifter and part numbers2. What brand is your signal generator? And what is its output impedance?3. How much is the signal dropping at 1MHz? And could you provide some pictures?Could you drive a logic gate with your signal generator and use the gate to drive the level shifter?Without the detail it is hard to comment.

author: chrisb741
author_rank: Regular Contributor
timestamp: December 16, 2023, 03:56:39 pm
content: Attached is circuitWaveform generator is SDG2122X

author: moffy
author_rank: Super Contributor
timestamp: December 16, 2023, 04:14:54 pm
content: With 10k pullups the level shifter is only meant for moderate frequencies, probably less than 1MHz. The input charge for the BSS138 has to be driven by the input signal so even for a 50R output impedance it will roll off.

author: chrisb741
author_rank: Regular Contributor
timestamp: December 16, 2023, 04:20:08 pm
content: At 1Mhz its fine, I see 0v to 3v3 on the scopeAt 10mhz 0v5 to 2v8, see scope screen shotLV1 is the input, generator and scope is attahcedLV and HV are 3v3 and 5v ref voltagesHV1 output

author: chrisb741
author_rank: Regular Contributor
timestamp: December 16, 2023, 04:30:26 pm
content: If I changed load to 50ohm and set 3v3-0v on the scope i see 750mV-5v6

author: moffy
author_rank: Super Contributor
timestamp: December 16, 2023, 04:37:38 pm
content: Why are you using a sine wave to drive a digital level shifter?

author: chrisb741
author_rank: Regular Contributor
timestamp: December 16, 2023, 04:40:31 pm
content: Same settings but square wave.Hmmmm going to have to look into this later

author: Peabody
author_rank: Super Contributor
timestamp: December 16, 2023, 04:47:58 pm
content: Do you actually need the level shifter to be bidirectional? If not, something like a 74LV1T34 would give you plenty of speed, fewer parts, and consume less power.If it does have to be bidirectional, I've seen suggestions here to replace the mosfet with an NPN transistor (and base resistor). I think the idea is to get around the issue of the mosfet's gate capacitance. But it still depends on the pullup resistor to bring it back high instead of an actively driven source.

author: chrisb741
author_rank: Regular Contributor
timestamp: December 16, 2023, 04:57:33 pm
content: I've ordered a completely different style of level shifter, it's just a single ic the txs01018eWas using bi directional for i2cBut I also attached SPI running at 10mhz the output at those speeds the high level output is at 3v3

author: temperance
author_rank: Super Contributor
timestamp: December 17, 2023, 01:37:37 pm
content: 1. You cannot test this circuit with a sine wave.2. The original circuit will work fine for I²C but you will need to use lower values resistors.3. Do you really need the level shifter able to work up to 10 MHz? Probably not. A high speed I²C bus is 400 kbit/s in high speed mode and 10 kbit/s in low speed. And those are maximum clock rates. If your design allows for it, you can set the clock frequency much lower.4. For SPI you don't need this kind of level shifter. The MISO can be scaled with resistors and CLK and MOSI can be level shifted with single gate buffers.

author: chrisb741
author_rank: Regular Contributor
timestamp: December 17, 2023, 03:59:45 pm
content: Same thing if you want to increase MISO decrease MOSI and CLk?Im using SPI for a transceiver it will need to transfer lots of data to multiple devices