I want to do PWM from an mcu using a FDN340P mosfet, driving a dc motor, so I made a test, without the mcu first
if I set the gate to 0 (vss) the motor runs smoothly (200mA)
if I want to stop the motor, setting the gate to 9v, instead of stopping, it runs slower, but then the current goes up to 3 A and the transistor heats like hell
this does not make sens at all
why is the motor not stopping, why is the current raising to 3A while the motor runs slower ? I thought a P-channel mosfet would close itself if set to VCC
I also tried using a 10k res between 9V and gate but still the same
Your question is confusing:
if the device is a J201 as in the title, it is a depletion mode JFET but the pins are correct.
if the device is a FDN340 you have the pins crossed over and ignore that it is a logic level device. Assuming VSS is negative, you also have the polarity wrong.
Transistor polarity (PMOS) still doesn't fit the apparently positive power supply.
It would be helpful to know the motor current consumption with 9V power supply, without any erroneously wired transistors. A possible problem is the maximum gate voltage rating of +/- 8V, connecting 9V between gate and source may have destroyed the transistor.
That's my guess too. I suspect the motor runs slower because of extra load through a shorted gate-source pin inside the FET.
Rompelstilchen - be careful of the polarity and gate voltage. The device is PMOS so the drain should be negative with respect to the source and the gate voltage should be no higher than 5V above the source voltage. I would advise you add a 1K resistor in series with the gate anyway to prevent high current in case of accidents and add a 100K resistor between gate and source to prevent the gate floating while the switch changes over.