• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: 新手笨問題
#8
資深會員
資深會員


查看用戶資訊
其實應該要寫PORTC而不是寫RC
定義檔中預設的是PORTC
那個作者可能有自己去改定義檔
不然就是使用其他編譯程式
所以他寫RC就能編譯通過

發表於: 2005/10/25 16:17
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 新手笨問題
#7
高級會員
高級會員


查看用戶資訊
還是很感謝你的熱心回答...

不然一值卡住...有夠難受的

發表於: 2005/10/25 15:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 新手笨問題
#6
高級會員
高級會員


查看用戶資訊
參照:
至於rc的錯誤 我不知道在PIC16中RC是不是指PORTC 如果是的話 那也把他改大寫看看


RC 是PORTC 但是改成大寫RC 還是有錯誤

剛才直接把 RC 改成PORTC 就可以了...

真怪

list p=16f877
#include <p16f877.inc>
cnt       equ   0x20
delaycnt0 equ   0x21
delaycnt1 equ   0x22
          org   0x00
          nop 
          
goto  start
start
:
          
call  pic_init
main_loop
:
          
movlw b'11111110'
          
movwf PORTC
          movlw 0x08
          movwf cnt
inner_loop
:
          
call  delay
          bsf   STATUS
,C
          rlf   PORTC
,F
          
goto  inner_loop
          
goto  main_loop
pic_init
:
          
clrf  INTCON
          bsf   STATUS
,RP0
          movlw 
b'00000000' 
          
movwf TRISC
          bcf   STATUS
,RP0
          movlw 
b'11111110'
          
movwf PORTC
          
return
delay:
          
movlw 0xff
          movwf delaycnt0
          movwf delaycnt1
delay0
:
          
decfsz delaycnt0,f
          
goto delay0
          decfsz delaycnt1
,f
          
goto delay0
          
return
          
end



CleanDeleting intermediary and output files.
CleanDone.
Executing"C:Program FilesMPLAB IDEMCHIP_Toolsmpasmwin.exe" //p16F877 "ex1.asm" /l"ex1.lst" /e"ex1.err"
Message[302D:PICEX1.ASM 26 Register in operand not in bank 0.  Ensure that bank bits are correct.
Loaded D:picex1.COD
BUILD SUCCEEDED
Tue Oct 25 15:23:28 2005

發表於: 2005/10/25 15:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 新手笨問題
#5
高級會員
高級會員


查看用戶資訊
你的RC需要定義...
EX:
rc equ 0x23

發表於: 2005/10/25 15:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 新手笨問題
#4
高級會員
高級會員


查看用戶資訊
參照:
變數名稱大小寫是不同的 而指令則大小寫都可以


多謝...改完之後都正常 不過RC還是沒解決

Executing"C:Program FilesMPLAB IDEMCHIP_Toolsmpasmwin.exe" //p16F877 "ex1.asm" /l"ex1.lst" /e"ex1.err"
Error[113]   D:PICEX1.ASM 13 Symbol not previously defined (RC)
Error[113]   D:PICEX1.ASM 19 Symbol not previously defined (RC)
Message[302D:PICEX1.ASM 26 Register in operand not in bank 0.  Ensure that bank bits are correct.
Error[113]   D:PICEX1.ASM 29 Symbol not previously defined (RC)
Halting build on first failure as requested.
BUILD FAILEDTue Oct 25 15:07:52 2005

發表於: 2005/10/25 15:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 新手笨問題
#3
高級會員
高級會員


查看用戶資訊
參照:
變數名稱大小寫是不同的 而指令則大小寫都可以


多謝...改完之後都正常 不過RC還是沒解決

Executing"C:Program FilesMPLAB IDEMCHIP_Toolsmpasmwin.exe" //p16F877 "ex1.asm" /l"ex1.lst" /e"ex1.err"
Error[113]   D:PICEX1.ASM 13 Symbol not previously defined (RC)
Error[113]   D:PICEX1.ASM 19 Symbol not previously defined (RC)
Message[302D:PICEX1.ASM 26 Register in operand not in bank 0.  Ensure that bank bits are correct.
Error[113]   D:PICEX1.ASM 29 Symbol not previously defined (RC)
Halting build on first failure as requested.
BUILD FAILEDTue Oct 25 15:07:52 2005

發表於: 2005/10/25 15:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 新手笨問題
#2
資深會員
資深會員


查看用戶資訊
我沒用過PIC16 試著回答一下
首先
貼上程式碼時頭尾要加上半形小寫
[ c o d e ] 跟 [ / c o d e ]
保持程式排版完整
因為這個討論區會把空格自動砍掉
有時因此而會忽略掉某些錯誤
像你第一個錯誤應該是list前面沒有加空格
放個空格或是跳躍鍵tab就好了

而特殊暫存器status跟trisc與intcon的錯誤
應該是因為你用小寫
改成大寫就好了
變數名稱大小寫是不同的
而指令則大小寫都可以
status,c 跟status,rp0 也全都改大寫看看

至於rc的錯誤
我不知道在PIC16中RC是不是指PORTC
如果是的話
那也把他改大寫看看
如果不是,那就是你沒有定義這個變數
編譯程式找不到這個東西

都改成大寫再看看吧

發表於: 2005/10/25 9:13
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


新手笨問題
#1
高級會員
高級會員


查看用戶資訊
買了 PIC16F87X 快速上手 何信龍 李雪銀 這本書

按照裡面的簡單測試程式範例 打了上去

list p=16f877
#include <p16f877.inc>
cnt       equ   0x20
delaycnt0 equ   0x21
delaycnt1 equ   0x22
          org   0x00
          nop 
          
goto  start
start
:
          
call  pic_init
main_loop
:
          
movlw b'11111110'
          
movwf rc
          movlw 0x08
          movwf cnt
inner_loop
:
          
call  delay
          bsf   status
,c
          rlf   rc
,f
          
goto  inner_loop
          
goto  main_loop
pic_init
:
          
clrf  intcon
          bsf   status
,rp0
          movlw 
b'00000000' 
          
movwf trisc
          bcf   status
,rp0
          movlw 
b'11111110'
          
movwf rc
          
return
delay:
          
movlw 0xff
          movwf delaycnt0
          movwf delaycnt1
delay0
:
          
decfsz delaycnt0,f
          
goto delay0
          decfsz delaycnt1
,f
          
goto delay0
          
return
          
end


Build All時 卻發生一大堆錯誤

CleanDone.
Executing"C:Program FilesMPLAB IDEMCHIP_Toolsmpasmwin.exe" //p16F877 "ex1.asm" /l"ex1.lst" /e"ex1.err"
Warning[205D:PICEX1.ASM 1 Found directive in column 1. (list)
Error[113]   D:PICEX1.ASM 13 Symbol not previously defined (rc)
Error[113]   D:PICEX1.ASM 18 Symbol not previously defined (status)
Error[113]   D:PICEX1.ASM 18 Symbol not previously defined (c)
Error[113]   D:PICEX1.ASM 19 Symbol not previously defined (rc)
Error[113]   D:PICEX1.ASM 23 Symbol not previously defined (intcon)
Error[113]   D:PICEX1.ASM 24 Symbol not previously defined (status)
Error[113]   D:PICEX1.ASM 24 Symbol not previously defined (rp0)
Error[113]   D:PICEX1.ASM 26 Symbol not previously defined (trisc)
Error[113]   D:PICEX1.ASM 27 Symbol not previously defined (status)
Error[113]   D:PICEX1.ASM 27 Symbol not previously defined (rp0)
Error[113]   D:PICEX1.ASM 29 Symbol not previously defined (rc)
Halting build on first failure as requested.
BUILD FAILEDTue Oct 25 02:55:30 2005


書上的範例應該沒錯 而我也照書上的打 有沒有人可以幫我解惑一下

謝謝...

發表於: 2005/10/25 3:19
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------