Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / System Validation and Replacement

USB needs 48 MHz. Can a 48 MHz oscillator go straight into STM32F072 OSC_IN?

A USB clock diagram calls for 48 MHz. A designer considers driving STM32F072 OSC_IN directly from an available 48 MHz oscillator. The diagram identifies the final peripheral clock, whereas the external HSE pin has its own limits. Draw oscillator, bypass input, PLL and USB selection separately. The required peripheral frequency alone cannot decide the part to connect at the input.

Check both input frequency and pulse widths

The STM32F072 external high-speed clock table gives a maximum of 32 MHz and minimum high and low times of 15 ns each on OSC_IN. A nominal 48 MHz clock has a period of about 20.83 ns. At exactly 50% duty cycle, high and low are about 10.42 ns each. Changing duty cycle cannot make both intervals at least 15 ns because they would need 30 ns in total. The frequency and pulse-width requirements both rule out direct connection. An occasional working startup is not a qualification result.

Below the nominal frequency ceiling, duty still needs review. At 32 MHz the period is about 31.25 ns. With an assumed oscillator tolerance of 45% to 55% duty cycle, the shorter portion is about 14.06 ns, below the listed 15 ns. This omits signal level, edge and routing effects. Specify actual input voltage, minimum widths and oscillator load. When nominal frequency is near a device limit, include oscillator tolerance rather than treating nominal as the highest input rate.

Keep the USB target separate from the purchased source

For applicable STM32F072 devices, ST's HAL identifies HSI48 and PLL clock options for USB. Suppose a board needs an external 12 MHz CMOS oscillator and uses an approved PLL configuration multiplying it by four. The peripheral side can then receive nominal 48 MHz. At 12 MHz the reference period is 83.33 ns, and at the same 45% assumption the shorter pulse is 37.5 ns. Verify bypass connection, PLL input and divider settings, and actual USB selection. The processor's core frequency does not establish the peripheral's selected clock.

For HSI48, verify the applicable part, USB mode and synchronization or calibration conditions. A prototype that works once attached to both debugger and host does not establish all other startup paths. Compare the defined product sequence and other clock dependencies without confusing internal 48 MHz availability, the external input, and USB timing.

Observe the real input before exercising USB

On a production-style cold start, measure when the clock at OSC_IN meets its electrical conditions. Read actual HSE, PLL and peripheral state, then enumerate and run sustained data transfers. Where sleep recovery is supported, capture wake request, source readiness and bus recovery. A powered oscillator is not necessarily already producing valid pulses, and a software-ready indication does not replace validation of the clock input. State the timing origin so later samples use the same criterion.

If core frequency changes in a reduced-power mode, verify the USB clock stays available or that the interface pauses through the transition as designed. Use a checkable stream and exercise data integrity and first-packet timing across supported resets and operating transitions. Save reference frequency, connection, PLL factors, USB source selection and transfer outcome together. The purchasing line specifies the actual reference part. The final test qualifies the clock delivered through the hardware tree to USB.

Record the thresholds used for pulse-width measurements. The external clock table puts the OSC_IN high-level minimum and low-level maximum at 0.7 and 0.3 times the applicable I/O rail. On a 3.3 V rail, those thresholds are 2.31 V and 0.99 V. A source that only swings up to 1.8 V misses the high-level requirement even if its rate and midpoint duty cycle are correct. Automatic measurements can report a clean duty-cycle percentage for a slow or ringing waveform. Measure the high and low intervals using the manufacturer's input timing diagram, and check rise and fall times. Record the driver, probe loading, and operating voltage with the trace.

If the same board also has a build populated with a two-pin crystal, align each assembly variant with its own clock startup configuration. The older firmware can still try to start the oscillator amplifier after the hardware has been populated for an external clock. Bypass mode needs the appropriate strapping and external source. If the active source is available later than the microcontroller, use an available board clock for essential initialization, then switch and check statuses once the receiver input meets its requirements. Test the first cold start and a separate software reset. A board that works only on the second try can otherwise hide in an acceptance record.

References

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.