PullNone input mode not working as expected?

Hi all - thanks in advance for any help or suggestion.

I’m referring to the schematics below, used for level conversion of a Nucleo L432KC board 3.3v logic to 5v, for an external old CMOS circuitry sharing in and out on a single line (CONV_OUT). Please don’t ask why conversion is done like that. Let me just say it’s for a project now on PCB, so relatively hard to change…

Setting the input pin mode to “pull none”:

DigitalIn             in_D_OUT    (PC_1); 
DigitalOut        out_D_OUT   (D11);     
...
in_D_OUT.mode(PullNone);

Then, setting the output pin values, I measure on CONV_OUT:

out_D_OUT = 0 --> 0.00 V
out_D_OUT = 1 --> 3.76 V

I expected the high level to be about 4.3 V (considering the 0.7 drop over the diode), while it’s actually much lower than that. This unfortunately is not enough, for a reliable behavior on the external device.

Irrespective of how I set in_D_OUT.mode ( PullNone, PullUp, PullDown ), I always get out 3.76 V high level.

Only if I physically UNPLUG the in_D_OUT pin from Nucleo, I get the expected levels:

out_D_OUT = 0 --> 0.0V
out_D_OUT = 1 --> 4.33V

I thought “PullNone” mode to be equivalent to virtually unplugging the GPIO pins, but that does not seems to be the case.

Am I doing, or evaluating, something wrong?

I noticed an (old) answer to a somewhat related question:

https://os.mbed.com/questions/80894/DigitalIn-ve-DigitalOut-modes/

saying possible pin modes are:

typedef enum {
    PullNone          = 0,
    PullUp            = 1,
    PullDown          = 2,
    OpenDrainPullUp   = 3,
    OpenDrainNoPull   = 4,
    OpenDrainPullDown = 5,
    PushPullNoPull    = PullNone,
    PushPullPullUp    = PullUp,
    PushPullPullDown  = PullDown,
    OpenDrain         = OpenDrainPullUp,
    PullDefault       = PullNone
} PinMode;

In that case, I’d try

OpenDrainNoPull

My doubt is whether the pin mode settings apply to both the output and input parts of the GPIO port, even if I set it for an pin defined as DigitalIn?

thanks
Fabio

“PullNone” just means it floats about as nothing to pull it to ground or nothing pulling it up to Vcc.

Exactly, so, with a PullNone, I expected in_D_OUT not to influence the behaviour of the level converter on out_D_OUT.
That is not the case, looks like.