Re: 想請教計數器問題
|
||||
---|---|---|---|---|
中級會員
|
我懂了。謝謝版大的回答! 謝謝
發表於: 2007/4/30 17:39
|
|||
|
Re: 想請教計數器問題
|
||||
---|---|---|---|---|
版主
|
2500 轉成 10進制的方法是不是先將 2500/256= 9 得到MSB的值,剩下餘數的就是LSB的值。
發表於: 2007/4/30 10:47
|
|||
|
Re: 想請教計數器問題
|
||||
---|---|---|---|---|
版主
|
公式 = (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
|
|||
|
Re: 想請教計數器問題
|
||||
---|---|---|---|---|
中級會員
|
謝謝你! 可是我還是不太懂中斷時間應該怎麼算,我有再重新發問一次,可以請你回答我嗎?
發表於: 2007/4/26 16:31
|
|||
|
Re: 想請教計數器問題
|
||||
---|---|---|---|---|
資深會員
|
1. 應該是 0.0833 uS ( 1 / 12 MHz CLOCK 要先除 4 )
2. PIC 18 為 8 bit uC , 一次處理資料量 為 8 bit 所以應該 (2) 才對
發表於: 2007/4/26 6:02
|
|||
|
想請教計數器問題
|
||||
---|---|---|---|---|
中級會員
|
想請教大家一個計數的問題:
假如我使用的是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
|
|||
|