Problem using a mosfet to switch devices on/off

Hi, I'm trying to use a MOSFET whose gate is controlled by an MCU to switch on/off the Vcc of 2 devices. I'm using a spare TP0610 P channel enhancement mode vertical DMOSFET to accomplish this. Here are the connections. Source - 3.3V Gate - MCU control output and 50K pullup(hence default switched OFF) Drain - device Vcc and 1M pulldown(hence Vcc = 0V when mosfet OFF)

When I take the MCU out of the picture and simply use a jumper to ground the gate input, and using this to switch the devices on/off, it works perfectly. However, when I use the MCU to control the gate voltage, I get some problems.

1) Drain voltage is initially 0V when power is applied. However, when my MCU switches the mosfet ON and then OFF again, drain voltage sometimes doesn't return back to 0V, but is about 1.2V

2) When the MCU tries to switch the mosfet ON by applying a logic 0, my multimeter says it's not actually 0V but more like 300+mV. Does this cause any problems, and why is logic 0 so high in the first place?

I'm having some intermittent problems so I suspect that my hardware's the problem here. Judging from the behavior and measurement I'm getting this may very well be the case.

Any thoughts/suggestions/fixes?

Thanks!

Reply to
galapogos
Loading thread data ...

What voltage does the microcontroller drive for the mosfet off voltage?

From a cursory glance at the mosfet's data sheet, 300mV gives you enough Vgs to turn the device on so that should not be a problem. With regards to your microcontroller driving 300mV for logic 0, what does you microcontrollers data sheet (in the DC characteristics section) say the maximumum should be?

Does any circuitry drive the circuits that you are controlling power to? - maybe you have leakage through input protection diodes?

Regards,

Paul Taylor

Reply to
Paul Taylor

I'll give good odds that changing the pullup from 50k to 10k or

4.7k will cure it. Things leak.
--
Chuck F (cbfalconer at maineline dot net)
   Available for consulting/temporary embedded and systems.
Reply to
CBFalconer

It drives logic 1(off) at about 3.3V, or very close to that. It's logic 0(on) that seems to less than ideal.

Sorry, I don't quite get your question. Maximum what? That particular port has the following DC characteristics, if this is what you mean:

VIL(min/max) = -0.3/0.3Vcc = -0.3/1V VIH(min/max) = 0.7Vcc/Vcc+0.3 = 2.3/3.6V VOL(max) = 0.45V (IOL = 1.6mA) VOL(max) = 0.15Vcc = 0.5V (IOL = 0.4mA) VOH(min) = Vcc - 0.3 = 3.0V (IOL = -400uA) VOH(max) = 0.8Vcc = 2.64V (IOL = -200uA)

My Vcc is provided by a simple LDO, and this Vcc is shared among the various components on my board. I'm not sure what other circuitry you mean. I don't have any diodes in my current design.

Anyway, I fixed problem 1, but problem 2 is still there.

Reply to
galapogos

I'm sorry, but could you explain how changing the pullup to a lower value would cure this? Also, wouldn't a lower value pullup increase power consumption?

Reply to
galapogos

Maximum output voltage for logic 0

Yes it is what I mean. Voltage output low maximum voltage. From those figures, it looks like 300mV is normal.

I was referring to the diodes that manufacturers put in their devices to protect the pins of the device from overvoltage. It is not uncommon for them to cause a problem in switched power circuits, if the designer has not paid attention to them. But as you have fixed your problem, you don't need to concern yourself, at least for this design.

What was the problem?

Regards,

Paul.

Reply to
Paul Taylor

You are correct, you don't need to change the 50k. It is OK. Any MCU output I have seen would drive this practically to 0. The problem must be elsewhere: something shorted (so you don't actually have 50k but much less), dead MCU output (can happen while experimenting), software - the output configuration is messed up etc. etc, it will take some wrestling until you eventually catch it. Busyness as usual ...:-).

Dimiter

Reply to
Didi

Maybe you're connecting more than just the MCU to those switches-- and the MCU is partially powering the devices through it's outputs and the input protection diodes on whatever you are switching. If that seems likely, try programming any such outputs to go low before you cut the Vcc.

The 300mV does not make much sense, so it bears further investigation. Scope the line to make sure there are not pulses on there, and check that there is no voltage differential on your grounds.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

Well, one of the devices communicated with my MCU's UART, and when I disconnecting the Vcc, the TX pin was still set to an output pin and pulled high. For some reason this interfered with the switching on/ off. I set the pin to now be an input pin instead everytime I disconnected the device right before pulling the gate voltage to 3.3V and now it works. I don't know why the TX output might cause a problem though. Any idea?

Reply to
galapogos

I don't think it's a board or software problem though, because this doesn't happen when I'm testing on my emulator. I get the 300mV problem when I flash my MCU with the firmware and use that.

Reply to
galapogos

Then the emulator is not much of one. Which micro / emulator is this ?

How many mV do you actually get on the emulator ?

-jg

Reply to
Jim Granville

Power can find many ways to at least partially travel.

So a TX line that is left hi, driving into a block you are trying to power off, can hit the substrate diode Paul mentioned, and then power will flow from the uC HI, thru the ESD diodes, and into the 'off' Vcc.

Driving the last uA of power out of systems can take a while, as you have to find, and resolve, these residual paths.

-jg

Reply to
Jim Granville

... snip ...

Did you try it?

--
 

 "A man who is right every time is not likely to do very much."
                           -- Francis Crick, co-discover of DNA
 "There is nothing more amazing than stupidity in action."
                                             -- Thomas Matthews
Reply to
CBFalconer

Most logic devices have protection diodes which cause problems when powering down part of a system, and so you have to work around them, as you have done for your TX. Some devices don't have the diodes. For example, see LVC logic family.

Regards,

Paul.

Reply to
Paul Taylor

It's a Toshiba emulator for the TLCS-900/L1 series 16bit MCU. With my emulator I get very much closer to 0V, less than 50mV.

Reply to
galapogos

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.