Hello, this is probably a dumb newbie question, but I can't figure it out.
I tried to use an N-channel MOSFET as a relatively fast switch, and I did not understand what was going on so I made a simple test circuit, as shown in the diagram. I am feeding the control signal to the gate with a function generator. The MOSFET is an IRF510.
At fairly low frequencies, the signal is as expected, as seen on the first scope picture. The signal is a square wave at 100Hz with 10V amplitude, as the data sheet for the transistor says 10V Vgs puts it in the sweet spot.
When I increase the frequency to 500KHz, things get really ugly as in the second scope picture.
The IRF510 data sheet gives rise and fall times in the few nanoseconds, so 500KHz should not be asking too much.
The 5V load power is provided by an older but solid HP power supply that is well below its limits.
The signal generator has a 25MHz sine bandwidth and 10MHz square wave capability, so, again it should be well within its limits. I understand that the transistor has some parasitic capacitance that may introduce some oscillation, but they are in the low pF range. I tried different values for the gate pull down resistor with little effect.
What am missing and why am I not getting a clean square wave?
Thank you for suggestions.