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


Browsing this Thread:   1 Anonymous Users






Re: 想請教計數器問題
#7
中級會員
中級會員


查看用戶資訊
我懂了。謝謝版大的回答! 謝謝

發表於: 2007/4/30 17:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 想請教計數器問題
#6
版主
版主


查看用戶資訊
2500 轉成 10進制的方法是不是先將 2500/256= 9 得到MSB的值,剩下餘數的就是LSB的值。

發表於: 2007/4/30 10:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 想請教計數器問題
#5
中級會員
中級會員


查看用戶資訊
請問
Timer Value=2500
1.是不是就是計數器數了2500次呢?

2.這樣的寫法
TimerH = 2500/256=9
TimerL = 2500%256= 196
是不是等於WriteTimerX(2500)呢?

3.
TimerH = 2500/256=9
TimerL = 2500%256= 196

我知道256是2的8次方。
也就是
TimerH代表計數器內容的高8位元組
而TimerL代表計數內容的低8位元組
可是我不知道為什麼是這樣算的
為什麼要TimerH要除256呢?
和TimerL是取256的餘數呢?

謝謝版大!

發表於: 2007/4/28 17:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 想請教計數器問題
#4
版主
版主


查看用戶資訊
公式 = (Fosc /4) / 預除器值 / Timer 值 = 中斷時間

Fosc = 4MHz , Prescaler = 1:4 , 中斷時間要求 : 10mS
(4Mhz/4) / 4 / (Timer Value) = 10mS = 100Hz
Timer Value = 2500
TimerH = 2500/256 = 9
Timerl = 2500%256= 196

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


Re: 想請教計數器問題
#3
中級會員
中級會員


查看用戶資訊
謝謝你! 可是我還是不太懂中斷時間應該怎麼算,我有再重新發問一次,可以請你回答我嗎?

發表於: 2007/4/26 16:31
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 想請教計數器問題
#2
資深會員
資深會員


查看用戶資訊
1. 應該是 0.0833 uS ( 1 / 12 MHz CLOCK 要先除 4 )

2. PIC 18 為 8 bit uC , 一次處理資料量 為 8 bit 所以應該 (2) 才對

發表於: 2007/4/26 6:02
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


想請教計數器問題
#1
中級會員
中級會員


查看用戶資訊
想請教大家一個計數的問題:
假如我使用的是PIC18F4550
然後使用TIMER0並設成16Bits
而且使用指令週期變脈波變化
沒有設除頻

1.計數的值會從0x0000->0XFFFF
請問計數一次(就是從0x0000->0x0001)的時間
該怎麼計算呢?
-----------------------------------------
我是這樣想的,請問有錯嗎?
1/48MHZ=208us
-----------------------------------------
2.在使用TIMER0計數器數值暫存器時
(16位元的)
是寫成
(1). TMR0H:TMROL=0x0FFF

(2). TMR0H=0x0F
TMR0L=0xFF
請問哪個寫法是對的呢?



發表於: 2007/4/25 21:33
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... ]

教育訓練中心

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