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


Browsing this Thread:   1 Anonymous Users




« 1 2 3 4 (5)


Re: Regarding to Timer0
#2
資深會員
資深會員


查看用戶資訊
yiming 大鍋的Timer0轉載如下
timer0 prescale 1:4
 timer
:
          
clrwdt  movlw .23
          subwf tmr0
,w
          btfsc status
,c
          
goto timer
          clrf tmr0
          clrf fsr 
;bank0
           
....
           ....
           
decfsz t100us,f
           
goto mq1 
           movlw .50
           movwf t5ms       
;t5ms
           
...
           ...
           
decfsz t5ms,f
           
goto mq1
           movlw .50
           movwf t5ms
           incf t250ms
,f       ;t250ms
           
...
           ...
mq1:
           
clrf fsr ;bank0
           retlw .0
;---------------------------------------------------
main:
            
call timer
            
...
            ...
            
btfsc t250ms,;led on 250ms/off 250ms
            bsf rc
,led ;
            
btfss t250ms,;
            
bcf rc,led ;
            goto 
main

可以用來做來較大時間的延遲.
ex:
delay_10sec:
           
clrf t250ms
dly_lop
:
            
call timer
            movlw .10
*;10 sec 更改這裡就可以改變延遲時間
            subwf t250ms
,w
            btfss status
,c
            
goto dly_lop
            retlw .0

Beee 大鍋的Timer0
set tmr0 to zero
set prescaler
to_loop:
            ...
            ...
            ... do 
something ....
            
movf tmr0 f          is tmr0 overflow 255 --> 0
            btfss status 
zero_flag
            
goto $ -2
            
goto to_loop yes tmr0 is overflow


發表於: 2007/8/21 0:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Regarding to Timer0
#1
資深會員
資深會員


查看用戶資訊
Dear All;
轉抬啦.... 繼續討論Timer0 ......

版主提到Timer0中斷, 應該不適用於10F200 & 12F508;
笨鴨有時很固執, 因為如此基本的Timer0都不會用...
如果進化到有中斷的PIC去, 短期而言 問題是解決了...
但是基本的 Timer0還是不了解....Right?
這好比手排車與自排車 ,會開手排車的人一定會開自排車;
反之則不可而知, 但是手排車一定跑的比較快, 對吧?

yiming 大鍋說的對, 因為澈底了解才能舉一反三;
同一棵PIC, 別人做不得到的程式 ,你能完成....
那才是功力與成就感....Right?
對不起啦! Ryang版主, 笨鴨有時很固執 ,很煩人 ,
請見諒lor, 並請耐心多多教導 ,3Q lar!

發表於: 2007/8/21 0:08
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... ]

教育訓練中心

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