EmbDev.net

Forum: ARM programming with GCC/GNU tools problem about 711's clock


von Weimin L. (afsim)


Rate this post
useful
not useful
Hi,

It is OK like this:

  RCCU_Div2Config(ENABLE);
  RCCU_MCLKConfig(RCCU_DEFAULT);
  RCCU_FCLKConfig(RCCU_RCLK_8);
  RCCU_PCLKConfig(RCCU_RCLK_8);
  RCCU_PLL1Config(RCCU_PLL1_Mul_12 , RCCU_Div_4) ;
  while(RCCU_FlagStatus(RCCU_PLL1_LOCK) == RESET);
  RCCU_RCLKSourceConfig(RCCU_PLL1_Output) ;

when i change
  RCCU_PLL1Config(RCCU_PLL1_Mul_12 , RCCU_Div_4) ;
to
  RCCU_PLL1Config(RCCU_PLL1_Mul_12 , RCCU_Div_2) ;

code can't run.

so,MCLKval=24M is OK
MCLKval=48M is failure.

Is it a hardware problem?

MCLKval=RCCU_FrequencyValue (RCCU_MCLK);
APB1CLKval=RCCU_FrequencyValue (RCCU_FCLK);
APB2CLKval=RCCU_FrequencyValue (RCCU_PCLK);

thank you in advance.

von Spencer O. (ntfreak)


Rate this post
useful
not useful
What clock are you driving the str7 with ?

Here ia an example of using a 16MHz clock input

RCCU_Div2Config( ENABLE );
RCCU_MCLKConfig( RCCU_DEFAULT );
RCCU_FCLKConfig( RCCU_RCLK_2 );
RCCU_PCLKConfig( RCCU_RCLK_2 );
RCCU_PLL1Config( RCCU_PLL1_Mul_12, RCCU_Div_2 );
RCCU_RCLKSourceConfig( RCCU_PLL1_Output );

This will give us a MCLK of 48MHz and a peripheral clock of 24MHz

I have noticed that when debugging the clocks can sometimes get locked
up.
If you have get this behaviour then insert the follwing before the clock
config above. This will reset the clock to the default state before
changing to the new clcok source.
RCCU_RCLKSourceConfig( RCCU_CLOCK2 );

Hope this helps.
Spen

von afsim (Guest)


Rate this post
useful
not useful
Spen:

yes, i am using a 16MHz clock input.

so I think it is something wrong with hardware.

thank you very much indeed.

von afsim (Guest)


Rate this post
useful
not useful
Spencer Oliver wrote:
>
> I have noticed that when debugging the clocks can sometimes get locked
> up.
> If you have get this behaviour then insert the follwing before the clock
> config above. This will reset the clock to the default state before
> changing to the new clcok source.
> RCCU_RCLKSourceConfig( RCCU_CLOCK2 );
>

I try this today.
You are right.

add
  RCCU_RCLKSourceConfig( RCCU_CLOCK2 );
before the clock config,my board can run at 48M.


Thank you very much indeed.

von Spencer O. (ntfreak)


Rate this post
useful
not useful
Note this should only need doing for debugging, when the device is reset
from cold then the RCCU_CLOCK2 option is enabled by default.

Some ide's use a reset script that perform similar behaviour to adding
this line.

Regards
Spen

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.