The following transistor circuit section(using a PNP transistor BC557B) is inverting and buffering a 25kHz PWM pulse train coming from one of the Nano's PWM supported digital pins. The following is the schematics diagram in LTspice:
As you see above, 25kHz PWM signal with 300ns ON time works fine in simulation.
It looks a bit messy but it is exactly the same circuit. The 5V for the PNP transistor comes from Nano's +5V supply pin. I guess it supports up to 500mA or even some more.
So the PNP obviously does not turn ON at this duty cycle unlike in simualtion.
Then I gradually increased the ON time of the PWM and it started to switch barely fine when the ON time was 1.5μs. Here is the scope screen for this at R4:
I tried to lower the values of both R4 and R3 down to 330 Ohm. But it didnt make any difference.
What could be the limiting the switching behavior of the transistor at low duty cycles here? Is the transistor not fast enough? What could be a remedy to lower this limit?
I found this PMOS and its SPICE model in a site as:
.model TP2104 PMOS (LEVEL=3 RS=0.73 NSUB=5.0E14 DELTA=0.1 KAPPA=0.0411 TPG=-1 CGDO=6.1716E-10 RD=1.91 VTO=-2.10 VMAX=3.0E6 ETA=0.12098 NFS=3.384E11 TOX=1.0E-7 LD=1.6980E-9 UO=865.45 XJ=6.5E-7 THETA=4.063E-5 CGSO=9.10E-9 L=2.5E-6 W=0.5E-2)
Then for a 10ns pulse(10 MegHz) input I compared the outputs in simulation for the BC557B and TP2104. Below shows the plots:
At least in simulation this particular PMOS worked better. But I didn't try it on breadboard yet.