DIO Pins not working without UART connected to computer

Hello everyone,

My goal: I am making a simple remote controller with a XBee3, an LCD screen and 6 push buttons.
The idea is to use the i2c to communicate with the LCD screen and 6 DIO to check on the buttons.

The good part: I successfully used the i2c protocol in a micropython program.

the bad part: Out of all 6 DIOs I used, three of them work all the time. The three others only ever work if the xbee-usb-adapter board is plug to a computer and if the XBee REPL python console is connected.

All push button have an 10k pulldown resistor on the input pin. I also set the pulldown in the AT interface, and in the micropython code like this:

start_pin = Pin(“D12”, mode=Pin.IN, pull=Pin.PULL_DOWN)
stop_pin = Pin(“D10”, mode=Pin.IN, pull=Pin.PULL_DOWN)
top_pin = Pin(“D3”, mode=Pin.IN, pull=Pin.PULL_DOWN)
bot_pin = Pin(“D6”, mode=Pin.IN, pull=Pin.PULL_DOWN)
left_pin = Pin(“D2”, mode=Pin.IN, pull=Pin.PULL_DOWN)
right_pin = Pin(“D5”, mode=Pin.IN, pull=Pin.PULL_DOWN)

Only D12, D10 and D3 are working as intended.
D6, D2 and D5, only work while the XBee REPL micropython console is working.

PD = 0xF399

Right now to try to find the problem, i disabled the i2c part of the program and pins.
Nothing has changed.

I will try other pins as well, but I would like to make these ones work nonetheless.

Anyone has a good solution for me?
Thank you in advance.

I also tried:
D0 D9 D4 D8.

Only D4 worked.
So I now have 4 DIO working the rest is a mystery.

There are a set of switches on the board just above the reset button, set them to the off position. That will disconnect them from the PC.

1 Like

Hello mvut!

I am using the switch science xbee explorer board ( SFE-WRL-11812).

I couldnt not find the switches you were talking about but I had a small guess it could come from that board so I bought another xbee adapter to see it changes anything.

I’ll post a comment when I receive it and test it.

EDIT: Also when I test the pins I remove the usb cable and use batteries to make it work. I monitor the DIO value by sending a message to the coordinator when the button is pressed. At that time the board is completely disconnected from the PC.


The Spark Fun Explorer board you are working with will not allow you to disconnect these lines from the PC. You would need to use a board such as the XBIB-CU-TH board for that.

Could you tell me what it means to “disconnect these lines from the PC”?

Right now the XBee3 is on a battery powered device. Completely disconnected physically from the PC. What more do I need to do to “disconnect” DIO D0 D2 D5 D6 D8 D9 from the PC?

Are they left floating or are they connected to something that may be holding them high or low?

Also do you have your Python code set for auto start?

Have you used the AT commands to confirm that the settings for the D-pins are correct? I think “3” means they are set for input?

Is it possible the board you are housing the xbee on is driving the pins via the uart chip?

1 Like

I am setting them with xctu, so as far as AT commands are related they are all on input mode when I use them (and disabled when not).

I am looking at the schematics of the board I bought right now. Only D6 and D8 seems to be connected to the usb chip.

Only D6 and D8 seems to be connected to the usb chip. The rest is floating according to the schematics.

Python is in auto start yes.

You need to set the switches to off for these pins.

Its been awhile…

I received and tested with a board that only have a 3.3V regulator on it.

Most pins are now working as long as I disable their previous functions thru X-CTU or AT commands.

Only DIO13 and DIO14 did not work properly, but I would not recommend using this GPIOs anyway!