• 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: 關於10F206 簡單程式 有些疑問 ?_?
#2
版主
版主


查看用戶資訊
movwf OSCCAL ; 適用於 PIC10Fxxx 及 PIC12Cxxx, PIC12Fxxx , PIC16F505 等PIC16C5x架構的 PIC.

bsf OSCCAL,0 ; 將 4MHz Internal RC 除以四後由 GP2 輸出

movlw B'11110011
movwf CMCON0
是將電壓比較器關掉不用

發表於: 2005/5/4 22:20
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於10F206 簡單程式 有些疑問 ?_?
#1
資深會員
資深會員


查看用戶資訊
VARIABLE DEFINITIONS
temp            EQU         0x08        
;example variable definition
Delay_Var1        EQU        0x09 
Delay_Var2        EQU        0x0a
;**********************************************************************
    
ORG     0x1FF             processor reset vector
Internal RC calibration value is placed at location 0x1FF by Microchip
; as a movlw kwhere the k is a literal value.
    
ORG     0x000             coding begins here  
    movwf   OSCCAL      
update register with factory cal value
            bsf       OSCCAL
,0
start    
    nop                       
example code
    movlw   0xFF              
example code
    movwf   temp              
example code
remaining code goes here
    movlw       
B'11110011 
    movwf       CMCON0
    movlw       B'
11111100 
    tris       GPIO
Null_Loop
    bsf    GPIO
,0
    bsf    GPIO
,1
    call    Delay
    bcf    GPIO
,0
    bcf    GPIO
,1
    call    Delay
    
goto    Null_Loop 
Delay
    clrf    Delay_Var1
Delay_Loop2
    clrf    Delay_Var2
Delay_Loop1
    nop
    nop
    decfsz    Delay_Var2
,F
    
goto    Delay_Loop1
    decfsz    Delay_Var1
,F
    
goto    Delay_Loop2
    
return
    
END                       directive 'end of Program'


*********** Question ????? ***********

movwf OSCCAL bsf OSCCAL,0
(1)是否一開始都要如此設定 也適用於12c508,and 16f84嗎?
(2)start 後面的 nop 是有何作用呢 ?
movwf CMCON0
(3)這又在做甚麼??
(4)Delay 多少時間呢 ?

發表於: 2005/5/4 2:46
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... ]

教育訓練中心

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