cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L151xx Cloccking PLL from external reference

george239955_st
Associate II
Posted on March 26, 2013 at 17:15

The Reference Manual states ''The internal PLL can be clocked by the HSI RC or HSE crystal.''

Is it possible to clock the PLL by feeding an external reference into OSC_IN?

If there is no signal present at OSC_IN will the PLL VCO free run and could this be used for a system clock?
2 REPLIES 2
Posted on March 26, 2013 at 17:45

Is it possible to clock the PLL by feeding an external reference into OSC_IN?

Yes you can use an external source, TCXO or other. This use case can be illustrated with the STM32L-Discovery where the 8 MHz can be routed from the STM32F103 implementing the ST-LINK function. Refer to the schematic/user manual for connectivity and solder bridge details.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
stmburns
Associate II
Posted on March 28, 2013 at 21:50

Hopefully I can give back a tiny amount...this forum has been SO useful to me.  To use the 8MHz signal coming out of the ST-Link chip on an STM32L Discovery board, you need to short solder bridge SB17 on the Discovery.  That's the easy part and you can find that on the schematic.  What is less obvious is that to make it work reliably, you add a little bit to the example code that ST gives you for starting up the HSE clock.  You must set an additional bit in the RCC control register.  Without this bit, it assumes there is an actual crystal hooked up.  With the bit, it configures itself to except a clock logic signal.  Here is my code to do this:

 

#ifdef

DISCOVERY_BOARD

  RCC->

CR

|= ((

uint32_t

)(RCC_CR_HSEON | RCC_CR_HSEBYP));

#else

  RCC->CR |= (uint32_t)(RCC_CR_HSEON);

#endif

 

You need the ''HSEBYP'' bit to use SB17 on the Discovery board.  If you don't do this, the HSE clock does not seem to lock on well and you miss a lot of ticks.  The thing that I saw was that suddenly my UART speed was totally bogus.

Hope this helps,

Burns