WT32-ETH01 GPIO not working as expected

I'm using a WT32-ETH01 board to monitor 9 digital sensors and send the data over ethernet. I am running into problems when reading the digital sensors. I did not have trouble reading them using an arduino board.

#include <Arduino.h>

constexpr int nSensors = 9;
int sensorPins[nSensors] = {
        IO2,
        IO4,
        IO35,
        IO12,
        IO14,
        IO15,
        IO36,
        IO39,
        IO32,
};

void setup() {
    Serial.begin(115200);

    for (int i = 0; i < nSensors; i++) {
        pinMode(sensorPins[i], INPUT_PULLUP);
    }
}

void loop() {
    for (int i = 0; i < nSensors; i++) {
        Serial.print(digitalRead(sensorPins[i]));
        Serial.print(" ");
    }
    Serial.println();
    delay(100);
}

Here is a link for the WT32-ETH01 datasheet: https://files.seeedstudio.com/products/102991455/WT32-ETH01_datasheet_V1.1-%20en.pdf.

According to my interpretation of the datasheet, these pins should be able to be used as inputs.

From this code I would expect all pins to be HIGH, but some start as low, and oscillate back and forth, they appear to be floating.

I have more luck if I configure them as INPUT_PULLDOWN but still not all of the pins behave correctly. They no longer appear to be floating and some pins such as IO02 or IO15 never go HIGH even when directly connected to 3.3V.

Is there any reason I am missing that prevents using this board to do digital reads on at least 9 pins?

Thanks!

Take a close look at Table 2 "Module IO Description" on page 9 of the data sheet. It may be that pullups or pulldowns are not supported for all pins, or that the Arduino core doesn't. You can always add your own pullups.

Thanks for the reply. I also tried using a pull-up / down resistor but still it doesn't work.

If this were my project, I would go through the pins one by one and check which functions (input, output, pullup, pulldown, etc.) are actually supported.

The "datasheet" for the WT32-ETH01 module is minimal to the point of being nearly useless, and I was unable to find a datasheet for the WT32-S1 MCU. Have you had any better luck?

I did this and I manage to get about 5 pins consistently working as expected, other pins behave correctly but are not longer working for some reason.

I guess my only hope is to find someone online that has this exact same board and tried to reproduce this, maybe my board is just defective...

Or, the Arduino core does not properly support options like INPUT_PULLUP.

are not longer working for some reason.

What did you do to cause that change of behavior? Connecting to 5V IO can kill pins on a 3.3V processor instantly, as will trying to light an LED without a current limiting resistor.

Thanks for taking a look. I think this is the most likely explanation, that I somehow damaged some of the IO pins. The example is as minimal as it gets and unless there is some hidden behaviour I am not aware of, this is it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.