Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Elektron
    • Continue chat with Elektron
    • Start new chat with Elektron
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    Elektron

    @Elektron

    1
    Reputation
    1
    Posts
    375
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Elektron Follow

    Posts made by Elektron

    • RE: How to power M5Core2 from module?

      It didn't work for me as well using PLC-M12 module, but I fixed it!

      I found the code change of SetBusPowerMode() @felmue wrote, which did not work for my new core2 modules.
      Dug into the datasheet and found GPIO0 connected to VBUSENABLE must be 0V.
      In the code below the GPIO0 is set to open drain output(=pull down only) and set to Low=0V.

      I've changed the AXP192.cpp file directly in C:\Users\user\OneDrive\Documents\Arduino\libraries\M5Core2\src
      To make it work. Good luck.

      // Select source for BUS_5V
      // 0 : use internal boost
      // 1 : powered externally
      void AXP192::SetBusPowerMode(uint8_t state)
      {
          uint8_t data;
          if (state == 0)
          {
              // Set GPIO to 3.3V (LDO OUTPUT mode)
              data = Read8bit(0x91);
              Write1Byte(0x91, (data & 0x0F) | 0xF0);
              // Set GPIO0 to LDO OUTPUT, pullup N_VBUSEN to disable VBUS supply from BUS_5V
              data = Read8bit(0x90);
              Write1Byte(0x90, (data & 0xF8) | 0x02);
              // Set EXTEN to enable 5v boost
              data = Read8bit(0x10);
              Write1Byte(0x10, data | 0x04);
          }
          else
          {
              // Set EXTEN to disable 5v boost
              data = Read8bit(0x10);
              Write1Byte(0x10, data & ~0x04);		
      		
              // Set GPIO0 to low, enabling VBUS supply from BUS_5V
      	// GPIO0 open drain output
              data = Read8bit(0x90);
      	Write1Byte(0x90, (data & 0xF8));
      	// set GPIO0 to 0
              data=Read8bit(0x94);
      	Write1Byte(0x94,data&=~1);
           }
      }
      posted in UIFlow
      Elektron