cancel
Showing results for 
Search instead for 
Did you mean: 

how to swith to 72Mhz ?

manes69692
Associate II
Posted on February 01, 2009 at 06:15

how to swith to 72Mhz ?

3 REPLIES 3
manes69692
Associate II
Posted on May 17, 2011 at 13:01

Hi

I trying to switch my board to 72Mhz , but I think I do something wrong , because I'm also using usart1 at 9600bd , but my baudrate is not correct

When just turning on my external xtal of 8Mhz , the baudrate is correct.

What is the correct sequence for switching to pll ?

Best Regards ,

Ronny

BTW this is the code I'm using :

// switch to 72MHz

RCC_CR=0x00010083; //enable the 8Mhz crystal

while (!(RCC_CR)&0x00020000); //wait for hse ready

RCC_CFGR=0x00000001; //set the 8Mhz crystal as clock source

RCC_CFGR=0x00010001; //set the 8Mhz crystal as pll source

RCC_CFGR=0x001d0401; //pll*9

RCC_CR=0x01010083; //enable the pll

while (!(RCC_CR)&0x02000000); //wait for pll locked

RCC_CFGR=0x001d0402; //set pll as system clock source

disirio
Associate II
Posted on May 17, 2011 at 13:01

Hello, I am using this initialization sequence, it works for both 48 and 72 mhz:

http://chibios.svn.sourceforge.net/viewvc/chibios/trunk/demos/ARMCM3-STM32F103-GCC/board.c?revision=634&view=markup

Just look at the hwinit0() function.

The various constants are defined here:

http://chibios.svn.sourceforge.net/viewvc/chibios/trunk/demos/ARMCM3-STM32F103-GCC/board.h?revision=703&view=markup

regards,

Giovanni

manes69692
Associate II
Posted on May 17, 2011 at 13:01

Quote:

On 31-01-2009 at 19:05, Anonymous wrote:

Hello, I am using this initialization sequence, it works for both 48 and 72 mhz:

http://chibios.svn.sourceforge.net/viewvc/chibios/trunk/demos/ARMCM3-STM32F103-GCC/board.c?revision=634&view=markup

Just look at the hwinit0() function.

The various constants are defined here:

http://chibios.svn.sourceforge.net/viewvc/chibios/trunk/demos/ARMCM3-STM32F103-GCC/board.h?revision=703&view=markup

regards,

Giovanni

Thanks Giovanni !

Your code works perfect , I'm gonna figure out now , what I did wrong

Thanks again

Ronny