|
大家好,请大家帮帮忙,使用的蕊片是R8C/L35C 群中的R5F2L357,为什么老是复位.使用E8A在线调试,是没有问题.但是下载蕊片后,重新复位后,蕊片老是不断复位.不知什么问题?
代码如下:
void main(void)
{
int i=0;
asm("FCLR I"); /* Interrupt disabled */
prc0=1; /* Protect off */
/****************************************/
/* CPU Clock Setting */
/****************************************/
/* Note: Include asm("nop") for oscillator's stabilization period after clock setting is done */
/* User may set cm14=1 to turn off on-chip oscillator when main clock is selected */
cm13=1;cm05=0;cm14=0; /* Main Clock selected(cm0 bit 5, cm1 bit 3 and 4) */
for(i=0; i<10; i++);
ocd2=0; /* Main clock selected for system clock(ocd bit 2) */
cm16=0;cm17=0;cm06=1; /* Divide by 8 selected for CPU clock(cm0 bit 6) */
prc0=0; /* Protect on */
//init(); /* Initial setting */
asm("FSET I"); /* Interrupt enabled */
pd11_4 = 1; /* pd0*/
//pu132 =0;
p11_4 = 1; /* LED灯亮*/
pd11_3 = 1; /* */
p11_3 = 1; /* LED灯亮*/
while (1)
{
;
}
}
在fvector.c文件代码如下:
_asm(" .addr 0FFFFFFH"); //reserved
_asm(" .byte 0FFH"); // OFS2
#pragma interrupt/v _dummy_int //udi
#pragma interrupt/v _dummy_int //over_flow
#pragma interrupt/v _dummy_int //brki
#pragma interrupt/v _dummy_int //address_match
#pragma interrupt/v _dummy_int //single_step
#pragma interrupt/v _dummy_int //wdt
#pragma interrupt/v _dummy_int //reserved
#pragma interrupt/v _dummy_int //reserved
#pragma interrupt/v start
#if __WATCH_DOG__ != 0
_asm(" .ofsreg 0FEH");
#else
_asm(" .ofsreg 0FFH");
#endif
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|