STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

soft_raider
Posts: 2
Joined: Sun Mar 24, 2013 8:49 pm

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Post by Giovanni »

The bypass is needed for oscillators (external clock sources), it must not be set for regular crystals.

Giovanni
rew
Posts: 383
Joined: Sat Jul 19, 2014 12:59 pm
Has thanked: 2 times
Been thanked: 14 times

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Post 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.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Post 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".
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Post 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
soft_raider
Posts: 2
Joined: Sun Mar 24, 2013 8:49 pm

Re: STM32_HSE_BYPASS vs STM32_HSE_ENABLED and STM32_HSECLK

Post 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
Post Reply