為何程式不會停?
|
||||
---|---|---|---|---|
初級會員
|
以下是我的程式,為何在PORD=0xff時不會停下來?
又從0x00開始累加上去,一直循環?? 而且我將c018i.c中的goto loop給remark起來也無效 //****************************************** // test.c //****************************************** #include <p18f452.h> #include <delays.h> void main(void) { // Initial portD TRISD=0x00; PORTD=0x00; while (PORTD<0xff) { PORTD++; Delay10KTCYx(10); } } //************************************ // c018i.c //************************************ void _startup (void) { _asm // Initialize the stack pointer lfsr 1, _stack lfsr 2, _stack clrf TBLPTRU, 0 // 1st silicon doesn't do this on POR bcf FPFLAGS,RND,0 // Initialize rounding flag for floating point libs // initialize the flash memory access configuration. this is harmless // for non-flash devices, so we do it on all parts. bsf 0xa6, 7, 0 bcf 0xa6, 6, 0 _endasm _do_cinit (); //loop: // Call the user's main routine main (); // goto loop; } /* end _startup() */ //*************************************
發表於: 2005/3/25 23:09
|
|||
|