Hi,
I'm new to the M5 platform, but I've got a project where the M5Stack PPS power supply module looks like a pretty good fit for the features we want -- it's a nicely-packaged little programmable 5V power supply. The trick is that the rest of our embedded device stack is built around an STM32 Nucleo-H723ZG dev board, so I'm hoping I can talk to the PPS module via I2C directly instead of using an M5 Core controller.
I've had partial luck attempting this by porting the M5Module-PPS Arduino example code to run on the Nucleo, but I seem to be hitting an odd incompatibility:
I2C communication works during the Arduino setup() phase, but goes wonky during the main loop().
So that's the central mystery. Some additional details:
During setup(), I can query values, configure power output parameters, enable/disable the PPS, etc. Once the main loop() starts, it goes off the rails -- invalid data returns, the PPS sometimes goes into odd modes, and sometimes some IO appears to enter deadlock (e.g. serial print statements stop reporting back to my PlatformIO host)
Note that the same PPS module works fine when I deploy the functionally-identical example code to my M5 Core3 SE controller. So there's clearly some difference between how my STM32 Nucleo is interfacing to it vs how the M5 controller is.
My only real hypothesis thus far has been that I misunderstood the wiring or voltage assumptions (e.g. 3.3V vs 5V), but I think I've verified that is correct (though, I'll admit, I find M5's docs and schematics a bit inconsistent and hard to follow). FWIW, I did some basic probing of the M5 Core3 SE and confirmed that it's I2C pins appear to operate on 3.3V, so that's my working assumption.
What I have wired up now:
PPS I2C pins on the M5Bus header: SCL/SDA pins (as identified on PPS page linked above) connected directly to the STM32's I2C_B interface pins. For reference, these same header pins correspond to the Core3 SE's GPIO11/12 pins AKA intSCL/intSDA on the controller.
PPS GND tied to Nucleo GND
PPS 3V3 pin tied to Nucleo's 3V3 plane
Anyone see something obvious I missed? Or are there some other aspects of interfacing to this thing that I just haven't understood?