2017-05-30 02:26 AM
Hi,
I am using the NUCLEO - L053R8 circuit board.I question about 5 V tolerant function.
A pull-up resistor driven by 5 V is added to the port of PA_8.
In this case, when setting the open drain setting, 0.1 mA flows.However, setting to input setting is 0 mA.I want to set the current to 0 mA in the open drain setting state.question 1In the open drain setting, does the protection diode work?Question 2
Please check if my open drain setting method is correct.It is set with mbed.
///////////////////////////////////////////
&sharpinclude ''mbed.h''DigitalInOut Common_5(PA_8);
int main() {
while(1) { Common_5.mode(OpenDrain); wait_ms(2);}}///////////////////////////////////////////Thanks
#gpio #mbed #nucleo-l053r8 #5v-tolerant2017-05-30 07:43 PM
Hello,
If you turn off the
GPIO, you will not get theLOWlevel state anymore...the current you are talking about only exists when the output is set to
LOWlevel.
When the output is set to
ODHIGHlevel, the current is 0.
This current only depend on the external resistor value, if you don't have speed constraint, try to increase the value to reduce the current..
the protection works because there is an internal protection device - similar to a zener diode - between the internal protection rail
VDD_FT
andGND.
The mbed configuration looks right to me...
2017-05-31 07:58 PM
Thank you for your reply.
I got very helpful.Let me ask you a question.
It is connected to 5V with an open drain pin sandwiching a 1.5K resistor.
(It pulled up with 1.5 KΩ)The power supply of the CPU is 3.3V.Even if it is in the open drain state, it will flow 0.23 mA.This is thought to be the influence of the protection diode as in MAX's mail.I do not want current to flow through the pull-up resistor in the open drain state.With STM32 MCU, can not you do something like this?Thank you.2017-05-31 08:23 PM
Supplement.
Supplement the case of INPUT setting.
The INPUT setting pin is connected to 5 V across a 1.5 KΩ resistor.(It pulled up with 1.5 KΩ)The power supply of the CPU is 3.3V.In this case, the current value is zero.It seems that the protection diode is released.With INPUT setting, will the breakdown occur even if the pull-up resistor is connected at 5 V?
Thank you.
2017-05-31 10:20 PM
Are you sure the internal pull-up or pull-down are disabled?
they are not compatible with 5V operation and create a path to Vdd.
2017-06-01 03:23 AM
Advice, thank you.
According to MAX's advice, the following items were found out.
<mbed>
(1) Setting example 1
In the description below, an internal pull-up resistor is attached. Current flows.PA_12.mode (OpenDrain);(2) Setting example 2
In the description below, normally open drain setting is possible.PA_12.mode (OpenDrain);P_12.mode (PullNone);However, in the case of periodically outputting Low output, internal resistance is attached and it does not become open drain.
<STM 32 Cube MX + Keil uVision 5>Open drain setting is OK.<Discussion>
There is a malfunction in mbed's open drain setting library.Please correct mbed's STM32L053 library.Thank you.
2017-06-01 09:13 PM
Hi,
It is self-follow.
Yesterday I reported that there was a problem with open drain setting on mbed.
I found a countermeasure.I will show you how to deal with it.NG example
///////////////////////////////////////////
&sharpinclude 'mbed.h'DigitalInOut Common_7(PA_12);
int main() {
while(1) {Common_7.output();
Common_7 = 0; wait_ms(2); Common_7.mode(OpenDrain); Common_7.mode(PullNone); Common_7 = 1;}}///////////////////////////////////////////OK example///////////////////////////////////////////
&sharpinclude 'mbed.h'DigitalInOut Common_7(PA_12);
int main() {
while(1) {Common_7.output();
Common_7 = 0; wait_ms(2); Common_7.input(); Common_7.mode(OpenDrain); Common_7.mode(PullNone); Common_7 = 1;}}///////////////////////////////////////////Please set INPUT before setting open drain.By doing this, I found that the internal pull - up resistor can be released.I think that there is a problem with the mbed open drain setting library of STM32L053.
Please correct the STM32L053 library by all means.Thank you.