Re: Ryang 中斷程式OK了 感謝!!
|
||||
---|---|---|---|---|
新會員
|
Ryang 我試出來了 感謝妳!! 我會在研究看看!!吸收知識!!
發表於: 2009/9/25 18:18
|
|||
|
Re: 霹靂燈 修改 跑的方式
|
||||
---|---|---|---|---|
新會員
|
blainehs 大大 試成功了 ~~ 感謝你費心!!
for(i=0;i<7;i++) <--這裡的7 是指移動7次嗎?? 所以原理是 i從0開始 移動小餘.等於7次 i遞加? 再次請教 左移-->右移---> 亮2次8科LED <---這動作 該怎麼寫@@ for(i=0;i<7;i++) delay_ms(200), PORTD=(PORTD<<1); // PORTD,向左移動 for(i=0;i<7;i++) delay_ms(200), PORTD=(PORTD>>1); // PORTD,向右移動 TRISD=0b00000000; PORTD=0b11111111; if(PORTD>7) delay_ms(200), // PORTD=(PORTD=1); else // PORTD = 0x01; } } 我想讓他左移 右移 1.亮8顆 2.滅8科 3. 亮8顆 4.滅8科 剛試了結果 都只能閃.滅一次8顆 就重複左右移!!
發表於: 2009/9/25 17:08
Edited by RONALDQQ on 2009年09月25日 17:42:07
Edited by RONALDQQ on 2009年09月25日 20:20:53 Edited by RONALDQQ on 2009年09月25日 20:21:57 |
|||
|
Re: 如何改成 左移完右移 重覆此動作!
|
||||
---|---|---|---|---|
新會員
|
Ryang 妳教我的中斷程式 BUILD ALL後
出現 以下 [1027] 錯誤~~~ 要怎麼解決~~ 昨天花2小時 還是解決不暸 ~@@ Fri Sep 25 12:15:12 2009 ---------------------------------------------------------------------- Clean: Deleting intermediary and output files. Clean: Deleted file "C:\pic18\123\123.mcs". Clean: Done. Executing: "C:\MCC18\bin\mcc18.exe" -p=18F4520 "123.C" -fo="123.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- C:\pic18\123\123.C:9:Error [1027] unable to locate 'p18f4520.h' C:\pic18\123\123.C:10:Error [1027] unable to locate 'timers.h' C:\pic18\123\123.C:11:Error [1027] unable to locate 'delays.h' MPLAB C18 v3.22 (feature limited) Copyright 2000-2008 Microchip Technology Inc. This version of MPLAB C18 does not support the extended mode and will not perform all optimizations. To purchase a full copy of MPLAB C18, please contact your local distributor or visit buy.microchip.com. Halting build on first failure as requested. ---------------------------------------------------------------------- Debug build of project `C:\pic18\123\123.mcp' failed. Language tool versions: mplink.exe v4.30.01, mcc18.exe v3.22 Preprocessor symbol `__DEBUG' is defined. Fri Sep 25 12:15:13 2009 ---------------------------------------------------------------------- BUILD FAILED
發表於: 2009/9/25 12:20
|
|||
|
Re: 如何改成 左移完右移 重覆此動作!
|
||||
---|---|---|---|---|
新會員
|
blainehs 或 Ryang
能敎我 改成 左移跑完 右移 <--重複 嗎???
發表於: 2009/9/25 2:58
|
|||
|
Re: 為何我MARK後..無法產生HEX檔
|
||||
---|---|---|---|---|
新會員
|
感謝前輩Ryang 有找到HEX檔了 !!
發表於: 2009/9/25 0:12
|
|||
|
請教 PIC18 左移的程式 如何改成 霹靂燈
|
||||
---|---|---|---|---|
新會員
|
我想讓他 跑完左移 再從右邊跑回來 ~~重複這樣~~
PIC18F4520 想半天 ~~一直修改失敗 請前輩救我~~感激不盡!!! //********************************************************** //* Ex6_2_shift.c //********************************************************** #include <p18f4520.h> // 微控制器硬體名稱宣告 #include <delays.h> // 納入時間延遲函式庫函式原型名稱定義 #define OSC_CLOCK 10 void delay_ms(long A) { //This function is only good for OSC_CLOCK higher than 4MHz long i; int us2TCY; us2TCY=(10*OSC_CLOCK)>>2; // >>2相當於除以4 for(i=0;i<A;i++) Delay100TCYx(us2TCY); } void main (void) { PORTD = 0x01; // 將PORTD設定點亮LED0 TRISD = 0; // 將TRISD設為0,PORTD設定為輸出 while (1) { // 無窮迴圈 delay_ms(200); // 延遲200ms if(PORTD<128) // PORTD<128,向左移動 PORTD=(PORTD<<1); else // PORTD>=128,回歸至RD0 PORTD=0X01; } }
發表於: 2009/9/24 1:38
|
|||
|
如何使用 PICKIT3 燒錄 16F84A ??
|
||||
---|---|---|---|---|
新會員
|
如何使用 PICKIT3 燒錄PIC 16F84A ??
請教 是否有電路圖 可以参考!!! 燒錄腳位 只需接5腳嗎?? 1.MCLR 2.VDD 3.VSS 4.PGD 5.PGD 實在不知道 怎麼接法 設定~~ 才能燒!! 麻煩各位前輩 幫我解答~~~我要努力 成功~~ 如果方便的話 可以寄到我的信箱 ronald.ps2@msa.hinet.net 感激不盡!!!
發表於: 2009/9/24 1:19
|
|||
|
為何我MARK後..無法產生HEX檔
|
||||
---|---|---|---|---|
新會員
|
SOURCE file ..跟LINKER 都有加資料了!!!
使用16F84A 是不是 在MPLAB IDE >> PROJECT>> > > BUILD OPTIONS>> directories 這裡沒設定好~??? 如果是.... 要怎麼設定 HI-TECH ??? BUILD ---------------------------------------------------------------------- Release build of project `C:\pic16\84A_PILI\play\pili_play.mcp' started. Language tool versions: MPASMWIN.exe v5.30.01, mplink.exe v4.30.01 Thu Sep 24 01:05:12 2009 ---------------------------------------------------------------------- Make: The target "C:\pic16\84A_PILI\play\a1.o" is out of date. Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F84A "C:\pic16\84A_PILI\a1.asm" /l"a1.lst" /e"a1.err" /o"a1.o" Warning[211] C:\PIC16\84A_PILI\A1.ASM 56 : Extraneous arguments on the line. Make: The target "C:\pic16\84A_PILI\play\pili_play.cof" is out of date. Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /l"C:\Program Files\HI-TECH Software\PICC\PRO\9.60\lib" "..\..\..\Program Files\Microchip\MPASM Suite\LKR\16f84a.lkr" "a1.o" /z__MPLAB_BUILD=1 /o"pili_play.cof" /M"pili_play.map" /W MPLINK 4.30.01, Linker Copyright (c) 2009 Microchip Technology Inc. Errors : 0 MP2HEX 4.30.01, COFF to HEX File Converter Copyright (c) 2009 Microchip Technology Inc. Errors : 0 Loaded C:\pic16\84A_PILI\play\pili_play.cof. ---------------------------------------------------------------------- Release build of project `C:\pic16\84A_PILI\play\pili_play.mcp' succeeded. Language tool versions: MPASMWIN.exe v5.30.01, mplink.exe v4.30.01 Thu Sep 24 01:05:15 2009 ---------------------------------------------------------------------- BUILD SUCCEEDED
發表於: 2009/9/24 1:11
|
|||
|