cancel
Showing results for 
Search instead for 
Did you mean: 

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

BarryWhit
Senior III

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]

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.
23 REPLIES 23

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.

@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

Techn, thanks for the idea. The consumption is probably for internal RC (low precision) so need to check what external osc adds. Also, there's probably no dedicated clock out, so this would mean bit-banging a clock in ASM. It's probably deterministic (an 8bit micro is actually quite good for real-time), but feels a bit wonky. Still, an option.

 

Jan,

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

There's been some confusion already about terms, so let's be precise. Oscillator/Resonator/Crystal - to me those terms indicate that you need to involve the STM32 internal circuits in order to care and feed them and the power consumption is punitive. As you know, HSE bypass requires an external *clock*, i.e. a single-sided square-wave signal of reasonable duty-cycle, generated externally.

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. If you're able to suggest a part number, please do.

 

The reason I'm so set on HSE bypass and using an external clock, is that the power estimator claims dramatic power reduction (even including the 100-200uA an external clock would/should/hopefully might consume).

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). See shots below. It's possible the estimator is simply wrong for this corner case. Are you saying I should disregard it as a a bug? It possible the oscillator circuitry's power consumption scales with the frequency of the source. Since the HSI16 input is 16Mhz, even if I divide it later, I still pay the cost at the clock input. I could be wrong.

 

Another concern is that if I'm to avoid the PLL, I can only divide the HSI16 down to 1Mhz or 250Khz for HCLK due to the limited divider ratios (/16,/64) available. Since my design can run at 400Khz, running at 1Mhz would be wasteful. 

 

 

STM32_LP_Compare2.jpgSTM32_LP_Compare1.jpg

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

> 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

> 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?

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

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.

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.

If you feel a post has answered your question, please click "Accept as Solution".

I thought the power estimator must be backed up by numbers in the datasheet, and so I checked:G4_LP_IDD.jpg

As you can see, power consumption is much lower for HSE Bypass than when using the internal HSI16. 

 

Furthermore, although I can't find an explicit statement to this effect in the datasheet,  for LP-run/Sleep modes the power estimator only accepts HSI or HSE Bypass(i.e. external clock) as sources. That suggests to me that using an external crystal in those modes is not even possible. It's divided HSI or external clock only. I could be wrong. (Update: Indeed I was wrong. ST rep confirms HSE crystal can be used in Low power mode. But the circuits supporting an external crystal itself consume appreciable power)

 

And yes, I've considered switching to U5, but the G4 has more analog peripherals which I might want to use.

 

EDIT:

Of the register bit which enables Low-power mode, the RM only states that the clock needs to be no faster than 2Mhz. The Current consumption tables only include fHSE (which I'm assuming is Bypass, since an earlier table claims all clks<48Mhz use HSE Bypass) and HSI as sources. But, the HAL code for switching on LP mode simply flips the bit. It does no checks, and there is no error condition/panic I can detect when I used a <2Mhz clock based on an HSE crystal, so I'm not sure what's going on there and what's the power consumption compared to the above table. A different possibility is that LP modes support an HSE crystal, and HSE Bypass is not mandatoty but, for some reason, HSI16 in LP mode consumes 3x times as much power as using an external crystal. This is all very confusing. Is there no Bat-Signal mechanism to get ST to clarify??

 

 

 

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

@AScha.3 - Bless your heart! Yes, that's exactly what I was looking for. So there's a product category distinction between "Crystal" and "Crystal Oscillator" which I somehow missed. Some distributors put them under "Timers". Others call them Oscillators and the category also includes plain crystals and the majority of parts are older and consume several mA. What LTC calls a "Crystal Oscillator" matches what ST calls an "External clock".

 

The extended LTC69XX family looks promising.

 

I should note that JW did mention the LTC6096 earlier, but suggested it wasn't a good fit and so I didn't follow up. Kudos to him as well.

 

 

 

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

Oscillators | Electronic Components Distributor DigiKey

but start with 1M measure on HSI16 RUN and SLEEP little differ then RUN only is ok measure.