[問題] Timer1

看板C_and_CPP (C/C++)作者 (平凡)時間9年前 (2016/12/28 18:30), 9年前編輯推噓1(101)
留言2則, 2人參與, 最新討論串2/2 (看更多)
開發平台(Platform): (Ex: Win10, Linux, ...) win7 編譯器(Ex: GCC, clang, VC++...)+目標環境 arduino 問題(Question): 按1, "馬上" .......進中斷, 沒有......50ms才進 怎麼修正才可以呢? 餵入的資料(Input): 按鍵盤1與2 預期的正確結果(Expected Output): pin4 pulse -> 50ms -> pin5 pulse ->50ms ->pin5 pulse 錯誤結果(Wrong Output): pin4 pulse -> 小於10ms -> pin5 pulse ->50ms ->pin5 pulse ^^^^^^^ pin4 pulse後 馬上中斷,沒等50ms 程式碼(Code): http://pastebin.com/jyYWej2w -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.251.227.231 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1482921052.A.0C8.html

12/28 19:33, , 1F
還沒看code 先猜pulse還沒進來就開始計時
12/28 19:33, 1F
※ 編輯: GooLoo (111.251.227.231), 12/28/2016 20:44:51

12/28 20:44, , 2F
我有試過case1 送TIFR1 &= ~(1<<ICF1); 但還是一樣
12/28 20:44, 2F
文章代碼(AID): #1OOvHS38 (C_and_CPP)
討論串 (同標題文章)
文章代碼(AID): #1OOvHS38 (C_and_CPP)