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


Browsing this Thread:   2 Anonymous Users






Re: PORTC 不會變化?
#6
版主
版主


查看用戶資訊
參照:

snjay 寫道:
PIC16F505程式如下
list      p=16F505            ; list directive to define processor
    
#include <p16F505.inc>        ; processor specific variable definitions

    
__CONFIG   _MCLRE_ON _CP_OFF _WDT_OFF _IntRC_OSC_RB4EN
;
    
org    0x0
    movwf    OSCCAL
initial
    movlw    0x0
    tris    PORTC
    movlw    0xD7
    option
    clrf    TMR0

start
    btfss            TMR0
,7
    
goto    start
    comf    PORTC
,F
;    clrwdt
    clrf    TMR0
    
goto    start
end


請問為何PORTC不會變化??
感恩

發表於: 2009/5/22 17:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PORTC 不會變化?
#5
新會員
新會員


查看用戶資訊
那我只要使用 TIMER的話 該如何寫這程式呢??

發表於: 2009/5/22 17:23
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PORTC 不會變化?
#4
版主
版主


查看用戶資訊
沒啟動 WDT 那你檢查 TO 位元,然成是不會往下執行,永遠當在:
start
btfsc STATUS,NOT_TO
goto start

迴圈裡。

發表於: 2009/5/22 17:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PORTC 不會變化?
#3
新會員
新會員


查看用戶資訊
可是我沒有啟動WATCH-DOG 也會RESET IC嗎??

如果我只是要用TIMER而已的話
只要用您建議的方式
去檢查TMR0的BIT 7 就好了是嗎??

發表於: 2009/5/22 17:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PORTC 不會變化?
#2
版主
版主


查看用戶資訊
參照:

start
btfsc STATUS,NOT_TO
goto start


NOT_TO 檢測的是 Watch-Dog Timer Time Out Status, 平常在這裡坐迴圈偵測一但發生 WDT 時TO 為零,但 PIC 也被 Reset 了。所以建議改用 btfss TMR0,7 檢查 Timer0 來代替 WDT

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


PORTC 不會變化?
#1
新會員
新會員


查看用戶資訊
PIC16F505程式如下

org 0x0
movwf OSCCAL
initial
movlw 0x0
tris PORTC
movlw 0xD7
option
clrf TMR0

start
btfsc STATUS,NOT_TO
goto start
comf portc,f
clrwdt
clrf TMR0
goto start
end

請問為何PORTC不會變化??
感恩

發表於: 2009/5/22 16:43
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... ]

教育訓練中心

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