那就没办法了,既然你跟别家代理在合作。。想帮都帮不了你。。


最近有点忙。
以前写过一个R8C/25上面使用内部40MHz晶振,5分频得到8MHz CPU Clock的函数。
您对着手册参考一下吧。R8C时钟设置都差不多。可能都不需要改动。
另外,该跟代理要的软件,还是要来好。可能瑞萨网站上也有下载,搜一下。
/********************************************************************/
/* Function name: InitClock */
/* Description : System Clock Initialization */
/* Input : NULL */
/* Output : NULL */
/********************************************************************/
void InitClock(void)
{
unsigned int i = 0;
asm("FCLR I"); /* Interrupt disable */
prc0 = 1; /* CM0, CM1, OCD, FRA0, FRA1, FRA2 Protect off */
fra22 = 0; /* On-chip oscillator divide by 5 */
fra21 = 1;
fra20 = 1;
fra00 = 1; /* High-speed on-chip oscillator on */
cm16 = 0; /* Main clock = No division mode */
cm17 = 0;
cm06 = 0; /* CM16 and CM17 enable */
while( i <= 254 ) i++; /* Slight Delay */
fra01 = 1; /* Select high-speed on-chip oscillator */
prc0 = 0; /* CM0, CM1, OCD, FRA0, FRA1, FRA2 Protect off */
asm("FSET I"); /* Interrupt enable */
}
以前写过一个R8C/25上面使用内部40MHz晶振,5分频得到8MHz CPU Clock的函数。
您对着手册参考一下吧。R8C时钟设置都差不多。可能都不需要改动。
另外,该跟代理要的软件,还是要来好。可能瑞萨网站上也有下载,搜一下。
/********************************************************************/
/* Function name: InitClock */
/* Description : System Clock Initialization */
/* Input : NULL */
/* Output : NULL */
/********************************************************************/
void InitClock(void)
{
unsigned int i = 0;
asm("FCLR I"); /* Interrupt disable */
prc0 = 1; /* CM0, CM1, OCD, FRA0, FRA1, FRA2 Protect off */
fra22 = 0; /* On-chip oscillator divide by 5 */
fra21 = 1;
fra20 = 1;
fra00 = 1; /* High-speed on-chip oscillator on */
cm16 = 0; /* Main clock = No division mode */
cm17 = 0;
cm06 = 0; /* CM16 and CM17 enable */
while( i <= 254 ) i++; /* Slight Delay */
fra01 = 1; /* Select high-speed on-chip oscillator */
prc0 = 0; /* CM0, CM1, OCD, FRA0, FRA1, FRA2 Protect off */
asm("FSET I"); /* Interrupt enable */
}