Timer ticks and timer beats ???

Collapse
X
 
  • Giờ
  • Show
Clear All
new posts
  • dvkkt
    Đệ tử 3 túi
    • Oct 2007
    • 55

    #1

    Timer ticks and timer beats ???

    __ If timer register (TMR0) is used to keep track of timer beats
    __ the timer ticks as each instruction executes.

    timer ticks và timer beats nghĩa nó khác nhau chổ nào, và nó nói về cái gì, các bác có thể giải thích rõ hơn không ??
  • bien_van_khat
    ...Damned...
    • Apr 2006
    • 503

    #2
    Bạn nên cung cấp nguyên một văn cảnh bạn à, chỉ có một câu thì khó mà hiểu đúng lắm.
    - Xin đọc trước khi post bài

    Xin đặt code trong thẻ [ code ] [ /code ]

    Comment

    • dvkkt
      Đệ tử 3 túi
      • Oct 2007
      • 55

      #3
      Nguyền văn như sau:
      _ The actual implementation of a delay routine based on multi-byte counters presents some dificulties. If the timer register (TMR0) is used to keep track of timer beats, then detecting the end of the count poses a subtle problem. Intuitively, our program could detect timer overflow by reading the TMR0 and testing the zero flag in the STATUS register. Since the movf instruction affects the zero flag, one could be tempted to code:
      wait
      movf tmr0,w
      btfss status,z
      goto wait
      _ But there is a problem: the timer ticks as each instruction executes. Since the goto instruction takes two machine cycles, it is possible that the timer overflows while the goto instruction is in progress; therefore the overflow condition would not be detected.

      Comment

      • Jerry
        Đệ tử 5 túi
        • Sep 2006
        • 100

        #4
        [bold]Timer beat[/bold]: Nhịp của timer. "Thanh ghi TMR0 được dùng để giữ nhịp cho timer". Nghĩa là thanh ghi TMR0 được dùng để lưu giá trị của timer trong quá trình timer chạy. "Nhịp" ở đây được hiểu là xung clock làm cho timer tăng giá trị đếm lên 1.


        [bold]Timer tick[/bold]: Từ "tick" ở đây không thể tìm được nghĩa tiếng Việt nào phù hợp. Với cái đồng hồ quả lắc, mỗi giây trôi qua nó sẽ kêu "tick" 1 cái, vì đơn vị đo nhỏ nhất của nó là giây. Còn với timer chúng ta đang nói đến thì đơn vị đo nhỏ nhất của nó là 1 chu kỳ lệnh. Có thể hiểu câu này là: "Timer sẽ đếm tăng sau mỗi chu kỳ lệnh".

        Comment

        • Dieunhienxinhde
          Nhập môn đệ tử
          • May 2018
          • 1

          #5
          Bài viết hay mà

          Comment

          Working...