I want to translate +5V HIGH, 0V LOW logic from Arduino Uno to +12V HIGH, 0.5V LOW logic using IRF540N enhancement type n-channel MOSFET. The circuit I have referred is from https://circuitdigest.com/tutorial/bi-directional-logic-level-controller-using-mosfet and the circuit is
At the input Vin, I'm providing a square wave at 70% duty cycle with +5V HIGH & 0V LOW. Initially I was driving the circuit at 10 kHz and was able to get a beautiful waveform.
But as I was increasing the frequency up to 200 kHz, the waveform is not a square wave anymore. Output at 65kHz:
Output at 100kHz:
Output at 200kHz with peak voltage at 7.3125V:
I had chosen IRF540N considering the switching characteristics with 100 ns turn On time and 145 ns turn Off time as the at 200 kHz with 70% duty, it will 3500 ns HIGH and 1500 ns LOW but unable to get the desired output.
Someone please explain why this is happening even though the MOSFET turn on time is quite within the limits of switching time. Moreover is it possible to achieve +0.5V LOW logic level after translation with this circuit?