Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    CPU Frequency

    Scheduled Pinned Locked Moved Discussion
    firmwarepower saving
    7 Posts 2 Posters 2.6k Views 2 Watching
    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.
    • M Offline
      mcook
      last edited by mcook

      Hi All,

      On the LoPy, I'd like to set the CPU frequency to 8 Mhz to see if it has an effect on power consumption. I am building and deploying the firmware, using the source code here: https://github.com/pycom/pycom-micropython. I can't easily find the place in the code where the 16 Mhz clock speed is currently being set.

      Does anyone know what to change to bring the clock down to 8 Mhz.

      Are there any other optimizations folks know that I can do to bring the power consumption down? Currently, with WiFi and BT off, the power consumption is ~50 mA. When awake, this adds up, and I'd like to get it down to about 20 mA.

      Mike

      1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino
        last edited by jmarcelino

        @mcook said in CPU Frequency:

        https://github.com/pycom/pycom-micropython

        The clock speed is actually 160Mhz (down from maximum 240Mhz it can operate at)

        You could try changing #define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 160 in sdkconfig.h but I'm not sure what else that might impact or if reduces power consumption in any significant way. Let us know :-)

        50mA does seem a bit high with WiFi+BT off, is that on 3.3V? How are you powering it?

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          mcook @jmarcelino
          last edited by

          @jmarcelino said in CPU Frequency:

          CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ

          Hi,

          I am powering it via USB, using the expansion board.

          After updating sdkconfig.h to #define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 80, machine.freq() still reports 160000000.

          Wondering what else needs to change.

          Mike

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @mcook
            last edited by

            @mcook

            Are you building the source from https://github.com/pycom/pycom-micropython-sigfox ?

            Just noticed you wrote https://github.com/pycom/pycom-micropython which is a very old version, don't use it.

            M 1 Reply Last reply Reply Quote 0
            • M Offline
              mcook @jmarcelino
              last edited by

              @jmarcelino

              Sorry. Yes. I am using the https://github.com/pycom/pycom-micropython-sigfox source. I was incorrect in my previous post.

              Still attempting to figure out what else I need to change.

              Mike

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                jmarcelino @mcook
                last edited by

                @mcook
                I think the configuration changed, try removing the

                #define CONFIG_ESP32_DEFAULT_CPU_FREQ_160 1

                line and replace it with

                #define CONFIG_ESP32_DEFAULT_CPU_FREQ_80 1

                M 1 Reply Last reply Reply Quote 0
                • M Offline
                  mcook @jmarcelino
                  last edited by

                  @jmarcelino said in CPU Frequency:

                  I changed it, but got the same results.

                  Mike

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 1 / 1
                  • First post
                    Last post

                  Pycom on Twitter

                  Pycom