M5 StickC Plus2 Grove port not working
-
I am trying to use the grove port on my M5 StickC Plus2 boards but they are not working. Ground is fine, I have 5V on the 5V pin, G33 shows 3.3V when I set it to output high, but G32 only shows 0.89V when set to high. I have tested 2 M5 sticks and they both have this problem. Has anyone else encountered this or know how to fix this problem?
-
@A0Cyber What language/IDE are you using?
I have a Plus2 and use Arduino IDE if that is helpful. -
Hello @A0Cyber
both GPIO32 and GPIO33 work for me in UIFlow2. Please find an example in the Project Zone called: M5StickCPlus2_GPIO32_GPIO33_ON_OFF_UiFlow2.2.0
If you are using Arduino instead then could you share your code?Thanks
Felix -
@teastain I am using Arduino and Arduino IDE as well. However, I wasnt able to use the grove Port A for I2C in UI Flow 2 either.
I started with this code to do an I2C wire scan. It returns Error 5 at all addresses, No I2C devices found when I have I2C devices connected.
#include <Arduino.h> #include <Wire.h> // Board Pin Definitions #define PIN_POWER_HOLD 4 #define PIN_LCD_BL 27 //Internal I2C BUS 6-Axis posture sensor (MPU6886) & RTC (BM8563) #define PIN_INTERNAL_SDA 21 #define PIN_INTERNAL_SCL 22 //Grove Connector I2C BUS (Port A) #define PIN_GROVE_SDA 32 #define PIN_GROVE_SCL 33 void wireScanTest() { Wire.begin(PIN_GROVE_SDA, PIN_GROVE_SCL, 400000); //Wire.begin(PIN_INTERNAL_SDA, PIN_INTERNAL_SCL, 400000); byte error, address; int nDevices = 0; delay(5000); Serial.println("Scanning for I2C devices ..."); for (address = 0x01; address < 0x7f; address++) { Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.printf("I2C device found at address 0x%02X\n", address); nDevices++; } else if (error != 2) { Serial.printf("Error %d at address 0x%02X\n", error, address); } } if (nDevices == 0) { Serial.println("No I2C devices found"); } } void setup() { pinMode(PIN_POWER_HOLD, OUTPUT); digitalWrite(PIN_POWER_HOLD, HIGH); pinMode(PIN_LCD_BL, OUTPUT); digitalWrite(PIN_LCD_BL, HIGH); Serial.begin(115200); wireScanTest(); } void loop() {}
So I made this to test the pins and i get the strange voltage on pin 32.
#include <Arduino.h> #include <Wire.h> // Board Pin Definitions #define PIN_POWER_HOLD 4 #define PIN_LCD_BL 27 //Grove Connector I2C BUS (Port A) #define PIN_GROVE_SDA 32 #define PIN_GROVE_SCL 33 void setup() { pinMode(PIN_POWER_HOLD, OUTPUT); digitalWrite(PIN_POWER_HOLD, HIGH); pinMode(PIN_LCD_BL, OUTPUT); digitalWrite(PIN_LCD_BL, HIGH); pinMode(PIN_GROVE_SDA, OUTPUT); digitalWrite(PIN_GROVE_SDA, HIGH); pinMode(PIN_GROVE_SCL, OUTPUT); digitalWrite(PIN_GROVE_SCL, HIGH); Serial.begin(115200); } void loop() { delay(5000); digitalWrite(PIN_GROVE_SDA, LOW); digitalWrite(PIN_GROVE_SCL, LOW); delay(5000); digitalWrite(PIN_GROVE_SDA, HIGH); digitalWrite(PIN_GROVE_SCL, HIGH); }
-
@felmue I looked at the example . Thanks for that. I created something similar in Arduino for my testing earlier.
-
Hello @A0Cyber
your I2C scan code works for me (internal and Grove).
Internal I get:Scanning for I2C devices ... I2C device found at address 0x51 I2C device found at address 0x68
Grove (with ENV IV attached) I get:
Scanning for I2C devices ... I2C device found at address 0x44 I2C device found at address 0x76
and your Groove GPIO test works for me as well, both GPIO32 and GPIO33 toggle between 0 and 3.3 V.
Just to clarify; does the internal I2C scan work with your M5StickCPlus2?
If yes, then the failing Grove I2C scan and the GPIO test showing a too low voltage on GPIO32 would indicate that GPIO32 got damaged somehow.
But then again, you tested with two M5StickCPlus2 and they both exhibit this behavior, so I am not sure.
Thanks
Felix -
@felmue The internal I2C bus scan works for me, I get the same result as you for that one. But the grove Port A fails with the low voltage on pin 32. I can even use jumper pins to run I2C devices from the top header by using jumper cables. I tested it with 2 brand new StickC Plus2 so the chances that both of them were damaged in the same way by me is unlikely. I am also somewhat experienced with ESP32 and other microcontrollers. I am out of ideas, I guess I can try to contact M5 support.
-
@A0Cyber Your code works on my Plus2!
Both pins 32 and 33 normal 3.3V.
Sorry. -
@A0Cyber
Maybe this is a potential circuit design problem. Can you tell me all the hardware operations you have done? I'm gonna have a test