Lib to change the clock speed of the ST Nucleo L152RE board to 32 MHz.
The ST Nucleo L152 board is running on 16 MHz out of the box. To speed up the cpu to the maximum 32MHz speed we have to change the clock setting. Simply add the lib and :
#include "ST_L152_32MHZ.h" L152_init32 myinit(0); // use the internal oscillator
in front of your program. This should be the first line in main to ensure the frequency is changed before other objects are initialised.
This frequency is generated out of the internal RC oscillator. The frequency is not so stable like a crystal. The PLL is switched to 96MHz to enable the use of the USB interface.
If you need a more precise timing source, you have to add a external crystal.
You need : X3 8MHz crystal , C33 and C34 18pF 0603 , R35 and R37 have to be short with a small piece of wire.
#include "ST_L152_32MHZ.h" L152_init32 myinit(1); // use external crystal oscillator
History
We have to reset the clock setting to change the pll
2014-04-08, by dreschpe [Tue, 08 Apr 2014 17:17:56 +0000] rev 3
We have to reset the clock setting to change the pll
Fix setup
2014-03-19, by dreschpe [Wed, 19 Mar 2014 18:07:11 +0000] rev 2
Fix setup
change result type to enum
2014-03-11, by dreschpe [Tue, 11 Mar 2014 21:03:03 +0000] rev 1
change result type to enum
Lib for the ST Nucleo L152RE board to switch the clock to 32MHz.; Out of the box the board is running on 16MHz.
2014-03-11, by dreschpe [Tue, 11 Mar 2014 20:34:57 +0000] rev 0
Lib for the ST Nucleo L152RE board to switch the clock to 32MHz.; Out of the box the board is running on 16MHz.