[問題] 8bit MCU 計時問題
目前,閒閒沒事,回味一下以前用51寫控制器的大學生活
現在公司剛好有用到合泰的MCU
現在工作頻率用內部的RC振盪最慢能設定32kHz
內部的計時器的比較器最多10bit 1024
我想要寫一個Hihg 0.5s Low 1.5s
然後按鍵有五顆
分別是開關機 兩顆改變占空比 兩顆改變頻率
內部計時器沒辦法跑到秒那麼大的單位
最多就到mS
現在我是用一個變數
每跑一次掃描按鍵狀態和輸出,就加1
加到設定值再歸零
就一直這樣重覆
靠變數去控制單一模式的流程
想問一下,是否還有不一樣的解法?
目前,速度是8Mhz
用IDE-3000 C V3編輯
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.165.25.73
※ 文章網址: https://www.ptt.cc/bbs/ASM/M.1499957298.A.A5F.html
→
07/14 00:30, , 1F
07/14 00:30, 1F
推
07/14 02:23, , 2F
07/14 02:23, 2F
→
07/14 08:13, , 3F
07/14 08:13, 3F
→
07/14 08:13, , 4F
07/14 08:13, 4F
→
07/14 08:14, , 5F
07/14 08:14, 5F
推
07/14 08:49, , 6F
07/14 08:49, 6F
→
07/14 12:43, , 7F
07/14 12:43, 7F
→
07/14 19:32, , 8F
07/14 19:32, 8F
→
07/14 21:17, , 9F
07/14 21:17, 9F
→
07/14 21:38, , 10F
07/14 21:38, 10F
→
07/14 21:39, , 11F
07/14 21:39, 11F
推
07/15 01:26, , 12F
07/15 01:26, 12F
→
07/15 10:18, , 13F
07/15 10:18, 13F
→
07/15 10:19, , 14F
07/15 10:19, 14F
推
07/16 03:03, , 15F
07/16 03:03, 15F
→
07/18 17:58, , 16F
07/18 17:58, 16F
→
07/18 17:59, , 17F
07/18 17:59, 17F
推
07/19 01:28, , 18F
07/19 01:28, 18F
→
07/19 01:28, , 19F
07/19 01:28, 19F
→
07/19 01:38, , 20F
07/19 01:38, 20F
→
07/19 01:39, , 21F
07/19 01:39, 21F
→
07/19 01:39, , 22F
07/19 01:39, 22F
→
07/19 06:38, , 23F
07/19 06:38, 23F
推
07/19 20:22, , 24F
07/19 20:22, 24F
推
07/19 23:39, , 25F
07/19 23:39, 25F
→
07/19 23:43, , 26F
07/19 23:43, 26F
→
07/19 23:46, , 27F
07/19 23:46, 27F
→
07/19 23:52, , 28F
07/19 23:52, 28F
→
07/19 23:52, , 29F
07/19 23:52, 29F
推
07/20 00:05, , 30F
07/20 00:05, 30F
→
07/20 00:05, , 31F
07/20 00:05, 31F
→
07/20 00:06, , 32F
07/20 00:06, 32F
→
07/20 00:06, , 33F
07/20 00:06, 33F
→
07/20 01:23, , 34F
07/20 01:23, 34F
※ 編輯: HiJimmy (1.168.14.22), 07/20/2017 21:34:31
推
08/12 13:21, , 35F
08/12 13:21, 35F
→
08/12 13:22, , 36F
08/12 13:22, 36F
→
08/12 13:24, , 37F
08/12 13:24, 37F
→
08/12 13:24, , 38F
08/12 13:24, 38F
→
08/16 01:25, , 39F
08/16 01:25, 39F
→
08/16 01:25, , 40F
08/16 01:25, 40F
ASM 近期熱門文章
PTT數位生活區 即時熱門文章