• 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: 12F508 的 TOCS 定義問題請教各位前輩
#4
新會員
新會員


查看用戶資訊
感謝 "寫上癮了" 及 "版主" 的回覆

原廠資料已看過, 但是我還是不能理解為何我現在使用開機預設值為 "1" 為何能正常輸入及輸出?

謝謝!

發表於: 2007/12/27 18:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 12F508 的 TOCS 定義問題請教各位前輩
#3
版主
版主


查看用戶資訊
注意看一下 PIC12F508 的 Data Sheet 第22頁有關 Option_Register 的說明。
T0CS 位元開機後的內定值為 "1" 如果要設為 GP2 的劃一定要將 T0CS 位元清除為 "0"

發表於: 2007/12/27 11:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 12F508 的 TOCS 定義問題請教各位前輩
#2
資深會員
資深會員


查看用戶資訊
T0CS: Timer0 Clock Source Select bit
1 = Transition on T0CKI pin (overrides TRIS on the T0CKI pin)
0 = Transition on internal instruction cycle clock, FOSC/4

Note: If the T0CS bit is set to ‘1’, it will override
the TRIS function on the T0CKI pin.

GP2/T0CKI Pin在當作T0CKI功能時是用來計數上升綠或下降綠的次數,在你的應用控制裡沒有用到此功能,所以T0CS設定為0就可以了。

發表於: 2007/12/27 9:02
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


12F508 的 TOCS 定義問題請教各位前輩
#1
新會員
新會員


查看用戶資訊
關於12F508 OPTION 中的 TOCS 定義問題請教各位前輩

在 12F508 的程式中我只作單純開關控制 LED 燈光亮和熄
且在程式中只寫了 TRIS 定義 GP2 接腳為輸入, GP0, GP1
腳位為輸出, 我沒有使用 TMR0 功能, 測試結果功能正常.

但是在原廠資料中發現 GP2 作 I/O 用途時必須先定義
OPTION 的 TOCS 為 0 才能作 I/O 用途, 請問必要這樣麼
若不定義的話會產生什麼後果呢...

謝謝!

發表於: 2007/12/27 5:36
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... ]

教育訓練中心

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