Author Topic: STM32WL: Can anyone explain the recommended external impedance for HSE32?  (Read 449 times)

0 Members and 1 Guest are viewing this topic.

Offline AJ528Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: us
Hi All,

I'm planning to use an STM32WL5X microcontroller in an upcoming project, and I found myself confused on the recommended impedance for external 32MHz oscillators. Please see the attached image for a screenshot from the datasheet.

The datasheet says that the incoming clock signal needs a minimum of 0.4 Vpp, and an absolute max of 1.2 Vpp. Note 1 below the table says that oscillators outputting a 0.8 Vpp signal should have a 220 ohm resistor and 10 pF capacitor put in series before the oscillator input pin. The oscillator input has a minimum input capacitance of about 11 pF.

If the input signal is 0.8 Vpp, and you make a voltage divider as described, the input signal is going to be way less than 0.4 Vpp. How is that supposed to work??
 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: gb
    • Woofys Place
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #1 on: September 24, 2024, 10:58:14 am »
Hi All,

I'm planning to use an STM32WL5X microcontroller in an upcoming project, and I found myself confused on the recommended impedance for external 32MHz oscillators. Please see the attached image for a screenshot from the datasheet.

The datasheet says that the incoming clock signal needs a minimum of 0.4 Vpp, and an absolute max of 1.2 Vpp. Note 1 below the table says that oscillators outputting a 0.8 Vpp signal should have a 220 ohm resistor and 10 pF capacitor put in series before the oscillator input pin. The oscillator input has a minimum input capacitance of about 11 pF.

If the input signal is 0.8 Vpp, and you make a voltage divider as described, the input signal is going to be way less than 0.4 Vpp. How is that supposed to work??
(my bold)
How did you calculate that?
If you take a 220 ohm resistor in series with a 21pF (10pF + 11pF) capacitor and apply 0.8vpp @32MHz across it, you will get around 0.56vpp across the capacitor.
 
The following users thanked this post: AJ528

Offline AJ528Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: us
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #2 on: September 24, 2024, 05:22:44 pm »
That's....a fair question actually. It's been a little since I've done AC circuit analysis.

To start with, I attached a picture of the simulated circuit and a resistor divider I expected to be equivalent (it's not). The actual circuit has a 10pF and 220 ohm resistor in series with a 10pF load (technically 11 but I'm simplifying).

The impedance of a 10pF capacitor at 32MHz is about 497 ohms, so I expected this to act as a resistor divider, identical to the resistor equivalent I made. But after running the simulation, V(HSE32_in) = 488mV and V(R_eq) = 409mV. So there is clearly something I'm missing here.
 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: gb
    • Woofys Place
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #3 on: September 24, 2024, 06:43:35 pm »
I read the datasheet a little differently, but its not the clearest. I assumed the TXO output went through the 220R, the 10pF then to ground, with the junction of the 220R and 10pF connected to the STM32 pin. The STM32's 11pF input capacitance would then be in parallel with the 10pF, hence 21pF.


 
 
The following users thanked this post: AJ528

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: gb
    • Woofys Place
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #4 on: September 24, 2024, 06:58:41 pm »
The impedance of a 10pF capacitor at 32MHz is about 497 ohms, so I expected this to act as a resistor divider, identical to the resistor equivalent I made.

The capacitor impedance is 90 degrees out of phase with the resistor, so you cannot just add them.
Total impedance Z = sqrt(  (220*220) + (497*497) ) = 543.5
 
The following users thanked this post: AJ528

Offline AJ528Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: us
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #5 on: September 24, 2024, 07:42:59 pm »
I read the datasheet a little differently, but its not the clearest. I assumed the TXO output went through the 220R, the 10pF then to ground, with the junction of the 220R and 10pF connected to the STM32 pin. The STM32's 11pF input capacitance would then be in parallel with the 10pF, hence 21pF.
I agree, that wording is vague. I should have included this additional part of the datasheet, where they show the resistor and capacitor in series with the HSE32 input pin.
 

Offline AJ528Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: us
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #6 on: September 24, 2024, 07:54:27 pm »
The impedance of a 10pF capacitor at 32MHz is about 497 ohms, so I expected this to act as a resistor divider, identical to the resistor equivalent I made.

The capacitor impedance is 90 degrees out of phase with the resistor, so you cannot just add them.
Total impedance Z = sqrt(  (220*220) + (497*497) ) = 543.5

Yep, that explains why my approximations were off. Definitely been a while since I've done AC analysis :palm:.

But, I repeated my simulation in SPICE, changed V1 to be 0.8V amplitude, change C2 to be a more accurate value of 11.3pF, and the expected input voltage still has an amplitude of 366mV. So my original question is still valid. (but the intuition that led me there may have been wrong, lol)
 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 363
  • Country: gb
    • Woofys Place
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #7 on: September 24, 2024, 08:40:00 pm »
With the circuit as suggested by STM, I agree with your analysis. 0.8vpp will result in less than the minimum 0.4vpp.
It wouldn't be the first time a data sheet has been wrong.
I would increase the value to 15pF which should give you around 0.437vpp, but really, measure the output of your TCXO and calculate it from there.
 
The following users thanked this post: AJ528

Offline AJ528Topic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: us
Re: STM32WL: Can anyone explain the recommended external impedance for HSE32?
« Reply #8 on: September 24, 2024, 10:28:03 pm »
Okay, thank you for sanity checking me. Fun fact: the evaluation board for this microcontroller uses the same weird circuit (see attached image). But also, the part number they list for X4 is a temperature compensated crystal, not oscillator. But from the schematic symbol you can tell they're treating it like an oscillator. The more I look at this, the more confused I get.

I wonder what the original intent was for this information. Clearly they want you to put a resistor and capacitor in series between the TCXO and the oscillator input pin and use it as a voltage divider. I also trust that the max input signal needs to be 1.2 Vpp and minimum of 0.4 Vpp. Looking at some TCXO options on digikey, I'm often seeing a minimum output level of 0.8 Vpp (https://ecsxtal.com/store/pdf/ECS-TXO-25CSMV.pdf). The typical and max output level isn't listed, but I'm assuming the max is <= Vin. Seeing how the maximum accepted input signal is 1.2 Vpp, I can understand why you would need to divide down the incoming signal. This also explains why you are encouraged to power the TCXO off an MCU pin that outputs a lower voltage compared to the normal 3.3V. Running the oscillator at only 1.8V or 2.2V limits the max output and more easily keeps it in the acceptable range.

I think for my design I'm going to change the series capacitor to be 12pF instead of 10pF. At the minimum output level of 0.8V, that puts me right at 0.4 Vpp input. And if I run the oscillator at 2.2V and it decides to output 2.2 Vpp, the input voltage is about 1.1 Vpp, which is still within acceptable limits.
 
The following users thanked this post: woofy


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf