Skip to main content
Graduate II
June 6, 2024
Solved

How can I provide a 1Mhz HSE Byp clock for low power... without wasting more power than I save??

  • June 6, 2024
  • 7 replies
  • 5041 views

Hi all,

 

I've been working on reducing the power consumption of a project I'm working on using the STM32G431.

Stop modes are not an option on this chip since I need to keep some peripherals active, but I've been

able to reduce the needed system clock to below 1Mhz, and use the LP-Run/Sleep modes exclusively.

 

I've gone as far as I can in terms of reducing overall frequency. According to the CubeMx power estimator pane, I can  reduce the power consumption further by about 75% by avoiding the use of a crystal and supplying an external clock

signal instead. This so-called "HSE Bypass" mode powers down the oscillator circuit as well as the PLL. 

 

But I've run into a wall in implementing this. If I can't use a crystal, what do I put on the board to generate my (say, 1Mhz) clock? I don't have an FPGA or a big-brother CPU on the board to provide the clock. And to add one would negate the power savings several times over (to say nothing of the BOM cost). 

 

I've searched for dedicated clock generators, but what I've found so far seems to aim at much higher frequencies and still requires 10x the power used by the G431 to run.

 

Are there any jellybean chips/solutions for this? basically, I need an IC that generates a (say) 1Mhz clock while consuming only 10-100uA. 

 

[Edited for clarity]

    This topic has been closed for replies.
    Best answer by AScha.3

    So why not just try with HSE crystal, 4MHz , and check real world value then ?

    AScha3_0-1717939413657.png

    Or with hse-bypass, maybe the lowest possible consumption (if no crystal precision needed) :

    584-C6930IMS88.00TPF (mouser) 

    AScha3_1-1717941297754.pngAScha3_2-1717941466100.png

    So you can expect about 150uA at 1MHz setting for this kind of micro-power-osc.

    7 replies

    Super User
    June 6, 2024

    @BarryWhit wrote:

    I've gone as far as I can in terms of reducing frequency. 


    Very often, a more effective strategy is to have the chip run quickly, and sleep more.

    Do those peripherals really need to be constantly active?

     


    @BarryWhit wrote:

    Are there jellybean chips out there dedicated to generating a (say) 1Mhz clock while consuming only 10-100uA?


    Have you looked at Silicon/MEMS oscillators?

    eg, https://www.sitime.com/solutions/internet-of-things-iot 

    See also:

    https://www.st.com/resource/en/application_note/an2867-guidelines-for-oscillator-design-on-stm8afals-and-stm32-mcusmpus-stmicroelectronics.pdf

     

    BarryWhitAuthor
    Graduate II
    June 6, 2024

    Hi @Andrew Neil,

    > Very often, a more effective strategy is to have the chip run quickly, and sleep more.

     

    Actually, when you scale HCLK way down, the power consumption gap between LPRUN  and LPSLEEP

    is only about 20uA (out of say 160us).

     

    Do those peripherals really need to be constantly active?

     

    I need the DMA to feed the DAC every 20us. that's on the order of the wakeup times for STOP modes, so that doesn't seem worth persuing. With a newer sexier chip like the u5 (and LPDMA), I possibly could employ deeper LP modes, but for now I'm focused on getting as far as I can with the G431.

     > See also an2867-guidelines-for-oscillator-design

     

    HSE Bypass specifically means using an external clock signal (i.e. a toggling pin) instead of an oscillator/ceramic resonator. 

     

    > Have you looked at Silicon/MEMS oscillators?

    This is interesting. They do claim to use drastically less power. but I'm not sure if what the power estimator reports is due to the STM32's own circuitry, or due to the crystal oscillator itself. Is it possible that crystal oscillator consume significant power, apart from the MCU? i thought they just... "vibrated and stuff".

    Graduate II
    June 6, 2024

    If you do not need high accuracy and low jitter for your clock, consider to run from 2^15 quarz or oscillator .
    "When a 32.768 kHz clock source is available in the system (LSE), the MSI frequency can be automatically trimmed byhardware to reach better than ±0.25% accuracy."

    Super User
    June 6, 2024

    Some of the modern MEMS oscillators? These are no jellybeans, though.

    Btw. are you aware of the minimum PLL frequency being 2.6MHz?

    OTOH, do you need crystal precision? HSI16 (perhaps trimmed e.g. to LSE) wouldn't suffice?

    JW

    BarryWhitAuthor
    Graduate II
    June 6, 2024

     

    > Btw. are you aware of the minimum PLL frequency being 2.6MHz?

     

    Doesn't HSE Bypass..... bypass the PLL altogether? I didn't plan to use it. I think the power reduction is partly

    by powering down the PLL (as well as the oscillator amplifier circuit).

    I figured I'd either get a programmable/fixed source at the rate I want, or something in the 1-2-4Mhz range,

    and just use the AHB clock divisors. No PLL necessary.

     

    > OTOH, do you need crystal precision? HSI16 (perhaps trimmed e.g. to LSE) wouldn't suffice?

    According to the power estimator, HSI16  does not provide anywhere near the same power reduction as HSE bypass.

     

    Funnily enough, after chasing down all kinds of 90s relics the only viable solution I've come up with is to use a modern variant of the 555. The LMC555 from TI is programmable up to 3Mhz and draws somewhere between 130-250uA. That should work. Of course, it relies on an RC circuit for timing so with "civilian" component tolerances that would mean about a 2% variation in frequency at least. I could probably live with that, but it's not ideal.

     

    Even more strange is the fact that there *used* to be such an IC. The Harris HA7210 (1996) (Harris->Intersil->Renesas). According to the datasheet, it used a crystal oscillator as an input but only consumed 100uA at 1Mhz. It's an EOL part and I've found no replacements with Active Status so far.

     

    Graduate II
    June 7, 2024

    HSE_BYPASS does not bypass the PLL, only the internal oscillator circuit.

    Graduate II
    June 7, 2024

    Yes, but the MCU can clock directly from HSE it doesn't need the PLL. Other peripheral might need the PLL, like SDIO on F4

    Graduate II
    June 7, 2024

    PIC micro controller has internal clock. You can add external crystal aswell. There are some ultra low-power devices 8 pin devices. For example pic16lf15325, it is stated to consume 30ua/Mhz. Operate at the lowest possible Vcc...

    Super User
    June 7, 2024

    > According to the power estimator, HSI16 does not provide anywhere near the same power reduction as HSE bypass.

    HSE with 8MHz crystal consumes around 500uA typ, according to the DS, while HSI16 around 155uA typ 190uA max. You want to divide the AHB accordingly to run the rest of the mcu at the same frequency (say 2MHz), in order to get them into the same consumption level.

    HSE bypass does not consume anything, but the external oscillator does, and it will be in the 150uA ballpark.

    You can try all these options first-hand using a cheap Nucleo board.

    > Funnily enough, after chasing down all kinds of 90s relics the only viable solution I've come up with is to use a modern variant of the 555. The LMC555 from TI is programmable up to 3Mhz and draws somewhere between 130-250uA.

    That's static consumption. I am curious how much would operating it at 1-2MHz add to this, and how much would be the current spent in the external RC circuitry.

    > Even more strange is the fact that there *used* to be such an IC. The Harris HA7210 (1996) (Harris->Intersil->Renesas). According to the datasheet, it used a crystal oscillator as an input but only consumed 100uA at 1Mhz. It's an EOL part and I've found no replacements with Active Status so far.

    Interesting, but, as you've said, gone.

    With enough design effort, you may be able to design a low-power crystal oscillator from discretes.

    There's also interesting but generally unusable (expensive, non-crystal-precision) LTC6906.

    JW

    Graduate II
    June 7, 2024

    You should consider running with a 2^15 oscillator as LSE and correct MSI with that. E.g. SIT1533 has 20 ppm frequency offset maximum and runs at 1.4 uA max.

    Super User
    June 7, 2024

    @Uwe Bonnes 

    The 'G4 does not have MSI.

    Otherwise, I agree, the autotrimmed MSI in 'L4/'L5/'U5/? sounds like a great option. According to 'L432 DS MSI at Range 5 i.e. 2MHz consumes max.9uA.

    So far we don't know what design requirements drove the choice of 'G4. It may not be the best starting point for low power design, but it may have other required features.

    JW

    Super User
    June 7, 2024

    > I'd be very happy with any IC or circuit that can generate a 1Mhz *Clock* with crystal (rather than RC-constant) accuracy, and consumes 150uA.

    As mentioned several times, the MEMS oscillators' consumption is in this ballpark, or below.

    > If you're able to suggest a part number, please do.

    No particular part, sorry.

    > In particular, the power estimator says that HSI16 (or indirectly via the circuitry involved in employing it) would consumes roughly 600uA in my design, and not 150uA as you suggest (based on the DS).

    I don't know where did it get that figure from.

    > Since my design can run at 400Khz, running at 1Mhz would be wasteful.

    So is it 2MHz, 1MHz or 400kHz... You keep changing your requirements.

    I don't really care, it's your design; but perhaps you may want to establish some basic setup, perform a couple of real-world experiments e.g. using a cheap Nucleo, and evolve your project from that.

    JW

    BarryWhitAuthor
    Graduate II
    June 9, 2024

    > As mentioned several times, the MEMS oscillators' consumption is in this ballpark, or below.

     

    We're having a failure to communicate here, and I would guess we're both getting frustrated by it.

    Yes, I accept the advice given, that high-end crystals that consume very little power (as loads of the SMT32 circuitry) are available. But, they are not a solution If the STM32 crystal amplifier itself consumes 200x as much power as the crystal.

    I don't know enough about crystal circuits to judge, but that's what ST's own power estimator suggests. 

     

    If your suggestion is to use one of this crystals and build a discrete amplifier circuit to turn it into a clock, that's certainly something I can look into, though I'd much prefer (and expect there to exist) some chip to do it for me. That seems like a finicky and specialized piece of engineering. I suppose I could look into appnotes from crystal vendors. Assuming the prices aren't a non-starter.

     

    So is it 2MHz, 1MHz or 400kHz... You keep changing your requirements.

    ... because It doesn't matter. My requirements are not for a particular clock frequency. All I need is to generate an external clock with good accuracy and low power-consumption that can be divided into something close to my target frequency.

    Since the G4 supports ratios /1 /2 /4 /8 /16,  a 2Mhz Clock divided by 4, or a 1Mhz Clock divided by 2, or an undivided 0.5Khz clock - they would all work for me.

    perhaps you may want to establish some basic setup, perform a couple of real-world experiments <>, and evolve your project from that.

    I've been developing on a low-cost 3rd party dev board. ST has integrated power measurement equipment in the STLINK3-POWER, but I don't have one currently.  That would have enabled me to measure the HSI16 power consumption at low frequencies to see if the power estimator is right (there's a large penalty for using a crystal instead of an external clock) or wrong.

     

    Perhaps someone on the thread has the equipment to resolve this or knows who to Ping at ST for an authoritative answer?

    Graduate II
    June 9, 2024

    The authorative answer is the datasheet. The power estimator is some implementation based on the datasheet, but may be wrong implemented. For HSI16 , max current is 190 uA in the datasheet. Clock down HSI16 with the AHB prescaler and this is probably the best you can do with STM32G4. Resonsider a low power family is you need even lower current, lik U0 or U5.

    BarryWhitAuthor
    Graduate II
    June 21, 2024

    ST has replied to questions I posted following this discussion. That thread is 

    Question: Power consumption and clock sources for low power modes in G4 family 

     

    The gist is:

    1. The power consumption associated with HSI is not 190us, because associated circuitry needed for using it raises that figure considerably.

    2. The datasheet does provide information about the power consumption when using external crystals, but in a separate table, not as part of the run mode current consumption tables. 

    3. the Power Consumption Calculator tool in CubeIDE is an extended version of the datasheet tables

    4. HSE. Bypass (i.e external clock) does provides the lowest power consumption overall in Low-Power modes, assuming the external clock source doesn't use up much power (and others have identified suitable solutions for achieving this in this thread).

     

    My thanks to everyone who offered advice and suggestions.

     

    Update:

    Not strictly about my question, but a recommended read for anyone working on low-power:

    ST Post: Tips for using stm32 low power modes