Electronic – arduino – High Frequency Logic Level Conversion

arduinohigh frequencylogic-level

I am using Arduino DUE for my project which gives a 3.3 volt output signal. I have to convert it to 5 volts to use it with another device. The problem is that my signal frequency is 1 MHz. I have tried using Spark Fun logic level converter which uses BSS138 MOSFET. The converter does give a signal of 1MHz but its output amplitude remains at 3.3 volts. I need to convert it to 5 volts. Can anyone tell me whats the problem. Why the signal amplitude remains at 3.3 volts? I have also tried the same circuit with 2n7000 MOSFET but it also gives the same problem. If frequency is the problem then can anyone suggest a level converter or circuit that can convert the 3.3 volt signal to 5 volts at 1MHz. Thank You

enter image description here

enter image description here

Best Answer

TL;DR Your frequency is too high for that method of level shifting.

Old thread but on the off chance that someone stumbles across this like I did while looking for answers here's what is likely wrong:

I built my own level shifter based on the sparkfun level shifter which you are using. Like you I am attempting to shift 3.3V up to 5V at a frequency of 1MHz. I used a slightly different transistor/MOSFET and mine was just outputting 0V when on.

Changing my resistor values down to 100 ohms improved the output (I got spikes that went to about 3.3V so still not what was desired).

I then tried reducing the frequency to 1 KHz and the level shifter worked perfectly.

Basically I think the pwm turns the gate on (output goes low) and when it turns off again it takes awhile (too long at high freq) for the output to become high again. The resistor is just too slow. Smaller resistor values help but at 1 MHz I've found it's not quite good enough.

Alternate options to consider include: