為何程式不會停?
|
||||
---|---|---|---|---|
初級會員
|
以下是我的程式,為何在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
|
|||
|
Re: APP001 REV2用ICD2燒錄程式後如何獨立執行,不用ICD2?
|
||||
---|---|---|---|---|
初級會員
|
找到問題了!
原來JICD1~3不須調整,還是放在1&2 (MCU DEBUGE)位置 MPLAB設定Programmer(Programmer-->Select Programmer-->MPLAB ICD2) 說明書也沒寫清楚,害我忙了半天!
發表於: 2005/3/21 14:59
|
|||
|
Re: APP001 REV2用ICD2燒錄程式後如何獨立執行,不用ICD2?
|
||||
---|---|---|---|---|
初級會員
|
以下是我在program mode下要燒陸產生的錯誤.
程式是WAP002的範例程式ANS6中的WAP002.mcp 板子是app001 ,Jumper JICD1~3也都放在2&3 (PROGRAMER),MPLAB 也設定在PROGRAMER build all都ok,program時卻不成功,請問是什麼原因? Connecting to MPLAB ICD 2 ...Connected Setting Vdd source to target ICDWarn0020: Invalid target device id (expected=0x21, read=0x0) ...Reading ICD Product ID Running ICD Self Test ...Passed MPLAB ICD 2 Ready Connecting to MPLAB ICD 2 ...Connected Setting Vdd source to target ICDWarn0020: Invalid target device id (expected=0x21, read=0x0) ...Reading ICD Product ID Running ICD Self Test ...Passed MPLAB ICD 2 Ready Erasing Target Device... ICDWarn0052: MPLAB ICD 2 cannot validate a target device. Please make sure that the target device is connected and properly powered. Select "OK" to continue, or "CANCEL" to abort the operation ...Erase Succeeded MPLAB ICD 2 Ready Programming Target... ICDWarn0052: MPLAB ICD 2 cannot validate a target device. Please make sure that the target device is connected and properly powered. Select "OK" to continue, or "CANCEL" to abort the operation ICDWarn0035: Debug mode must be disabled. Disable debug mode or cancel? ...Validating configuration fields ...Erasing Part ...Programming Program Memory (0x0 - 0x1C6F) ...Programming User IDs Verifying... ICDWarn0052: MPLAB ICD 2 cannot validate a target device. Please make sure that the target device is connected and properly powered. Select "OK" to continue, or "CANCEL" to abort the operation ...Program Memory ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0xEFBF, Val Read = 0x0) ICD0275: Programming failed. MPLAB ICD 2 Ready
發表於: 2005/3/21 14:15
|
|||
|
APP001 REV2用ICD2燒錄程式後如何獨立執行,不用ICD2?
|
||||
---|---|---|---|---|
初級會員
|
如果將程式用ICD2 DownLOAD到APP001的CPU上
拔掉ICD2的接頭,APP001應該要調那一個JUMPER或接線? 可以讓APP001獨立執行,不用ICD2來啟動? 其他如APP005及APP009又該如何調整? 謝謝!
發表於: 2005/3/20 15:09
|
|||
|
APP001說明書與實際電路板不符?
|
||||
---|---|---|---|---|
初級會員
|
昨天買了一塊APP001與所附說明書對照之下發現有很多不一樣的地方.
1.相片上很多零件實際多沒插,例如U3,C9,D13,L1,C8,OSC1等,我想是為了省成本. 2.板子的右半部完全不同. 3.RS-232之設定為何,可否直接接MPLAB IDE程式, 4.板子上附的溫度顯示及PWM控制程式是否有列表. 5.CPU插座不是用有拉桿的省力插座,應該又是成本的關係. ==================================== 建議趕快更新網頁上的資料及所附的說明書. 用點時間撰寫針對APP001,APP005,APP009等詳細一點的說明書,以方便想入門的大眾,功德無量! 謝謝!
發表於: 2005/2/22 11:56
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
初級會員
|
參照:
該文件我有看過: 只有提到12C5XX,16CXX,17CXX,16F8XX 沒有提到線路在18FXX及dsPIC30FXX可否使用? Programming Specification是否相同? 程式要否調整? 報歉問了許多問題!
發表於: 2005/2/16 3:02
|
|||
|
如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
初級會員
|
如果沒有MPLAB ICD2或燒錄器的話,
有沒有簡單的線路及程式可以直接將.HEX或.BIN燒到 PIC18FXXX或dsPIC30FXX等cpu上 或應該reference which document? 或是有更便宜的ICSP KITS 謝謝!
發表於: 2005/2/15 14:41
|
|||
|
Re: 請問Data Sheet中Standard Flash與Enhance Flash有何不同?
|
||||
---|---|---|---|---|
初級會員
|
參照:
何謂自我燒錄?可否解釋一下? 謝謝
發表於: 2005/2/15 9:38
|
|||
|
請問Data Sheet中Standard Flash與Enhance Flash有何不同?
|
||||
---|---|---|---|---|
初級會員
|
請問在Data Sheet中之規格
有Standard Flash與Enhance Flash兩種 有何不同?
發表於: 2005/2/14 16:01
|
|||
|