P Channel Mosfet

Thread Starter

djm2

Joined Dec 28, 2015
2
Hi there

I have not used a P channel MOSFET before so I may have a mis-understanding here.

I have a PIC connected to a P Channel Mosfet - logic level - NDP6020P. I am using the PIC to turn the power on and off to a load - 5v @ about 300mA.

I have attached a screenshot of the circuit I am using. The green block represents my load. My PIC output is turning on and off every few seconds and the source pin goes to 4.7v when the PIC output is high and 5v when the output is low. I cannot figure out why the MOSFET will not turn my load off. I have checked the values of the resistors and everything is good. Can anyone point out where I have gone (badly) wrong?


David
 

Attachments

dl324

Joined Mar 30, 2015
16,921
Welcome to AAC! And thanks for attaching a schematic.

You have the MOSFET source and drain terminals reversed.
 

crutschow

Joined Mar 14, 2008
34,450
As dl324 noted, you have the P-MOSFET source and drain terminals reversed, so the substrate diode is conducting the current even when the MOSFET is off.
For a high-side switch using a P-MOSFET as you have, the source must be connected to the plus voltage supply.
Then, when you apply a logic low to the gate (0V), the Vgs voltage (gate negative with respect to the source) turns on the MOSFET.
Note that a logic high (5V) turns the transistor off and a logic low (0V) turns the transistor on.
 

#12

Joined Nov 30, 2010
18,224
My memory device is, "P=pinch". With a p-channel mosfet, positive voltages pinch off the flow of current.
Logical thinking reminds you that with an n-channel mosfet, negative voltages will pinch off the current flow.
 

ScottWang

Joined Aug 23, 2012
7,400
Maybe you should change to using the N mosfet or adding a npn bjt to drive the P mosfet, if the PIC output a low level to drive the P mosfet then it could be bad thing when the PIC in the initial status may output a low level signal and it will drive the mosfet to turn the load on.

Normally using the output port of uC to output a high level to drive the NPN bjt or N mosfet is better for the initial status of uC.
 

benta

Joined Dec 7, 2015
101
Maybe you should change to using the N mosfet or adding a npn bjt to drive the P mosfet, if the PIC output a low level to drive the P mosfet then it could be bad thing when the PIC in the initial status may output a low level signal and it will drive the mosfet to turn the load on.

Normally using the output port of uC to output a high level to drive the NPN bjt or N mosfet is better for the initial status of uC
Huh?

Where did you get this baloney from?

The OP is doing it completely correct.
All microcontrollers I know are either three-state or pull-up output when booting. There is no way OP can run into trouble here.

The only thing to look out for is to set the output port pin _level_ register, before setting the output port _direction_ register, when booting.

Many people make the mistake of setting direction before level.

Benta.
 

kubeek

Joined Sep 20, 2005
5,795
I already saw that Scott´s english wasn´t perfect and it didn´t bother me , but really is it apropriate for a moderator of an english speaking forum to be communicating through a translator if that really is the case?
Not that it matters in this case, I think both Scott´s and benta´s replies were absolutely clear about the matter in question. However benta could be more polite about stating his opinion.

Nevertheless to the point, most modern micros startup with pins in high impedance state, so one really needs to set the desired fail-safe level with a pullup or pulldown resistor every time, and no one can say if an N channel or P channel is better regarding the reset state of a uC.
 

ScottWang

Joined Aug 23, 2012
7,400
Where did you get this baloney from?
Do you like other members say that to you?

The OP is doing it completely correct.
Shortcut maybe easy to get to the present target, but it is not the best way for a long term study, and could be bring bad behavior to the future.

All microcontrollers I know are either three-state or pull-up output when booting. There is no way OP can run into trouble here.
Can you find the word "booting" with pic or uC from google, and what does that means?

The only thing to look out for is to set the output port pin _level_ register, before setting the output port _direction_ register, when booting.
That is the basic conception for uC.

Have you ever searched how many examples used the way as TS and how many examples did as I suggested, why ?
 

ScottWang

Joined Aug 23, 2012
7,400
I already saw that Scott´s english wasn´t perfect and it didn´t bother me , but really is it apropriate for a moderator of an english speaking forum to be communicating through a translator if that really is the case?
Not that it matters in this case, I think both Scott´s and benta´s replies were absolutely clear about the matter in question. However benta could be more polite about stating his opinion.

Nevertheless to the point, most modern micros startup with pins in high impedance state, so one really needs to set the desired fail-safe level with a pullup or pulldown resistor every time, and no one can say if an N channel or P channel is better regarding the reset state of a uC.
I'm using google to search and google online translator all the time, but I didn't use it to writing a sentence in Chinese and translating to English, I was used translator to checked the spelling for all article, I just hope there is no any wrong spelling, and sometimes I will copy the English articles or posted from forums to translate to Chinese.

Although the google online translator really helpful, but its ability is not that good to translate from Chinese to English or English to Chinese perfectly, but it is improving, if I write down the all article in Chinese and using translator to translate to English, I think it will be as an entertainment like guessing the puzzle, I also used some other online translator to help me.
 

benta

Joined Dec 7, 2015
101
I apologise for using the word "baloney", it was apparently received differently and harsher than I thought.

Concerning the rest of my post, I stand by it. Your "Google Translate" Moderator came in with at suggestion that was nonsense from a technical perspective, language problems notwithstanding.
Apart from that, I'll withdraw from here, as this seems to be a forum for students that have only just learned what a transistor is.

Cheers and Goodbye,

Benta.
 
Last edited:

cmartinez

Joined Jan 17, 2007
8,253
Apart from that, I'll withdraw, as this seems to be a forum for students that have just learned what a 741 is
You would've been in for a surprise, if you would've stuck around a bit longer...

EDIT: Where's the "Dislike" button when I need one?
 

benta

Joined Dec 7, 2015
101
Can you find the word "booting" with pic or uC from google, and what does that means?
One last word before I disappear: "booting" is the standard term used for a microcontroller/microprocessor powering up, resetting and initialising before entering operation.
That this is unknown sort of brings things into perspective...

Benta.
 

JohnInTX

Joined Jun 26, 2012
4,787
One last word before I disappear: "booting" is the standard term used for a microcontroller/microprocessor powering up, resetting and initialising before entering operation.
That this is unknown sort of brings things into perspective...
Benta.
It's not unknown here but you've mischaracterized it. The term as applied to computing goes back to way before microprocessors and was used in early computers (with no permanent storage) to describe the process of loading a small program, frequently manually using console switches, that was just smart enough to read enough of the OS (sometimes from an intermediate medium like paper tape) so that it could take over and read the rest of itself into memory to start operation. The process was reminiscent of the colloquial 'Pulling oneself up by one's bootstraps'. As computing hardware evolved, boot loaders began be incorporated in various ways using non-volatile memory (BIOS reads the boot sector etc). It was still called 'booting up' and over time, the term has evolved and many apply it to any system startup.

I hope you elect to stick around. You seem to have knowledge that would augment the wide array of skills on daily display here on AAC. Just realize that you wouldn't be the only one..

Apologies to the TS for off-topic.
 
Last edited:
Top