# Question on power consumption on S32K1xx

I am using this microcontroller - S32K142 - 64 pins. Core voltage: 5V

I want to know whether the oscillator that we use for the controller would consume any current.

If it consumes current, how to find that? I was not able to find it in the mentioned datasheet.

Question 1 :

Suppose, I use this 8MHz resonator between the pins 11 and 12, how to determine the current consumption due to this resonator?

Question 2 :

What would be the case if I use the internal 48MHz FIRC or some other oscillator?

EDIT :

Question 3 :

Suppose I use the 112MHz as the core clock frequency of the microcontroller i.e.HSRUN mode, from Table 13,I get that, at 25degC, the current due to the oscillator is 112*360uA = 40.32mA? Isn't this a very high value? Am I correct in calculating the oscillator current, this way?

So, If I enable all the peripherals in HSRUN mode, my total microcontroller current consumption would be 52.2mA+40.32mA = 92.52mA. Is this correct?

But I am confused like, what about the current consumption due to FIRC usage(suppose if I use FIRC clock source also)? Suppose, I also use the FIRC module for some other peripherals, say like SPI at 48MHz. What would be the current consumption due to the FIRC module usage? Would it be 48*360uA = 17.28mA?

The 40.32mA current was only due to the HSRUN mode which derived its frequency from the external resonator of 8MHz and upconverted to 112MHz by the SPLL. So, should I add both the currents as I am using 2 different clock sources (FIRC and SPLL)?

Please help to clarify - to calculate the current consumption due to different clock source (FIRC and SPLL) module usage and peripheral module usages?

• 1) oscillators that do not consume any power do not exist. 2) Read carefully, is that "8 MHz oscillator" really an oscillator? Or is it a resonator? 3) When using a resonator or a crystal with the build-in oscillator circuit of a microcontroller then that would make an oscillator which will consume current when it is powered on. How much power depends on many things. Commented Jul 20, 2020 at 15:26
• Thank you for the comment. Yes, my bad. It is a resonator. Could you please provide an answer or an example with some numericals?
– user220456
Commented Jul 20, 2020 at 15:33
• Ideally, a crystal itself and its associated capacitors don't consume any net power, but return it all back to the source. But there are non-idealities that dissipate power, like the finite resistance that everything has, and the crystal driver inside the microcontroller works by giving it a new batch of charge from the power supply and then dumping it to ground for each cycle. Taking 'x' Coulombs of charge from the supply and dumping it to ground every cycle at 8MHz, results in ['x' * 8million] Amps being drawn from the supply. ('x' is very small) Commented Jul 20, 2020 at 17:38
• An external oscillator has all of that built in, plus a buffer/driver, and simply provides that buffered output. Commented Jul 20, 2020 at 17:38

In short the chip will consume power depending on:

• What peripherals are enabled
• Current consumption of peripherals (use high impedance if possible)
• What clock speed chip is running at

The clock speed pf the S32L142 is determined by the PLL (and if you select an internal or external oscillator, it has an 8Mhz low power oscillator built in, or you can use an external oscillator from a range of 8-40Mhz). The S32L142 will then consume power at roughly 400uA/MHz, so the lower the clock speed the better power consumption (less switching of transistors is usually lower power in most digital devices). So set the PLL lower (which is configurable by software).

The S32L142 also has a low power mode, which uses a 128kHz internal oscillator. so if you can put the processor to sleep, it will use very little power.

Suppose, I use this 8MHz resonator between the pins 11 and 12, how to determine the current consumption due to this resonator?

The power consumption will be determined by the clock frequency of the SPLL (configurable by software) and then the s32 will use roughly 400uA/Mhz

EDIT: This is a much better diagram for your questions and the clocks in use, the document below also shows code on how to switch power modes on the S32k1xx
Source: https://www.nxp.com/docs/en/application-note/AN5425.pdf

• Thank you for the answer. So, If I use a 8MHz external resonator as shown, the power consumed will be 8*400uA=3.2mA. Am I correct? And from your answer, I have 2 more follow up questions. 1. Can a microcontroller have multiple clocks operating within itself? Like can it use the external 8MHz resonator and also use the 128kHz internal oscillator? Is it practically possible and advisable? And 2. Suppose I have a 8MHz external crystal with 2x 47nF Load capacitance connected instead of resonator. In this case, how is the current calculated? Do the load capacitors also consume current?
– user220456
Commented Jul 20, 2020 at 16:50
• Somewhat correct, the problem is the datasheet shows tested power consumption through different conditions, the 3.2mA is the contribution from only the core the peripherals will be more depending on what you have enabled. It also depends on the code you run, but yeah, if you only have the core enabled and its running at 8MHz then yes it would take 3.2mA. I think the minimum core speed is 48MHz (you have an 8Mhz external clock and up convert it) Table 10 shows the clock speeds. The best way to measure current and power consumption is to DIY. The microprocessor has 4 clocks (Figure 1) Commented Jul 20, 2020 at 17:37
• Actually check the edit, I think fig six in this document answers most of your questions, I'd read the whole app note: nxp.com/docs/en/application-note/AN5425.pdf Commented Jul 20, 2020 at 17:43
• Thank you for your comment. Could you also answer my second question in the comment whether I can enable to external resonator and use the internal FIRC at the same time operating at different frequencies?
– user220456
Commented Jul 21, 2020 at 1:16
• I already did, did you read both the datasheet and the application note all the way through? Commented Jul 21, 2020 at 4:54

if nothing else, the PI_matching capacitors on either end of the resonator will demand power.

Power (capacitor) === F * C * V^2

Notice the power scales linearly with the frequency.

Example: Power = 10MHz * (20 + 10pF) * 1volt_rms^2

Power = 1e+7 * 30e-12 * 1 = 30e-5 = 0.3 milliWatts, just to charge/discharge the capacitance.

Then the amplifier has quiescent current. And that circuit has junction capacitance which needs charge/discharge current.

====================================

Often 10MHz oscillators use 22pF PI_network capacitors on each end of the crystal. And within the quartz is capacitance between the silver_plated contacts. I assumed 10pF. Hence the (20 + 10PF). I ignored th e22pF, so as to not pretend we have extreme accuracy here.

The 1 volt RMS is 2.828 volts (2 * sqrt(2) ), which is about the maximum voltage you'll see in a 3.3 volt VDD oscillator.

==============================

To achieve that extra bit of phaseshift, sometimes needed for stable oscillation, the amplifier may be followed by a discrete resistor, so the PI network capacitor and the resistor provide crucial phaseshift.

IN that case, the resistor is always dissipating power.

Regarding losses of capacitors ---- there will be ESD structuree with unavoidable junction capacitances, and LOSSES within the substrate underlying those junctions.

• Thank you for the answer. I am not able to understand your answer clearly. Could you please tell me from where you got your values of 10MHz, 20 & 10pF and 1V RMS? I just want to understand how to calculate the current consumption when you use an external oscillator or resonator and an internal oscillator of the microcontroller. Please provide help
– user220456
Commented Jul 20, 2020 at 17:05
• I am not able to understand your answer clearly. Join the club. This answer just doesn't make much sense. The power an oscillator needs depends on the losses in the resonance tank, those losses need to be compensated for, by adding power to keep the oscillation going. The capacitors have little to do with that, capacitors don't use the power as they cannot dissipate any power. I have designed a few crystal oscillators over the years so I think I know what I'm talking about. Commented Jul 20, 2020 at 19:46