• 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: PIC10F202 compile程式遇到問題
#2
版主
版主


查看用戶資訊
你只要在Error的地方,用滑鼠左鍵連續按兩次,MPLAB就會指到錯誤的地方.按照錯誤訊息來看,應該是在第76,77 and 78行,你使用非法的變數.

發表於: 2006/1/11 17:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PIC10F202 compile程式遇到問題
#1
新會員
新會員


查看用戶資訊
初次寫組合, 不知哪邊出問題
原始程式如下:
list      p=10F202            ; list directive to define processor
#include <p10F202.inc>        ; processor specific variable definitions

'__CONFIG' directive is used to embed configuration word within .asm file.
The lables following the directive are located in the respective .inc file
__CONFIG   _MCLRE_OFF _CP_ON _WDT_OFF


定義變數在RAM的位址
CBLOCK    0x08
    int_counter
    counter
ENDC


TMR0_TIMEOUT    EQU    0x7D    
125 0x7D 加上延遲
INTERNAL_TMR0    EQU    25

GP0        EQU 0x00
GP1        EQU 0x01
GP2        EQU 0x02
GP3        EQU 0x03


;RESET vector used to load calibration for internal clock
;;;RESET_VECTOR    CODE    0x1FF

Internal RC calibration value is placed at location 0x1FF by Microchip
; as a movlw kwhere the k is a literal value.

ORG 0x000
    movwf   OSCCAL            
update register with factory cal value 
    bsf     OSCCAL
,0

;***********************************************
;*         
Initial Timer0 subroutine
;***********************************************
Initial_Timer0
    clrf    TMR0
    movlw    
b'10000101'
    
OPTION                Prescaler 1:64
    retlw    0
;---------------------------------------------------------------------------

start                          the code start here
;initialisation GPIO inter osc 
    
    movlw    
b'00001000'    
    
tris     GPIO              

    movlw    INTERNAL_TMR0
    movwf    int_counter
    movlw    .16
    movwf    counter

    call     Initial_Timer0
    bsf        GPIO
GP0        High

loop1
    
;if (TMR0 >= TMR0_TIMEOUT)
    
movlw     TMR0_TIMEOUT
    subwf     TMR0
W
    btfss     STATUS
C
    
goto     judge2
    
;MOVLW    0x13
    
;MOVWF     0xa  
    call    Initial_Timer0
    incf     int_counter
F

judge2
    
;if (int_count >= INTERNAL_TMR0)
    
movlw     INTERNAL_TMR0
    subwf     int_counter
W
    btfss     STATUS
C
    
goto     loop1
    movlw     0x01    
GP0
    xorwf     GPIO
F
    clrf     int_counter
    incf     counter
F

    decfsz    counter
F
    
goto    loop1
loop2
    
goto    loop2

    END                       
end of program
//---------------------------------------------------------------------------

使用MPLAB IDE7.1 + MPASM + ICD2
compiler後出現錯誤訊息, 不知哪邊出問題, 請各位前輩高抬貴手, 指點一下.
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.EXE" /q /p10F202 "main.asm" /l"main.lst" /e"main.err"
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 3 : Found directive in column 1. (list)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 8 : Found directive in column 1. (__CONFIG)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 19 : Found directive in column 1. (CBLOCK)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 22 : Found directive in column 1. (ENDC)
Warning[205] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 46 : Found directive in column 1. (ORG)
Error[108] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 76 : Illegal character (
)
Error[108] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 77 : Illegal character (
)
Error[108] C:\MPLAB\TEST\PIC10F202\START8PULSE\MAIN.ASM 78 : Illegal character (
)
Halting build on first failure as requested.
BUILD FAILED: Thu Dec 22 18:25:04 2005

謝謝!

發表於: 2005/12/22 18:37
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... ]

教育訓練中心

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