Wisblock stops running randomly

I am building a solution using Wisblock base, RAK4630, 4-20mA RAK5801 sensor, RAK1901 temp sensor, RAK1921 OLED display, and a third-party SPI PCF8574 8-bit digital IO module.

I have built multiple of these devices without the PCF8574 unit, and have connected wires to the Wisblock SPI pins to control the OLED. These units are working perfectly.

In the most recent unit I am building, we need more digital IO pins, so I procured some third party PCF8574 devices which also connect to SPI. I attempted to use the SPI connections on the 4-20mA RAK5801 module, instead of soldering directly to the Wisblock base SPI pins.

A problem occurs: when attempting to run the unit, it appears the entire system STOPS running until I touch the Wisblock IO2 pin with my finger or a conductor. Then it begins running, serial output works, the SPI devices work, etc. However, when the touch is removed, the whole unit stops running within a few seconds: SPI OLED display goes dark, serial stops outputting data over USB, etc.

I rewired the unit moving the SPI wires to the Wisblock onboard SPI pins and this problem went away: the unit is now running correctly.

I understand that touching the pin is adding capacitance, which may be helping to filter out noise, but why does this only happen when touching the IO2 pin? It doesn’t help to touch the VDD or GND pins or IO1, and why would this occur when using the RAK5801’s SPI pins, but not when using the Wisblock base onboard SPI pins?

Thanks for any insight to this weird problem!

Are you actively driving IO2?

How do you power the PCF8574?

If you are using the 3V3 on the RAK5801 connector, this is connected to 3V3_S.
3V3_S needs to be enabled by setting IO2 to high.

pinMode(WB_IO2, OUTPUT);
digitalWrite(WB_IO2, HIGH);

Yes I was using 3V3 to power the SPI devices. I was not setting IO2 high, as my previous project was using IO2 as an input.

Per the Wisblock Base documentation, IO2 is used for 3V3 enable, but IO1 is general IO, but appearently IO1 is then taken over by the RAK5801 4-20mA sensor and used to enable/disable the 12VDC voltage boost converter. Since I needed to control the 12VDC output, I used IO1 for this purpose, assuming IO2 was a general purpose IO.

This is somewhat confusing… so does that mean when using the RAK5801, there are NO general purpose IO pins available for use? Or can we still use the IO2 as general purpose IO, as long as we don’t also use the 3V3 output?

Since I have added the PCF8574, I don’t need built-in IO pins, but for the prior devices I built, I only needed 1 GPIO input, thus was using IO2, and not using the 3V3 line on RAK5801. Am I doing this right?

Thanks,
Ryan

WisBlock has only 6 (or 7, depending on the Core module) GPIO’s.
They are shared between all slots (A-D and IO) so you have to look always which IO’s are used by which modules.

On the older IO slot modules (like the RAK5801) unfortunately IO1 and IO2 are used a lot, a practice that we changed on the newer modules.

As long as you do not need to control 3V3_S, you can still use IO2 for other purpose.

We have an IO Mapper which is at least covering the older modules, an update is on its way.

That’s pretty neat! Thanks for sharing it!