cancel
Showing results for 
Search instead for 
Did you mean: 

Can´t run with 72MHz

nj_boelskov
Associate II
Posted on April 09, 2008 at 08:51

Can´t run with 72MHz

7 REPLIES 7
nj_boelskov
Associate II
Posted on May 17, 2011 at 12:28

Hey

I have been running 72MHz on my first kit MCBSTM32, but when I try to run the same code on the STM32F10x-EVAL it does´t work. If I drop the frequency to 48MHz by changing the PLLMUL ( x 9) it works again??

Any ideas to get it to run 72MHz?

-Niels

giles
Associate II
Posted on May 17, 2011 at 12:28

I'm running it fine on the eval board at 72, have you got the flash latency set to 2 for it being above 48mhz?

Also bear in mind that only one of the APB's works at 72, the other only go's to 36.

Heres my register settings for 72 on the eval board, dunno if its any help

RCC_________________________________________:Decimal , Hex ,FEDC BA98 7654 3210 FEDC BA98 7654 3210

RCC Control Register CR_____________________:0050542595, 0x03033803 i=0000 0011 0000 0011 0011 1000 0000 0011

RCC Clock Configuration Register CFGR_______:0001910026, 0x001d250a i=0000 0000 0001 1101 0010 0101 0000 1010

RCC Clock Interrupt Register CIR____________:0000000000, 0x00000000 i=0000 0000 0000 0000 0000 0000 0000 0000

RCC AHB Enable Register AHBENR______________:0000000021, 0x00000015 i=0000 0000 0000 0000 0000 0000 0001 0101

RCC APB2 Enable Register APB2ENR____________:0000019069, 0x00004a7d i=0000 0000 0000 0000 0100 1010 0111 1101

RCC APB1 Enable Register APB1ENR____________:0402669575, 0x18004007 i=0001 1000 0000 0000 0100 0000 0000 0111

RCC Backup Domain Control Register BDCR_____:0000000000, 0x00000000 i=0000 0000 0000 0000 0000 0000 0000 0000

RCC Control Status Register CSR_i___________:0201326592, 0x0c000000 i=0000 1100 0000 0000 0000 0000 0000 0000

nj_boelskov
Associate II
Posted on May 17, 2011 at 12:28

I can set the micro to run 72MHz, and it is running 72MHz. I have verified it by outputting the clock on the MCO pin. The APB1 prescaler is set to 4 so it should not be a problem.

It seems like the program is running for a very short periode of time, and then it brakes down. And still, if I set the clock to 48MHz there is no problems with the samne code.

Any good ideas to this problem?

-Niels

nj_boelskov
Associate II
Posted on May 17, 2011 at 12:28

I'm not sure about the flash latency. Can you set the flash latency, or do you have to make ''brakes'' in the code?

giles
Associate II
Posted on May 17, 2011 at 12:28

you can set the Flash latency by:

FLASH->ACR = 0x10 | 0x2;

0x10 is enable prefetch (bit 4)

the first 2 bits are the latency

less than 24Mhz set to 0

less than 48 but 24 or more set to 1

48+ set to 2

this should be set BEFORE you set thing to the PLL you want 🙂

if you're using st's firmware library the 2 you're interrested in are :

/* Enable Prefetch Buffer */

FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);

/* Flash 2 wait state */

FLASH_SetLatency(FLASH_Latency_2);

You are aware the max pin speed is 50Mhz (iirc)? so seeing it on the MCO at 72Mhz may be luck. have you tried something crude like timing a loop at 36Mhz then timing at 72Mhz outputting to a pin before and after to see if it is running ok so you're working within the pins speed :)?

nj_boelskov
Associate II
Posted on May 17, 2011 at 12:28

Thanks a lot. Now it is running 72MHz again 🙂

But still... I think it is a bit strange, that the other kit also with a STM32 could run 72MHz without changing the latency? Is there a good explanation of that or was I just ''lucky''

-Niels

And again, thanks a lot. Nice with some good help.

giles
Associate II
Posted on May 17, 2011 at 12:28

nps:)

Just lucky i think, its not specced to run with less than 2 at that speed but there is some tollerance and variation between micros, you just got one that just managed it before 🙂

[ This message was edited by: giles on 09-04-2008 12:36 ]