• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 完全不懂MCU...
#3
版主
版主


查看用戶資訊
如有需一些範例程式程式可以直接 Post 到網站來,相信很多人會樂於幫助你的。

底下程式就是最簡單的讓 GPIO 0 & 1 的輸出Hi-Low變化
list      p=10F206            ; list directive to define processor
    
#include <p10F206.inc>        ; processor specific variable definitions

    
__CONFIG   _MCLRE_OFF _CP_OFF _WDT_OFF

'__CONFIG' directive is used to embed configuration word within .asm file.
The lables following the directive are located in the respective .inc file
See respective data sheet for additional information on configuration word.




;***** 
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'

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


Re: 完全不懂MCU...
#2
高級會員
高級會員


查看用戶資訊
右邊的範例程式可以先參考
教材及講義也有詳細說明
若看過一些
基本功能應該沒有問題

發表於: 2005/4/30 18:37
IWC
IWC
JL
Rolex


PP
有點距離
越來越遠
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


完全不懂MCU...
#1
資深會員
資深會員


查看用戶資訊
很想進入PIC領域 也很想參加研討會
但是我住LA 所以不知如何下手
看到pic 10F 系列上市 更加心動
找遍網路就是看不到 10F 系列 DEMO程式
如簡單LED Flasher, Timer, PWM...
所以到此來求救 尋找第二春 哈哈
老先生我 在此一鞠躬 先謝謝個位MCU前輩囉

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

教育訓練中心

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