Turn on a microcontroller using a high-side Mosfet switch
up vote
2
down vote
favorite
I am using a P-Channel Mosfet to control the power of an STM32F103VETE ARM microcontroller (MCU1). The source of the Mosfet is connected to 3.3 V and the drain goes to the MCU1 Vdd pins. The gate of the Mosfet is controlled by another microcontroller (STM32F030RET (MCU2)) which is directly connected to 3.3 V net.
Now the problem is that I can't turn off MCU1:
- When I put a Logic 1 on the gate of the Mosfet, that makes its Vgs = 0 but I still get 2.4 V at the drain of the Mosfet which is enough to turn on MCU1.
- When I put a Logic 0 on the gate of the Mosfet, its Vgs = -3.3 V, it turns on properly and I can read 3.3 V at the drain.
Can anyone please help me to solve this? What can cause such a problem?
Here is the schematic of the circuit I have used:
"POWER_ON" is the signal from MCU2. The Mosfet is STS3DPF20V.
microcontroller high-side stm32f1
New contributor
add a comment |
up vote
2
down vote
favorite
I am using a P-Channel Mosfet to control the power of an STM32F103VETE ARM microcontroller (MCU1). The source of the Mosfet is connected to 3.3 V and the drain goes to the MCU1 Vdd pins. The gate of the Mosfet is controlled by another microcontroller (STM32F030RET (MCU2)) which is directly connected to 3.3 V net.
Now the problem is that I can't turn off MCU1:
- When I put a Logic 1 on the gate of the Mosfet, that makes its Vgs = 0 but I still get 2.4 V at the drain of the Mosfet which is enough to turn on MCU1.
- When I put a Logic 0 on the gate of the Mosfet, its Vgs = -3.3 V, it turns on properly and I can read 3.3 V at the drain.
Can anyone please help me to solve this? What can cause such a problem?
Here is the schematic of the circuit I have used:
"POWER_ON" is the signal from MCU2. The Mosfet is STS3DPF20V.
microcontroller high-side stm32f1
New contributor
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am using a P-Channel Mosfet to control the power of an STM32F103VETE ARM microcontroller (MCU1). The source of the Mosfet is connected to 3.3 V and the drain goes to the MCU1 Vdd pins. The gate of the Mosfet is controlled by another microcontroller (STM32F030RET (MCU2)) which is directly connected to 3.3 V net.
Now the problem is that I can't turn off MCU1:
- When I put a Logic 1 on the gate of the Mosfet, that makes its Vgs = 0 but I still get 2.4 V at the drain of the Mosfet which is enough to turn on MCU1.
- When I put a Logic 0 on the gate of the Mosfet, its Vgs = -3.3 V, it turns on properly and I can read 3.3 V at the drain.
Can anyone please help me to solve this? What can cause such a problem?
Here is the schematic of the circuit I have used:
"POWER_ON" is the signal from MCU2. The Mosfet is STS3DPF20V.
microcontroller high-side stm32f1
New contributor
I am using a P-Channel Mosfet to control the power of an STM32F103VETE ARM microcontroller (MCU1). The source of the Mosfet is connected to 3.3 V and the drain goes to the MCU1 Vdd pins. The gate of the Mosfet is controlled by another microcontroller (STM32F030RET (MCU2)) which is directly connected to 3.3 V net.
Now the problem is that I can't turn off MCU1:
- When I put a Logic 1 on the gate of the Mosfet, that makes its Vgs = 0 but I still get 2.4 V at the drain of the Mosfet which is enough to turn on MCU1.
- When I put a Logic 0 on the gate of the Mosfet, its Vgs = -3.3 V, it turns on properly and I can read 3.3 V at the drain.
Can anyone please help me to solve this? What can cause such a problem?
Here is the schematic of the circuit I have used:
"POWER_ON" is the signal from MCU2. The Mosfet is STS3DPF20V.
microcontroller high-side stm32f1
microcontroller high-side stm32f1
New contributor
New contributor
edited 1 hour ago
SamGibson
10.8k41537
10.8k41537
New contributor
asked 5 hours ago
MoHaMaD InSoMnIaC
111
111
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
4
down vote
You have the MOSFET connected correctly.
Most likely something else is driving a pin on the MCU high, which is partially powering it through the protection diodes (hence the 0.7V difference). This is not a good situation and can damage the chip.
You have to make sure that all inputs are low before removing power from the MCU, and similarly wait for the Vdd to rise before driving any one of them high.
This can be bit messsy, and often it’s better to just put the MCU in the lowest power sleep mode and keep power on it.
Note that your switch only opens the supply, and it may take some time for Vdd to fall if there is a lot of capacitance on the switched Vdd. A brief interruption my not reset the MCU, for example.
1
Thank you very much for your response. I have several pins of the mcu1 pulled up to 3.3v (not to the mcu1 vdd itself) with a 10k resistor. Can it be the problem?
– MoHaMaD InSoMnIaC
4 hours ago
1
Yes, that could do it. It's unlikely to damage the MCU with 10K, but it will draw power and (perhaps) prevent it from resetting, depending on the brownout reset (BOR) circuit and its tolerances/settings.
– Spehro Pefhany
4 hours ago
1
@MoHaMaDInSoMnIaC Why don't you have those 10k pull-ups on the switched side? Also the MOSFET leakage current could be contributing so having a push-pull load switch would clear that up (or maybe just a pull-down resistor AND if that pull-down resistor is too low in value for normal operation and gives too much current draw then use the switched MCU to switch it out of circuit when it begins to operate).
– Andy aka
2 hours ago
1
@Andyaka well I didn't assume that it would make a problem since the absolute maximum rating for the stm32f103 gpio is vdd-0.3 and vdd+4.0 volts. About the leakage current I checked the datasheet of the Mosfet and it's value is very low and needs a resistor in order of giga ohms to produce such a voltage. The pull down resistor however seems to work in a way that it brings down the off time voltage to about 1.5 volts and stm32 will turn off but is it OK to have 1.5v on vdd when the MCU is off?
– MoHaMaD InSoMnIaC
2 hours ago
1
The exact circuits used in protection networks are seldom well described in the datasheets, unfortunately. We something similar in the analog world where maximum differential voltage of an op-amp is something reasonable such as 30V however the inputs draw a lot current for differential voltage of more than a diode drop.
– Spehro Pefhany
2 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
You have the MOSFET connected correctly.
Most likely something else is driving a pin on the MCU high, which is partially powering it through the protection diodes (hence the 0.7V difference). This is not a good situation and can damage the chip.
You have to make sure that all inputs are low before removing power from the MCU, and similarly wait for the Vdd to rise before driving any one of them high.
This can be bit messsy, and often it’s better to just put the MCU in the lowest power sleep mode and keep power on it.
Note that your switch only opens the supply, and it may take some time for Vdd to fall if there is a lot of capacitance on the switched Vdd. A brief interruption my not reset the MCU, for example.
1
Thank you very much for your response. I have several pins of the mcu1 pulled up to 3.3v (not to the mcu1 vdd itself) with a 10k resistor. Can it be the problem?
– MoHaMaD InSoMnIaC
4 hours ago
1
Yes, that could do it. It's unlikely to damage the MCU with 10K, but it will draw power and (perhaps) prevent it from resetting, depending on the brownout reset (BOR) circuit and its tolerances/settings.
– Spehro Pefhany
4 hours ago
1
@MoHaMaDInSoMnIaC Why don't you have those 10k pull-ups on the switched side? Also the MOSFET leakage current could be contributing so having a push-pull load switch would clear that up (or maybe just a pull-down resistor AND if that pull-down resistor is too low in value for normal operation and gives too much current draw then use the switched MCU to switch it out of circuit when it begins to operate).
– Andy aka
2 hours ago
1
@Andyaka well I didn't assume that it would make a problem since the absolute maximum rating for the stm32f103 gpio is vdd-0.3 and vdd+4.0 volts. About the leakage current I checked the datasheet of the Mosfet and it's value is very low and needs a resistor in order of giga ohms to produce such a voltage. The pull down resistor however seems to work in a way that it brings down the off time voltage to about 1.5 volts and stm32 will turn off but is it OK to have 1.5v on vdd when the MCU is off?
– MoHaMaD InSoMnIaC
2 hours ago
1
The exact circuits used in protection networks are seldom well described in the datasheets, unfortunately. We something similar in the analog world where maximum differential voltage of an op-amp is something reasonable such as 30V however the inputs draw a lot current for differential voltage of more than a diode drop.
– Spehro Pefhany
2 hours ago
add a comment |
up vote
4
down vote
You have the MOSFET connected correctly.
Most likely something else is driving a pin on the MCU high, which is partially powering it through the protection diodes (hence the 0.7V difference). This is not a good situation and can damage the chip.
You have to make sure that all inputs are low before removing power from the MCU, and similarly wait for the Vdd to rise before driving any one of them high.
This can be bit messsy, and often it’s better to just put the MCU in the lowest power sleep mode and keep power on it.
Note that your switch only opens the supply, and it may take some time for Vdd to fall if there is a lot of capacitance on the switched Vdd. A brief interruption my not reset the MCU, for example.
1
Thank you very much for your response. I have several pins of the mcu1 pulled up to 3.3v (not to the mcu1 vdd itself) with a 10k resistor. Can it be the problem?
– MoHaMaD InSoMnIaC
4 hours ago
1
Yes, that could do it. It's unlikely to damage the MCU with 10K, but it will draw power and (perhaps) prevent it from resetting, depending on the brownout reset (BOR) circuit and its tolerances/settings.
– Spehro Pefhany
4 hours ago
1
@MoHaMaDInSoMnIaC Why don't you have those 10k pull-ups on the switched side? Also the MOSFET leakage current could be contributing so having a push-pull load switch would clear that up (or maybe just a pull-down resistor AND if that pull-down resistor is too low in value for normal operation and gives too much current draw then use the switched MCU to switch it out of circuit when it begins to operate).
– Andy aka
2 hours ago
1
@Andyaka well I didn't assume that it would make a problem since the absolute maximum rating for the stm32f103 gpio is vdd-0.3 and vdd+4.0 volts. About the leakage current I checked the datasheet of the Mosfet and it's value is very low and needs a resistor in order of giga ohms to produce such a voltage. The pull down resistor however seems to work in a way that it brings down the off time voltage to about 1.5 volts and stm32 will turn off but is it OK to have 1.5v on vdd when the MCU is off?
– MoHaMaD InSoMnIaC
2 hours ago
1
The exact circuits used in protection networks are seldom well described in the datasheets, unfortunately. We something similar in the analog world where maximum differential voltage of an op-amp is something reasonable such as 30V however the inputs draw a lot current for differential voltage of more than a diode drop.
– Spehro Pefhany
2 hours ago
add a comment |
up vote
4
down vote
up vote
4
down vote
You have the MOSFET connected correctly.
Most likely something else is driving a pin on the MCU high, which is partially powering it through the protection diodes (hence the 0.7V difference). This is not a good situation and can damage the chip.
You have to make sure that all inputs are low before removing power from the MCU, and similarly wait for the Vdd to rise before driving any one of them high.
This can be bit messsy, and often it’s better to just put the MCU in the lowest power sleep mode and keep power on it.
Note that your switch only opens the supply, and it may take some time for Vdd to fall if there is a lot of capacitance on the switched Vdd. A brief interruption my not reset the MCU, for example.
You have the MOSFET connected correctly.
Most likely something else is driving a pin on the MCU high, which is partially powering it through the protection diodes (hence the 0.7V difference). This is not a good situation and can damage the chip.
You have to make sure that all inputs are low before removing power from the MCU, and similarly wait for the Vdd to rise before driving any one of them high.
This can be bit messsy, and often it’s better to just put the MCU in the lowest power sleep mode and keep power on it.
Note that your switch only opens the supply, and it may take some time for Vdd to fall if there is a lot of capacitance on the switched Vdd. A brief interruption my not reset the MCU, for example.
edited 4 hours ago
answered 4 hours ago
Spehro Pefhany
201k4146401
201k4146401
1
Thank you very much for your response. I have several pins of the mcu1 pulled up to 3.3v (not to the mcu1 vdd itself) with a 10k resistor. Can it be the problem?
– MoHaMaD InSoMnIaC
4 hours ago
1
Yes, that could do it. It's unlikely to damage the MCU with 10K, but it will draw power and (perhaps) prevent it from resetting, depending on the brownout reset (BOR) circuit and its tolerances/settings.
– Spehro Pefhany
4 hours ago
1
@MoHaMaDInSoMnIaC Why don't you have those 10k pull-ups on the switched side? Also the MOSFET leakage current could be contributing so having a push-pull load switch would clear that up (or maybe just a pull-down resistor AND if that pull-down resistor is too low in value for normal operation and gives too much current draw then use the switched MCU to switch it out of circuit when it begins to operate).
– Andy aka
2 hours ago
1
@Andyaka well I didn't assume that it would make a problem since the absolute maximum rating for the stm32f103 gpio is vdd-0.3 and vdd+4.0 volts. About the leakage current I checked the datasheet of the Mosfet and it's value is very low and needs a resistor in order of giga ohms to produce such a voltage. The pull down resistor however seems to work in a way that it brings down the off time voltage to about 1.5 volts and stm32 will turn off but is it OK to have 1.5v on vdd when the MCU is off?
– MoHaMaD InSoMnIaC
2 hours ago
1
The exact circuits used in protection networks are seldom well described in the datasheets, unfortunately. We something similar in the analog world where maximum differential voltage of an op-amp is something reasonable such as 30V however the inputs draw a lot current for differential voltage of more than a diode drop.
– Spehro Pefhany
2 hours ago
add a comment |
1
Thank you very much for your response. I have several pins of the mcu1 pulled up to 3.3v (not to the mcu1 vdd itself) with a 10k resistor. Can it be the problem?
– MoHaMaD InSoMnIaC
4 hours ago
1
Yes, that could do it. It's unlikely to damage the MCU with 10K, but it will draw power and (perhaps) prevent it from resetting, depending on the brownout reset (BOR) circuit and its tolerances/settings.
– Spehro Pefhany
4 hours ago
1
@MoHaMaDInSoMnIaC Why don't you have those 10k pull-ups on the switched side? Also the MOSFET leakage current could be contributing so having a push-pull load switch would clear that up (or maybe just a pull-down resistor AND if that pull-down resistor is too low in value for normal operation and gives too much current draw then use the switched MCU to switch it out of circuit when it begins to operate).
– Andy aka
2 hours ago
1
@Andyaka well I didn't assume that it would make a problem since the absolute maximum rating for the stm32f103 gpio is vdd-0.3 and vdd+4.0 volts. About the leakage current I checked the datasheet of the Mosfet and it's value is very low and needs a resistor in order of giga ohms to produce such a voltage. The pull down resistor however seems to work in a way that it brings down the off time voltage to about 1.5 volts and stm32 will turn off but is it OK to have 1.5v on vdd when the MCU is off?
– MoHaMaD InSoMnIaC
2 hours ago
1
The exact circuits used in protection networks are seldom well described in the datasheets, unfortunately. We something similar in the analog world where maximum differential voltage of an op-amp is something reasonable such as 30V however the inputs draw a lot current for differential voltage of more than a diode drop.
– Spehro Pefhany
2 hours ago
1
1
Thank you very much for your response. I have several pins of the mcu1 pulled up to 3.3v (not to the mcu1 vdd itself) with a 10k resistor. Can it be the problem?
– MoHaMaD InSoMnIaC
4 hours ago
Thank you very much for your response. I have several pins of the mcu1 pulled up to 3.3v (not to the mcu1 vdd itself) with a 10k resistor. Can it be the problem?
– MoHaMaD InSoMnIaC
4 hours ago
1
1
Yes, that could do it. It's unlikely to damage the MCU with 10K, but it will draw power and (perhaps) prevent it from resetting, depending on the brownout reset (BOR) circuit and its tolerances/settings.
– Spehro Pefhany
4 hours ago
Yes, that could do it. It's unlikely to damage the MCU with 10K, but it will draw power and (perhaps) prevent it from resetting, depending on the brownout reset (BOR) circuit and its tolerances/settings.
– Spehro Pefhany
4 hours ago
1
1
@MoHaMaDInSoMnIaC Why don't you have those 10k pull-ups on the switched side? Also the MOSFET leakage current could be contributing so having a push-pull load switch would clear that up (or maybe just a pull-down resistor AND if that pull-down resistor is too low in value for normal operation and gives too much current draw then use the switched MCU to switch it out of circuit when it begins to operate).
– Andy aka
2 hours ago
@MoHaMaDInSoMnIaC Why don't you have those 10k pull-ups on the switched side? Also the MOSFET leakage current could be contributing so having a push-pull load switch would clear that up (or maybe just a pull-down resistor AND if that pull-down resistor is too low in value for normal operation and gives too much current draw then use the switched MCU to switch it out of circuit when it begins to operate).
– Andy aka
2 hours ago
1
1
@Andyaka well I didn't assume that it would make a problem since the absolute maximum rating for the stm32f103 gpio is vdd-0.3 and vdd+4.0 volts. About the leakage current I checked the datasheet of the Mosfet and it's value is very low and needs a resistor in order of giga ohms to produce such a voltage. The pull down resistor however seems to work in a way that it brings down the off time voltage to about 1.5 volts and stm32 will turn off but is it OK to have 1.5v on vdd when the MCU is off?
– MoHaMaD InSoMnIaC
2 hours ago
@Andyaka well I didn't assume that it would make a problem since the absolute maximum rating for the stm32f103 gpio is vdd-0.3 and vdd+4.0 volts. About the leakage current I checked the datasheet of the Mosfet and it's value is very low and needs a resistor in order of giga ohms to produce such a voltage. The pull down resistor however seems to work in a way that it brings down the off time voltage to about 1.5 volts and stm32 will turn off but is it OK to have 1.5v on vdd when the MCU is off?
– MoHaMaD InSoMnIaC
2 hours ago
1
1
The exact circuits used in protection networks are seldom well described in the datasheets, unfortunately. We something similar in the analog world where maximum differential voltage of an op-amp is something reasonable such as 30V however the inputs draw a lot current for differential voltage of more than a diode drop.
– Spehro Pefhany
2 hours ago
The exact circuits used in protection networks are seldom well described in the datasheets, unfortunately. We something similar in the analog world where maximum differential voltage of an op-amp is something reasonable such as 30V however the inputs draw a lot current for differential voltage of more than a diode drop.
– Spehro Pefhany
2 hours ago
add a comment |
MoHaMaD InSoMnIaC is a new contributor. Be nice, and check out our Code of Conduct.
MoHaMaD InSoMnIaC is a new contributor. Be nice, and check out our Code of Conduct.
MoHaMaD InSoMnIaC is a new contributor. Be nice, and check out our Code of Conduct.
MoHaMaD InSoMnIaC is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Electrical Engineering Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f411810%2fturn-on-a-microcontroller-using-a-high-side-mosfet-switch%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown