Ejemplo n.º 1
0
int main(void)
{
  #ifdef DEBUG
  debug();
  #endif

  /* RCCU peripheral configuration ------------------------------------------*/
   
  /*  Configure FCLK = RCLK /2 */
  RCCU_FCLKConfig ( RCCU_RCLK_2 );

  /*  Configure PCLK = RCLK /2 */
  RCCU_PCLKConfig (RCCU_RCLK_2);

  /*  Configure MCLK clock for the CPU, RCCU_DEFAULT = RCLK /1 */
  RCCU_MCLKConfig (RCCU_DEFAULT);
   
  /*  Configure the PLL1 ( * 12 , / 4 ) */
  RCCU_PLL1Config (RCCU_PLL1_Mul_12, RCCU_Div_4) ;

  /*  Wait PLL to lock */
  while(RCCU_FlagStatus(RCCU_PLL1_LOCK)==RESET);

  /*  Select PLL1_Output as RCLK clock */
  RCCU_RCLKSourceConfig (RCCU_PLL1_Output) ;

  /*  At this step the CKOUT signal should be equal to 12 MHz with
     an external oscilator equal to 16MHz */
  
  while(1);
}
Ejemplo n.º 2
0
static void prvSetupHardware( void )
{
    /* Setup the PLL to generate a 48MHz clock from the 4MHz CLK. */

    /* Turn of the div by two. */
	RCCU_Div2Config( DISABLE );

    /* 48MHz = ( 4MHz * 12 ) / 1 */
	RCCU_PLL1Config( RCCU_PLL1_Mul_12, RCCU_Div_1 );
    RCCU_RCLKSourceConfig( RCCU_PLL1_Output );
}
Ejemplo n.º 3
0
static void str7_RccInit()
{
    //系统基本初始化
    RCCU_MCLKConfig(RCCU_DEFAULT);							//MCLK = RCLK
    RCCU_FCLKConfig(RCCU_RCLK_2);							//FCLK = RCLK/2
    RCCU_PCLKConfig(RCCU_RCLK_4);							//PCLK = RCLK/4
    RCCU_PLL1Config(RCCU_PLL1_Mul_12, RCCU_Div_2);			//48MHz PLL @ 16MHz XTAL

    while (RCCU_FlagStatus(RCCU_PLL1_LOCK) == RESET);		//Wait for PLL to Lock
    RCCU_RCLKSourceConfig(RCCU_PLL1_Output);				//Select PLL for RCLK

}