I have a problem setting the PullUp and PullDown internal resistors on a Nucleo board (I have tested only the F103 since it is the only board I own). It looks that, when I set the PullUp and PullDown resistors on a pin, then there is no way (other than resetting the device) to return back to PullNone.
I explain better when an example. I have two Digital Input pins (PA_0 and PA_1) that have been short circuited on the board.
DigitalIn pin_0(PA_0);
DigitalIn pin_1(PA_1);
At the device power-up both input pins are set to PullNone by defaults. Then if I execute the instruction:
pin0.mode(PullUp);
the voltage at the two pins is 3.3V (the pullup resistance has been correctly set on pin0). Then I execute the following instruction:
pin1.mode(PullDown);
and the voltage at the two pins is around 1.8V - 1.9V (the pulldown resistance has been correctly set at pin1). However, if I execute the following instruction:
pin0.mode(PullNone);
the voltage at the two pins remains at 1.8V - 1.9V and is not 0V as could be expected by removing the pullup resistance on pin0 and leaving enabled the pulldown resistance on pin1. Once the pullup or pulldown resistance has been set on a particular pin, it looks not possible to change back to PullNone (but it is possible to switch between pullup and pulldown).
Can anyone know a workaround to remove the pullup or pulldown resistances once set other than resetting the device?
Thanks.