cancel
Showing results for 
Search instead for 
Did you mean: 

Can 5 V tolerant pin be turned off?

Nobuhide Iinuma
Associate II
Posted on May 30, 2017 at 11:26

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 1

In the open drain setting, does the protection diode work?0690X00000607AWQAY.png

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-tolerant
6 REPLIES 6
Max
ST Employee
Posted on May 31, 2017 at 04:43

Hello,

If you turn off the

GPIO, you will not get the

LOW

level state anymore...

the current you are talking about only exists when the output is set to

 

LOW

level.

When the output is set to

OD

 

HIGH

level, 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

V

DD_FT

 

and

GND.

The mbed configuration looks right to me...

Posted on June 01, 2017 at 02:58

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.
Posted on June 01, 2017 at 03:23

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.

Posted on June 01, 2017 at 05:20

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.

Posted on June 01, 2017 at 10:23

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.

Posted on June 02, 2017 at 04:13

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.