You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I was just playing around with adding a 'set clock frequency' command on the Espruino Boards.

    Thought you might be interested in these figures - they're the idle power consumption of the Pico board.

    • Default - 84Mhz - 9.6mA
    • 42Mhz - 6.8mA
    • 24Mhz - 5.4mA (but USB is unusable)
    • 120Mhz - 11.8mA

    It looks like you can overclock it to 120Mhz as-is, so quite a speed boost. And if you have something that requires Espruino idle (eg. Serial data, or PWM) you can half consumption by slowing it down.

    So now comes the question... In order to change speed, you have to tweak different multipliers and divisors, which is pretty chip-specific. If I don't expose those then you only have a few choices of clock speed (and only on some boards) because Espruino will try and keep USB working (realistically 120Mhz and 42Mhz are the only frequencies with usable USB though) - but it's easy.

    However I could allow you to specify the divisors and multipliers - for example: E.setFreq({m:16, n:384, p:8, q:4}).

    This is a bit more painful but we can document a few that work or can put them in a library - and the people that like fiddling with their microcontroller can really fiddle. Nothing to stop you running down to 1Mhz or less if you don't care about USB, or perhaps fiddling with regulator voltages and flash latencies and running it at 168Mhz.

About

Avatar for Gordon @Gordon started