Nano33 GPIO issue: pin D9 (specifically!?) somehow misconfigured/unusable in micropython?

Somewhat weird problem: I have an application that happens to need to use nano33 GPIO pin D9 (nrf pin 27) as a digital input, with internal pull down (an external pushbutton switch should pull it up). However: the (open circuit) physical pin seems to be being actively driven to c. 1.5V, regardless of internal pull up or pull down. This seems to affect only D9: I’m not having any problem with any other GPIO pin.

Other GPIOs I have tested (e.g., D8, D7, D6) all seem to work fine, exactly as expected.

First thought is obviously that this is a hardware issue on this specific nano33. However: I have tried two independent nano33 boards, and both show exactly the same behaviour. Further, I have gone back to test in Arduino IDE and D9 on these specific boards works perfectly in the native Arduino (C++) environment.

So not apparently a hardware fault.

If I look at the pin with a scope, there seems to be a signal present, with a DC level of about 1.5V and a superimposed AC at about 20MHz; amplitude is sensitive to the scope probe loading, but if I use x10 (for minimum loading), it’s essentially spanning 0-3.3V:

With probe on x1, it spans about 1-2V. But the DC level is unaffected:

I’m using a picoscope USB digital scope with modest bandwidth, so not absolutely confident in the AC signal properties. There is nothing else connected to the nano33: just on a breadboard. The whole apparent AC signal here may be an artefact - noise coupled in from somewhere. It’s the underlying DC c. 1.5V that is causing the problems!

But nothing I do with machine.Pin() makes any detectable difference to the signal on the scope (configuring as input, with varying pull up or pull down, or even configuring as output!). If I configure as input and read it, it fairly randomly returns high or low (unsurprisingly?). However: it does seem to be accessing the correct physical pin. If I configure as input and tie the pin high or low (as opposed to relying on internal pullup or pull down) then it is read correctly. But there is surely something driving a DC level here: tying either high or low seems to draw about 5mA.

FWIW: if I reset the nano33 back into bootloader mode, D9 goes to 0V, flat. But as soon as I hit reset again and micropython starts running (before even connecting with OpenMV or loading any user script), the signal above appears. So something in the micropython initialisation seems to lead to that.

I’ve tried both the current micropython release firmware (4.3.3) and the overnight development firmware but this makes no difference.

I’m fairly flummoxed; but also currently stuck with a batch of PCBs designed to use D9 on a nano33 that gets mounted into it. So any thoughts or ideas on other things to investigate or try would be greatly appreciated. It is always possible I am missing something completely obvious!


This pin is used for the image sensor reference clock, the sensor module is enabled for this board because there’s a camera kit for it. There’s no function to disable this clock, but it’s driven by I2S, if you can somehow disable that then it should free the pin, if you are okay with rebuilding firmware you can disable the sensor in the board mk file just set MICROPY_PY_SENSOR = 0

Thanks @iabdalkader - great to have an explanation. At the moment I’m working around it with a somewhat hacky hardware mod to use a different pin: but will also try the firmware rebuild as soon as I can.

Just to say that after a couple of false starts, I managed to get set up to rebuild the firmware today; and I can confirm that setting MICROPY_PY_SENSOR = 0 (in src/omv/boards/NANO33/ did resolve this issue for me, and I have D9 working as expected. Thanks again to @iabdalkader