• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   3 Anonymous Users






Re: 關於12F510.. 笨鴨有疑問請教???
#4
資深會員
資深會員


查看用戶資訊
Yes..... SIR .....
馬上去當露瞧瞧..... 3Q ...

發表於: 2006/5/11 0:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於12F510.. 笨鴨有疑問請教???
#3
版主
版主


查看用戶資訊
針對 MPASM (Microchip Assebbler) 有寫了一套 workshop 的教材,你可以到右邊的教育訓練下去下載 "MPASM 一天講義" 研究一下MPASM的用法這樣比較正確快速。

發表於: 2006/5/10 9:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於12F510.. 笨鴨有疑問請教???
#2
資深會員
資深會員


查看用戶資訊
哈...哈.... 找到問題啦 !!!! 原來少了個 Under Score " _ " .
CONFIG 之前需要兩個 Under Score __ .
奇怪啦???? 誰龜定的呀???? 還真是龜龜耶!!!!!
害笨鴨偶,,, 又想白了頭髮,,, 死了不少細胞耶 !!!!

偶說憋, 碰到問題還是先放下來 ,
昨晚去泡美媚, ( 陪心情不好的朋友去有美媚的卡拉OK..)
今天就找到問題啦 ...黑皮... 黑皮... 真黑皮....

發表於: 2006/5/10 7:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於12F510.. 笨鴨有疑問請教???
#1
資深會員
資深會員


查看用戶資訊
Dear All :
奇怪?? Build 會出如下問題,, 是甚麼問題呀???
以前的 12F508 , 16F505 格式都是這樣寫的呀 ?
這次更慘,,,, 一開始就被踢出局啦 !!!!!!
這些 PIC 還真會找我這麼個初學者,門外漢,的碴耶 ???

Warning[207D:MY PROJECT12F510 ADC12F510 ADC.ASM 4 Found label after column 1. (_CONFIG)
Error[122]   D:MY PROJECT12F510 ADC12F510 ADC.ASM 4 Illegal opcode (_CP_OFF)

;
PIC12F510                          A/D  TEST                                          04/21/2006
    
#include    <p12F510.inc>                                                           ; processor specific variables
ConfigureControls the reset pincode protectoscillator selectionWDT.
    
_CONFIG _CP_OFF _MCLRE_OFF _IOSCFS_OFF _WDT_OFF _IntRC_OSC 
;-----[Defines Variable Assignments]--------------------------------------- 
    
cblock 0x08    GP2,GP3=INPUT GP0,GP1,GP4GP5=OUTPUT
    
count        count buffer
    count1        
count buffer 
    count2        
count buffer
    count3        
; For A/D RESULT.
    
ADRESH        A/D register
    endc
;-----[Reset Vector]---------------------------------------------------------
    
ORG     0x000        PIC goes here (Origin of codeafter reset.
    
movwf   OSCCAL        Load the oscillator calibration factor.
    
movlw   b'10001111'         Disable wake on pin changeEnable pull-up.
    
OPTION
    movlw   
b'00001100'         Set GP2=AN2 ,,  GP3 to an input  GP0,GP1,GP4,GP5=O/P.
    
TRIS    GPIO                 Register 06h
;            ---------------------------[Sub routine]-----------------------------------
dly_25us
    movlw    d
'8'        ;            
    
movwf    count        ;
keep    
    decfsz    count
,f        ;
    goto    
keep        ;
    
retlw    0        ;
dly_1s
    movlw    d
'255'        ;            
    
movwf    count1        ;
loop
    movlw    d
'255'            ;
    
movwf    count2            ;
loop_1    
    
    
goto    $+1                ;
    goto    $+
1                ;
    goto    $+
1                ;
    goto    $+
1                ;
    goto    $+
1                ;
    goto    $+
1                ;    
    
decfsz    count2,f        ;
    goto    
loop_1            ;
    
decfsz    count1,f        ;
    goto    
loop            ;
    
retlw    0

;-----[Main routine]------------------ 
init
    bcf    GPIO
,0        ;
    
bcf    GPIO,1        ;
    
bcf    GPIO,4        ;
    
bcf    GPIO,5        ;
    
call     dly_1s        ;
    
movlw    b'01111001'    GP2 to an A/D input ADC  ON
    movwf    ADCON0        
;
    
call    dly_25us        Wait for AN2 to set up .
    
bsf    ADCON0GO    start A/D conversion for GP2/AN2.
    
call     dly_25us        Wait for coversion .
wait
    btfsc    ADCON0
,GO    Conversion complete yetGO=0Done.
    goto    
wait        No,
    
movf    ADRESH,W    Read A/D result into W.
    
movwf    count3        Move W into count1 register
    movlw     
b'11001100'    4V=204=11001100.
    subwf    count3
,w        RESULT 4V.
    
btfsc    STATUS,C    ; If C=0  then RESULT4V 
    
goto    LED1        ; If C=1 then RESULT 4V,.
    
movlw     b'10011001'    3V=153=10011001.
    subwf    count3
,w        RESULT 3V.
    
btfsc    STATUS,C    ; If C=0  then RESULT3V
    goto    
LED2        ; If C=1 then RESULT 3V,
    
movlw     b'01100110'    2V=102=01100110.
    subwf    count3
,w        RESULT -2V.
    
btfsc    STATUS,C    ;  If C=0  then RESULT2V.
    goto    
LED3        ; If C=1 then RESULT 2V,
    
movlw     b'00110011'    1V=51=00110011.
    subwf    count3
,w        RESULT 1V.
    
btfsc    STATUS,C    ;  If C=0  then RESULT1V.
    goto    
LED4        ; If C=1 then RESULT 1V,
    goto    
LED5        ;
LED1
    bsf    GPIO
,0        Turn LED on.
    
call    dly_1s        ;
    
call    dly_1s        ;
    goto    
init        ;
LED2
    bsf    GPIO
,1        Turn LED on.
    
call    dly_1s        ;
    
call    dly_1s        ;
    goto    
init        ;
LED3
    bsf    GPIO
,4        Turn LED on.
    
call    dly_1s        ;
    
call    dly_1s        ;
    goto    
init        ;
LED4
    bsf    GPIO
,5        Turn LED on.
    
call    dly_1s        ;
    
call    dly_1s        ;
    goto    
init        ;
LED5
    bsf    GPIO
,5        Turn LED on.
    
call    dly_1s        ;
    
bcf    GPIO,5        Turn LED on.
    
call    dly_1s        ;
    
bsf    GPIO,5        Turn LED on.
    
call    dly_1s        ;
    goto    
init        ;
    
end


發表於: 2006/5/9 7:53
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... ]

教育訓練中心

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