以前的程序都能运行,后来又加入一个子程和两个变量,程序就不运行(新加的子程单独运行正常)。CW仿真时,总跳不出start08.c中的init()。提示说COP watchdog caused a reset! 大家帮忙看看!
1)默认的momery mode 为Small;
2)P&E_FCS_linker.prm为:
NAMES END
SEGMENTS
Z_RAM = READ_WRITE 0x0050 TO 0x00FF; RAM = READ_WRITE 0x0100 TO 0x044F; EEPROM = READ_ONLY 0x0800 TO 0x09FF; ROM = READ_ONLY 0x8000 TO 0xFDFF; END
 LACEMENT DEFAULT_ROM INTO ROM; DEFAULT_RAM INTO RAM; _DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; END
STACKSIZE 0x50
VECTOR 0 _Startup
VECTOR 1 0x4504 VECTOR 2 0x2567 VECTOR 3 0x9348
3)定义变量的头文件为:
#include <hidef.h> /* for EnableInterrupts macro */ #include <MC68HC908AB32.h> /* include peripheral declarations */ #pragma DATA_SEG __SHORT_SEG MY_ZEROPAGE
//变量0区变量从0x50到0xB9;
uchar Tad,Iad_1,Tv; int Ttest,ssij; int Ua,Delta_U,Ua1,II,I1,I2,I3,I4,Up,Ui,Ua2,Ua3,Ua4,Ua5,Ua6,Ua7,Ua8,V_BAT,count,Iar,Iaa,Mot_t;
#pragma DATA_SEG __SHORT_SEG DEFAULT
//变量1区变量从0x100到0x190 int E_NET,T8; unsigned int der,Addr; uchar Fse[8]; uchar atui[89]; uchar mode_i,mode_u,m1,m2,modes,ATU,DDRS;
uchar TQ_T,T_T,RUNN; #pragma DATA_SEG __SHORT_SEG DEFAULT
void setPLL(void); void initi(void); void delay(void)
。。。
void delay1(void); void ADT(void); void STOP(void); void delay0(void); void delay3(void);
void WriteByte(byte data); void WRITE_EEPROM(void); void ReadEEPROM(void);
|