cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behaviour when running 48MHz

dirk1
Associate II
Posted on March 12, 2008 at 15:18

Strange behaviour when running 48MHz

3 REPLIES 3
dirk1
Associate II
Posted on March 11, 2008 at 14:36

Hi,

I got some problems when configuring my main clock. I got a 4MHz Osci on a STR710FZ2 and I want to run it at 48MHz.

This is my code:

Code:

RCCU_PCLK1Config (RCCU_DEFAULT);

RCCU_PCLK2Config (RCCU_RCLK_4);

RCCU_MCLKConfig (RCCU_DEFAULT);

RCCU_PLL1Config (RCCU_PLL1_Mul_24, RCCU_Div_2);

//RCCU_PLL1Config (RCCU_PLL1_Mul_12, RCCU_Div_1); // also not working

RCCU_Div2Config(DISABLE);

while(RCCU_FlagStatus(RCCU_PLL1_LOCK) == RESET);

RCCU_RCLKSourceConfig(RCCU_PLL1_Output);

APB_ClockConfig(APB1, ENABLE, UART0_Periph | UART1_Periph);

I can not under any circumstances run at 48MHz. The MCU stops working right after ''RCCU_RCLKSourceConfig()''. I should also mention that I am currently debugging from RAM, so flash speed shouldn't be a problem. It works fine with a bigger Divider, but then the MCU is runnning at 24MHz.

kleshov
Associate II
Posted on March 12, 2008 at 09:11

I never used the STR71x Firmware Library, but I'll share my thoughts anyway. First, it seems wrong that the divide-by-2 prescaler is configured after the PLL:

RCCU_Div2Config(DISABLE);

Surely this setting disrupts the PLL operation and must be done prior to PLL configuration.

Second, the STR71x Firmware Library must fill in the FREF_RANGE field of the RCCU_PLL1CR register. I suspect it uses a macro telling the library the input oscillator frequency. Did you modify the macro to reflect your settings?

tech9
Associate II
Posted on March 12, 2008 at 15:18

Hi Dirk,

Take a look at AN2046, targeting specifically the clock setup for STR71x.

It helped big time for my app.

It contains a pdf file, but I recommend you run the Excel file, especially the part on the CCU, which tells you how to setup the many registers, with regards to your input oscillator, in order to meet your target clock.

Regards,

Tech / Jp