Powering M5Stamp C3U without USB?
-
Hi!
I'm just getting started with microcontrollers and got the M5StickC Plus and M5Stamp C3U.
The M5Stick has 5Vin and 5Vout pins, and I can power it on by connecting a 5V supply to the 5Vin pin, but the M5Stamp doesn't have a 5Vin pin. Connecting the supply to the 5V pin doesn't seem to power it up.Is there a way to power the M5Stamp without using the USB connector?
Thanks!
-
Hello @125millibytes
what makes you believe the M5StampC3U doesn't run when powered via 5 V and GND pins?
I've loaded a simple LED blink example to my M5StampC3U and the LED blinks just fine when powered via 5 V and GND pins.
Thanks
Felix -
I didn't upload anything yet to the M5Stamp, it was just running the default RGB LED example. The LED lights up and when you push the button on G9 it changes to a random color. I assume this is the program that is loaded by default: https://github.com/m5stack/STAMP-C3/blob/master/idf/RGB_LED_Control/main/main.c
This only happened when it was connected to USB, not 5V and GND pins.
Thanks!
-
Hello @125millibytes
hmm, not sure then what might be the difference between your and my setup.
I've just reloaded the stock firmware and it runs fine as well when powered by 5 V and GND.
After applying power, have you tried the reset button?
Thanks
Felix -
Yes I did press the reset button. I can even measure 5V at the USB Port when the power supply is connected to 5V/GND pins. I can also measure continuity between the USB 5V pin and the other 5V pins...
I guess it's a software issue... I'll try upload another program
Thanks for the help!
edit: PlatformIO doesn't find the device... it's not at /dev/ttyUSB* like the m5Stick
edit2: I didn't read this before I ordered...Note: The newly updated C3U shares the same features as C3, but the difference is that M5Stamp C3U without the USB download chip and the program download method is different (The C3U uses the ESP32-C3's built-in USB Serial for program download)
So I have to figure out how to make that work...
edit3:
OK I figured it out, I think. You have to hold the G9 button while the chip powers on (push reset or plug in power) to enter USB CDC mode. Then this platformio.ini worked for me:[env:m5stack-stamps3] platform = espressif32 board = esp32-c3-devkitm-1 framework = arduino upload_port = /dev/ttyACM0 monitor_speed = 460800 build_flags = -D ARDUINO_USB_MODE=1 -D ARDUINO_USB_CDC_ON_BOOT=1
After uploading once, because of the "CDC_ON_BOOT" option, it goes into the CDC mode automatically without holding the button.