Re: 如何計算timer的值
|
||||
---|---|---|---|---|
版主
|
用兩組 Input Capture 的話是可以共用一個 Time Base 的,因為計算的時間差是這是捉到的 Timer 值減去上次抓到的 Timer 值,要注意的是在 65535 的溢位處理,先判定大小後再決定誰減誰,用筆算一下就知道了。
發表於: 2009/4/6 18:55
|
|||
|
Re: 如何計算timer的值
|
||||
---|---|---|---|---|
初級會員
|
那麼同時捕捉頻率和PWM duty兩個訊號
可同時使用同一個timer嗎?
發表於: 2009/4/6 14:53
|
|||
|
如何計算timer的值
|
||||
---|---|---|---|---|
初級會員
|
FCY 7372800 * 2
OpenTimer1( T1_ON & T1_IDLE_STOP & T1_GATE_OFF & // Timer1 的 Period 設為每 200 ms T1_PS_1_64 & T1_SYNC_EXT_OFF & T1_SOURCE_INT , (long)((FCY/ 1000)* 200 )/64 ) ; 怎麼計算Timer1的Period為200ms? 我算過(((7372800x2)/1000)*200)/64)=46080 1/46080=0.217us 這樣的設定有什麼功能?
發表於: 2009/4/2 16:22
|
|||
|