Page 2 of 2

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Posted: Sun May 01, 2016 8:33 am
by soft_raider
Giovanni,
this is not correct:
Giovanni wrote:If you have an oscillator then you need the bypass.


Bit 18 HSEBYP: HSE crystal oscillator bypass
Set and cleared by software to bypass the oscillator with an external clock. The external clock
must be enabled with the HSEON bit set, to be used by the device. The HSEBYP bit can be
written only if the HSE oscillator is disabled.
0: HSE crystal oscillator not bypassed
1: HSE crystal oscillator bypassed with external clock

So, if you use crystal oscillator - BYPASS bit should be cleared
It need only if you use external clock.

Andrew

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Posted: Sun May 01, 2016 8:53 am
by Giovanni
The bypass is needed for oscillators (external clock sources), it must not be set for regular crystals.

Giovanni

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Posted: Sun May 01, 2016 12:04 pm
by rew
Giovanni, may I make a suggestion?

In regular boards, you'll find that you're either working with the internal clock or with a crystal. The case with an external oscillator is relatively rare.... Except that on the discovery boards there is already an STM processor, that NEEDS a crystal and that clock-out signal can be passed on to the target processor.

Again the deal is: If you make the default: "crystal, not external oscillator", most people will have something that works first time. Those WITH an external oscillator (or the clock from the STLINK) will just have a useless clock signal on xtal_out. A decision that will save a lot of people some headaches.

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Posted: Sun May 01, 2016 8:14 pm
by steved
Possibly down to different interpretations of terminology.

I (like rew, I think) would interpret "oscillator" as meaning the on-chip crystal oscillator. If using some other external clock source I would refer to an "external clock".

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Posted: Sun May 01, 2016 8:31 pm
by RoccoMarco
I had the same problem. If I understand correctly, the question is simple
BYPASS->TRUE you have to provide a clock source, a stable waveform provided by an external oscillator or chip
BYPASS->FALSE you have two PINs representing the input and the output of the feedback loop of a Colpitts oscillator (i.e. a crystal/ceramic quartz + two capacitors). Of course in this case the active part of the Colpitts is embedded into the STM32.
Image

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Posted: Sun May 01, 2016 9:02 pm
by soft_raider
RoccoMarco wrote:I had the same problem. If I understand correctly, the question is simple
BYPASS->TRUE you have to provide a clock source, a stable waveform provided by an external oscillator or chip
BYPASS->FALSE you have two PINs representing the input and the output of the feedback loop of a Colpitts oscillator (i.e. a crystal/ceramic quartz + two capacitors). Of course in this case the active part of the Colpitts is embedded into the STM32.


Yes, you are correct.
BYPASS needed only in case when you connect external frequency(from generator), not oscillator.

Andrew