🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5stack basic core battery power on issue (ip5306 strange power management)

    Cores
    6
    28
    125.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • m5-docsM
      m5-docs @arzaman
      last edited by

      Hello @arzaman, In order to confirm that if the IP5306 is IIC version on all CORE you have. It's better to download the following testing code.

      https://github.com/m5stack/M5Stack/tree/master/examples/Advanced/I2C_Tester

      M5Stack documentation URL

      https://docs.m5stack.com

      arzamanA 1 Reply Last reply Reply Quote 0
      • arzamanA
        arzaman @liushasha
        last edited by

        @liushasha said in M5stack basic core battery power on issue (ip5306 strange power management):

        This schematic is wrong, every core is used i2c ip5306.

        Really ? I don't know if this is a good or a very bad news...
        having IP5306 with I2C and enable SW control of power management is nice but knowing that the official schematic where I have based the design of my custom HW and development of SW is not the real one really puzzle me !

        this is the official schema on github
        https://github.com/m5stack/M5-Schematic/blob/master/Core/Basic/M5-Core-Schematic(20171206).pdf

        Is there an updated one ? are there other differences ??

        I know that M5Stack is not "open source" but without a real schema quite difficult to mange any HW/FW development

        Davide

        L 1 Reply Last reply Reply Quote 0
        • arzamanA
          arzaman @m5-docs
          last edited by

          @m5-docs Thanks for the suggestion... and you are right my core has I2C version of IP5306 ! Sorry if I miss it

          The bus scan found the IP5306 at address 0x75
          I upload a simple sketch to monito battery level and it works

          0_1557394841048_16b57fcb-ad0f-435d-9d35-eca3088a4578-image.png

          this is good but still don't solve my problem
          -if I power m5 core with USB all ok
          -if I disconnect USB using core bottom battery the core stays on and I can do reset with power on again
          -if I power off (double click) no change to power on again

          anything now that I can modify in IP5306 register to fix the power on ?

          Davide

          m5-docsM 1 Reply Last reply Reply Quote 0
          • m5-docsM
            m5-docs @arzaman
            last edited by

            @arzaman Really sorry about that. I do not clearly know your problem.

            "-if I disconnect USB using core bottom battery the core stays on and I can do reset with power on again
            -if I power off (double click) no change to power on again"

            M5Stack documentation URL

            https://docs.m5stack.com

            arzamanA 1 Reply Last reply Reply Quote 0
            • L
              liushasha @arzaman
              last edited by

              @arzaman I apologize for the misleading on schematics, it is surely our mistake, we didn't well organize all of the material. We are working on it, will have better material come out soon.

              arzamanA 1 Reply Last reply Reply Quote 0
              • arzamanA
                arzaman @m5-docs
                last edited by

                @m5-docs I think we can conclude that is and "HW failure of IP5306" no big issue I can use this core for the lab or for application with no battery

                maybe if you can send me a replacement or tell me where to buy the I2C version of IP5306 I can try to replace by myself

                thanks for the support anyway

                m5-docsM 1 Reply Last reply Reply Quote 0
                • m5-docsM
                  m5-docs @arzaman
                  last edited by

                  @arzaman The IP5306 which is iic version is customized. The best way for you is to ask saler for a replacement or ask our saler for a new core or iic version IP5306. Sorry for the inconvenience !

                  M5Stack documentation URL

                  https://docs.m5stack.com

                  1 Reply Last reply Reply Quote 0
                  • arzamanA
                    arzaman @liushasha
                    last edited by

                    @liushasha no problem...I had an old schema and did not check the note you add to the new one. Your documentation level is quite good and indeed If there is a problem I see there is quite good support on the forum and community ... in a way or another I get the info :-)

                    most important that now I have more understanding of power management and the fact I can control battery via SW is very important (M5stack is perfect for portable applications battery pwered)

                    could be VERY USEFUL a sort of translation of IP5306 Chinese data sheet
                    there are few register that provide info but not able to unerstand the usage !!

                    from various source I undertand that
                    0x78 provides battery level (25/50/75/100)
                    0x71 battery charging level (but not sure)
                    what about the other registers ? what about control register ??

                    simple table with register and functions/value will help a lot "non Chinese" speaking people
                    hope to see soon in the documentation !

                    thanks

                    Davide

                    m5-docsM arzamanA 2 Replies Last reply Reply Quote 0
                    • m5-docsM
                      m5-docs @arzaman
                      last edited by

                      @arzaman Thanks. Your seriousness really touched me.

                      M5Stack documentation URL

                      https://docs.m5stack.com

                      1 Reply Last reply Reply Quote 0
                      • arzamanA
                        arzaman @arzaman
                        last edited by

                        I got also documentation for power management

                        https://docs.m5stack.com/#/en/api/power?id=getbatterylevel

                        clear and comprehnesive

                        all ok issue "solved"

                        Davide

                        ajb2k3A 1 Reply Last reply Reply Quote 0
                        • ajb2k3A
                          ajb2k3 @arzaman
                          last edited by

                          @arzaman said in M5stack basic core battery power on issue (ip5306 strange power management):

                          I got also documentation for power management

                          https://docs.m5stack.com/#/en/api/power?id=getbatterylevel

                          clear and comprehnesive

                          all ok issue "solved"

                          Davide

                          If you are getting an understanding of the power management of the IP5306, would you mind helping me write it up for my book please?
                          You will be credited for the information in the book.

                          UIFlow, so easy an adult can learn it!
                          If I don't know it, be patient!
                          I've ether not learned it or am too drunk to remember it!
                          Author of the WIP UIFlow Handbook!
                          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                          1 Reply Last reply Reply Quote 0
                          • ajb2k3A
                            ajb2k3
                            last edited by

                            As an addendum to this, the IP5306 is available from LCSC
                            https://lcsc.com/product-detail/PMIC-Battery-Management_IP5306_C181692.html

                            UIFlow, so easy an adult can learn it!
                            If I don't know it, be patient!
                            I've ether not learned it or am too drunk to remember it!
                            Author of the WIP UIFlow Handbook!
                            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                            1 Reply Last reply Reply Quote 0
                            • C
                              ckuehnel
                              last edited by

                              Here is a working code example:

                              /*

                              • Test of IP5306 functions
                                */

                              #include <M5Stack.h>

                              void setup()
                              {
                              // initialize the M5Stack object
                              M5.begin();
                              Wire.begin(); // required to access IP5306
                              M5.Lcd.fillScreen(BLACK);
                              M5.Lcd.setCursor(0, 10);
                              M5.Lcd.setTextColor(WHITE);
                              M5.Lcd.setTextSize(2);
                              M5.Lcd.printf("IP5306 Function Test\r\n");

                              if(!M5.Power.canControl())
                              {
                              M5.Lcd.setTextColor(RED);
                              M5.Lcd.printf("No communication with IP5306 chip");
                              while(1);
                              }
                              }

                              void loop()
                              {
                              M5.Lcd.fillRect(0,180,360,60,0);
                              uint8_t bat = M5.Power.getBatteryLevel();
                              M5.Lcd.setCursor(0,180);
                              if (M5.Power.isCharging()) M5.Lcd.printf("Battery is charging\r\n");
                              else M5.Lcd.printf("Battery is not charging\r\n");
                              M5.Lcd.printf("Battery Level %d", bat);
                              M5.Lcd.progressBar(0, 220, 360, 20, bat);
                              delay(5000);
                              }

                              ajb2k3A C 2 Replies Last reply Reply Quote 1
                              • ajb2k3A
                                ajb2k3 @ckuehnel
                                last edited by

                                @ckuehnel Thanks friend.

                                UIFlow, so easy an adult can learn it!
                                If I don't know it, be patient!
                                I've ether not learned it or am too drunk to remember it!
                                Author of the WIP UIFlow Handbook!
                                M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                                1 Reply Last reply Reply Quote 0
                                • C
                                  cepics @ckuehnel
                                  last edited by

                                  @ckuehnel said in M5stack basic core battery power on issue (ip5306 strange power management):

                                  Here is a working code example:

                                  /*

                                  • Test of IP5306 functions
                                    */

                                  #include <M5Stack.h>

                                  void setup()
                                  {
                                  // initialize the M5Stack object
                                  M5.begin();
                                  Wire.begin(); // required to access IP5306
                                  M5.Lcd.fillScreen(BLACK);
                                  M5.Lcd.setCursor(0, 10);
                                  M5.Lcd.setTextColor(WHITE);
                                  M5.Lcd.setTextSize(2);
                                  M5.Lcd.printf("IP5306 Function Test\r\n");

                                  if(!M5.Power.canControl())
                                  {
                                  M5.Lcd.setTextColor(RED);
                                  M5.Lcd.printf("No communication with IP5306 chip");
                                  while(1);
                                  }
                                  }

                                  void loop()
                                  {
                                  M5.Lcd.fillRect(0,180,360,60,0);
                                  uint8_t bat = M5.Power.getBatteryLevel();
                                  M5.Lcd.setCursor(0,180);
                                  if (M5.Power.isCharging()) M5.Lcd.printf("Battery is charging\r\n");
                                  else M5.Lcd.printf("Battery is not charging\r\n");
                                  M5.Lcd.printf("Battery Level %d", bat);
                                  M5.Lcd.progressBar(0, 220, 360, 20, bat);
                                  delay(5000);
                                  }

                                  Hi, doesn't compile for me!!!

                                  this is the arduino IDE output:

                                  Arduino: 1.8.7 (Mac OS X), Board: "M5Stack-Core-ESP32, QIO, 80MHz, Default, 921600, None"
                                  
                                  Build options changed, rebuilding all
                                  /Users/AD/Documents/Arduino/libraries/M5Stack/src/utility/Power.cpp: In member function 'void POWER::powerOFF()':
                                  /Users/AD/Documents/Arduino/libraries/M5Stack/src/utility/Power.cpp:361:28: error: 'gpio_deep_sleep_hold_dis' was not declared in this scope
                                     gpio_deep_sleep_hold_dis();
                                  
                                                              ^
                                  Multiple libraries were found for "SPI.h"
                                   Used: /Users/AD/Documents/Arduino/hardware/espressif/esp32/libraries/SPI
                                   Not used: /Users/AD/Documents/Arduino/libraries/SPI
                                  Multiple libraries were found for "SD.h"
                                   Used: /Users/AD/Documents/Arduino/hardware/espressif/esp32/libraries/SD
                                   Not used: /Users/AD/Documents/Arduino/libraries/SD
                                   Not used: /private/var/folders/f3/0kf10ljj6sj4q4twsw_vtxrw0000gn/T/AppTranslocation/395E70C5-F1F6-4076-AA11-9C132A2C6ACF/d/Arduino 1.8.7.app/Contents/Java/libraries/SD
                                  exit status 1
                                  Error compiling for board M5Stack-Core-ESP32.
                                  
                                  This report would have more information with
                                  "Show verbose output during compilation"
                                  option enabled in File -> Preferences.
                                  
                                  

                                  tnks

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post